[Pmwiki-users] whither page refs

Patrick R. Michaud pmichaud
Tue Feb 24 14:25:12 CST 2004


On Tue, Feb 24, 2004 at 02:55:10PM -0500, Bob Dively wrote:
> In older versions of PmWiki the page title link had
> "action=search&text=$Title" in the url and took the user to
> a list of pages referencing that page. I notice that the
> current PmWiki home page (that is, the one on PM's site)
> doesn't have the extra query string items and so doesn't do
> the page referencing. PM, is this just the way you have the
> templating set up, or has the feature been deprecated (and
> if so, can it be undeprecated)?

It's just the way the templating is set up at the moment, and
I'm working on a way to restore that functionality within the
context of the template and still have things look "right".
Part of the problem is that the title is used as a backreference
search in the browse pages, while it's used as a "return to page view"
link in the edit/history/attach/other pages, and there's not an
easy straightforward way to control this logic via the template.

<long rant>
I can always set a $TitleLinkAction variable and use that in the template,
but somehow I feel like that confuses the template.  Essentially the template
code has to become
   ...<a href='$PageUrl$TitleLinkAction'>$Title</a>...

where $TitleLinkAction is set to ?action=search&amp;text=$Title when
browsing the page and left null otherwise.  UNFORTUNATELY, this won't
work on pages where $EnablePathInfo==0, because the conversion of $PageUrl
to either  
   .../pmwiki.php/Group/PageName 
or 
   .../pmwiki.php?pagename=Group.PageName 
takes place before $TitleLinkAction is substituted, so it misses the
opportunity to convert the leading '?' of $TitleLinkAction into an '&',
causing the backreference link to incorrectly become
   .../pmwiki.php?pagename=Group.PageName?action=search&amp;text=$Title
when it really needs to be
   .../pmwiki.php?pagename=Group.PageName&action=search&amp;text=$Title
and things just get messier from there.  So my best approach thus
far is to have $TitleLinkAction be set based on the value of $action
AND $EnablePathInfo, and it's still a little messier than I'd like
(I think there ought to be a better solution).
</long rant>

Anyway, I haven't completely abandoned the backreferences link and
I'm still looking for a good answer to it.  In many respects it would
be nice if "find references to this page" was explicitly referenced on
the page rather than (or perhaps in addition to) being implicitly 
available via the title link.

Pm



More information about the pmwiki-users mailing list