[pmwiki-users] Actions and Anchors?
Petko Yotov
5ko at 5ko.fr
Tue Nov 19 01:11:05 PST 2024
On 19/11/2024 07:34, Martin Cuno wrote:
> Antwort auf die Nachricht von Petko Yotov vom 18.11.2024, 15:30:23 Uhr
>>> b) How can I incorporate a certain anchor into a new link target if
>>> I'm
>>> on it?
>
>> Not sure what you mean. If the edited page has many anchors, and
>> submit
>> it, PmWiki doesn't know where was the cursor.
>
> However: I use the recipe "SectionEdit". If I have edited a section
> and saved it, I end up on an anchor like: ?n=Fz.Fz146#sFz.Fz146_7
>
> Question: did PmWiki handle and send a variable for this? Can I use
> this to make a link out of it? (Of course, I don't enter the links for
> my "$action" manually, but have a button for it; so I would like to
> store this variable there.)
This is not PmWiki but the recipe SectionEdit, you can look in the
script how it is done.
When you edit a section, you click on a link that has the number of the
section. SectionEdit remembers this number, and when you submit the
page, it redirects to a URL like "{$PageUrl}#s{$FullName}_7" where "7"
the number of the section, look for lines containing "Redirect(".
So in your case you would want to redirect to "{$PageUrl}#A7815" or
"{$PageUrl}?action=lgcsimpel1#A7815" where A7815 is the identifier of
your anchor. So you would need to transmit this identifier from the page
to the edit form, and then from the edit form to the function that saves
the page, which will then redirect back to the anchor.
Petko
More information about the pmwiki-users
mailing list