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

Patrick R. Michaud pmichaud at pobox.com
Tue Feb 21 07:34:53 CST 2006


On Tue, Feb 21, 2006 at 12:47:48PM +0000, Hans wrote:
> PS to please don't:
> 
> The new behavior has eliminated lots of question marked links I found
> on sidebars/rightbars etc of new pages using markup like
> [[{$Name}?setcolor=....| ... ]] [[{$Name}?setview=....| ... ]]
> etc. , i.e. kinds of "action links" without ?action=... but for
> changing variables and  setting cookie values etc.

Under the latest proposal (below), you could easily solve the above 
by using

  [[{$Name}?action=browse?setcolor=... | ...]]
  [[{$Name}?action=browse?setview=... | ...]]

Yes, it's longer, but besides Chris Cox's situation, here's another
counter-example using EditTemplates:

  [[{$Name}?template=SomePage | ...]]

This is using "SomePage" as a template for newly created pages;
clearly if the target page doesn't exist we want a create-link
generated, even though there's a query string.  (Note that
under the current system, there's *no* way to get that link
to appear as a create page link.)

So, my latest thinking is that a link to a non-existent page
generates a "create page" link, except if "action=" is present
in the link's query argument, in which case it's a normal page
link.  In this way an author can always cause a link to appear
as a normal page link by adding ?action=... to the link target.

This handles (cleanly) the case of having ?action=attr or
?action=diff on non-existent pages; it also continues to work
(cleanly) for things such as the PmCalendar recipe and EditTemplates,
it also works as we would normally want for the page action links.

It allows, admittedly somewhat less cleanly, for things like

    [[BlogComments.{=$Name}?action=browse#commentbox| Add Comment]]
    [[{$Name}?action=browse?setcolor=... | ...]]

but at least it's a relatively easy fix that doesn't require special
handling in PHP code.  And since the two cases above tend to occur
in template pages of various sorts (that are already have special
markup considerations), this doesn't seem too high a price to pay.

Pm




More information about the pmwiki-users mailing list