[pmwiki-users] Links to nothing changes cause side effect

Patrick R. Michaud pmichaud at pobox.com
Tue Feb 21 17:48:09 CST 2006


On Tue, Feb 21, 2006 at 11:27:12PM +0000, Hans wrote:
> Tuesday, February 21, 2006, 11:19:22 PM, Patrick wrote:
> > Or are you referring to a different "last two instances"?
> 
> no, but you said:
> 
> > In the last three instances using {$Name}, if the current page
> > doesn't exist then the link is always a createlink (this is
> > also the same as beta25).
> 
> meaning to my mind:
> 
> If page does not exist:
> [[{$Name}]]                      class='createlink'
> [[{$Name}?skin=gemini]]          class='createlink'
> [[{$Name}?action=diff]]          class='createlink'

Yeah, I totally messed up my original description, as well
as my reply to your message.  My apologies for that (and thanks
for your patience), let me try again.

First, note that [[{$Name}?skin=gemini]] isn't a special
markup; all that happens is that {$Name} is replaced by the
current page's name, and then it becomes an instance of the
normal [[PageName?skin=gemini]] markup and the other rules
take over from there.

So, let me try again from the beginning (*** again marks
differences from beta25).

    [[ExistingPage]]                class='wikilink'
    [[ExistingPage?skin=gemini]]    class='wikilink'
    [[ExistingPage?action=diff]]    class='wikilink'

    [[NewPage]]                     class='createlink'
    [[NewPage?skin=gemini]]         class='createlink'
    [[NewPage?action=diff]]         class='wikilink'    *** was createlink

Then, if the current page exists, we get the same as "ExistingPage"
above, except a link with no query arguments is 'selflink':

    [[{$Name}]]                     class='selflink'
    [[{$Name}?skin=gemini]]         class='wikilink'
    [[{$Name}?action=diff]]         class='wikilink'

If the current page does not exist, we get the same as "NewPage" above:

    [[{$Name}]]                     class='createlink'
    [[{$Name}?skin=gemini]]         class='createlink'
    [[{$Name}?action=diff]]         class='wikilink'    *** was createlink

> My ideal:
> If page does not exist:
> [[{$Name}]]                      class='createlink'
> [[{$Name}?skin=gemini]]          class='wikilink'
> [[{$Name}?action=diff]]          class='wikilink'

Unfortunately, the only way I can make this happen is by breaking
sites that expect (actionless) links to non-existent pages to
generate createlinks.  PmCalendar is one such recipe.  However, 
it's possible to get the ?skin=gemini link to be of type wikilink
by adding an action parameter:

    [[{$Name}?action=set&skin=gemini]]  class='wikilink'

This isn't to say that we're stuck with this particular formulation
for all time -- we may be able to eventually migrate things
so that any query arguments on a target results in a normal
wikilink.  But I think that compatibility concerns are likely
to limit us to basing it on "?action" for the time being.  :-|

Pm




More information about the pmwiki-users mailing list