[pmwiki-users] Stuck creating markup to add self link to included pages

DaveG pmwiki at solidgone.com
Tue Oct 2 15:03:45 CDT 2007


This actually doesn't seem to work. It appears to simply point to the 
current page, rather than the included page.

  ~ ~ Dave

Dominique Faure wrote:
> On 10/1/07, Chris Cox <ccox at airmail.net> wrote:
>> Dominique Faure wrote:
>>> On 9/29/07, Chris Cox <ccox at airmail.net> wrote:
>>>> In later version of PmWiki you can do put the following in a page:
>>>>
>>>> [[{$FullName}?action=edit|edit]]
>>>>
>>>> And then when the page is (:include:)'d, it's a link
>>>> to edit the included content.  Nice.
>>>>
>>>> I'd like to create a new markup that adds this to a page
>>>> instead of typing all of the above in.  But, I can't figure
>>>> it out.  Any hints?
>>>>
>>>> For example, I could add (:e:) and it would effectively
>>>> be the same as having the above inside the page to be
>>>> included.
>>>>
>>>>
>>> What about (untested)?
>>>
>>> $ROSPatterns['/\\(:e:\\)/'] = '[[({$FullName}?action=)edit]]';
>>>
>> Hmmm... ok... but I really want a markup, not a substitute on
>> save solution (want to keep the simplified markup in the page).
>>
>> Anyone else have an idea?
>>
> 
> Then, here you are with an "almost-regular" markup ;)
> 
> Markup('(:e:)', 'directives', '/\\(:e:\\)/ei',
>   "'[[('.PageVar(\$pagename,'\$FullName').'?action=)edit]]'");
> $QualifyPatterns['/\\(:e:\\)/ei'] =
>   "'[[('.PageVar(\$pagename,'\$FullName').'?action=)edit]]'";
> 
> The Markup(...); directive is responsible for generating the edit link
> when pages are displayed directly.
> The $QualifyPatterns[...] definition handle the markup transformation
> when the considered page is included into another one.
> 
> Hope this helps,



More information about the pmwiki-users mailing list