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

Patrick R. Michaud pmichaud at pobox.com
Tue Feb 21 15:53:31 CST 2006


On Tue, Feb 21, 2006 at 07:57:47PM +0000, Hans wrote:
> Tuesday, February 21, 2006, 7:19:07 PM, Patrick wrote:
> > Then we might need to handle the case of links to non-existing 
> > pages with query arguments versus links to existing pages with 
> > query arguments... (sigh) it all starts to sound overly
> > complex to me, especially for what we're trying to solve.
> 
> I would be happy if links like [[{$name}?query..]] were classed as
> wikilink, as are links to nonexistent pages with query ?action=...

Here's what I've ended up with (currently implemented on pmwiki.org):

- If a link goes to a non-existent page, *and* if the query arguments
  do not contain an "?action=" parameter, then the link is a page
  creation link (using class='createlink') and is generated using
  either $LinkPageCreateFmt or $LinkPageCreateSpaceFmt.

- If a link goes to the current page (i.e., self reference) and
  if there are no query arguments, then the link is a self reference
  link (class='selflink') and is generated using $LinkPageSelfFmt.

- Otherwise, the link is generated using link='wikilink' and
  $LinkPageExistsFmt.

This is exactly the same behavior as beta25, except that a link
to a non-existing page that contains "?action=" is treated as
a normal wikilink.

Thus we have (*** = behavior differs from beta25):

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

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

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

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).

AFAICT this works with both PmCalendar and the various ?setview=
recipes on pmwiki.org.

Pm




More information about the pmwiki-users mailing list