[pmwiki-users] Wikitrail Feature Request . . .

Patrick R. Michaud pmichaud at pobox.com
Fri Jan 6 10:04:01 CST 2006


On Thu, Jan 05, 2006 at 07:31:40PM -0600, Ben Wilson wrote:
> Pm,
> 
> Would you mind making the returned markup for the wikitrails 
> customizable? Presently, the output of the wikitrial is hard coded. (See 
> lines 80, 96, 102.

Until we had the page variables code (beta15 and later) there 
wasn't a really good mechanism for customization.  But even now that
we have them it still might not be simple.  Here are the issues
as I envision them at the moment...

I'm thinking that the customization ought to be
possible via something like:

    $TrailLinkFmt = '&lt;&lt; {<$Link} | {=$Link} | {>$Link} &gt;&gt;';

where "Link" is the markup corresponding to the trail page.  Then,
conceivably one could write

    $TrailLinkFmt = 
      '&lt;&lt; [[{<$FullName}|+]] | {=$Link} | [[{>$FullName}|+]] &gt;&gt;';

to force the use of page titles in the previous and next links.
Unfortunately, this doesn't work when we're at the beginning or
end of the trail, because (for example) the beginning would
translate into markup like "<< [[|+]] | TrailPage | [[NextPage|+]] >>"
and that previous link is all screwed up.

So, we have to figure out how to handle the customization when
there's no previous or next link in the trail, and that involves
a little bit more than just the strings on lines 80, 96, and 102. 
And somehow using conditional markup for this purpose seems like
an extreme overcomplication for something that ought to be
relatively simple and straightforward.

It has occurred to me recently (in a couple of contexts, including
this one) that perhaps double-bracket links without valid targets 
ought to simply be removed from the output.  Then the following would
all display nothing

    [[|+]]
    [[ | link text ]]
    [[ link text -> ]]

and the "<< [[|+]] | TrailPage | [[NextPage|+]] >>" example I
gave above would work.

But I'm still having to think about it a bit.  At the moment the
way to customize trail output is to write a custom TrailMarkup
handler that generates exactly what you want (similar to the
ones in trails.php).

Pm





More information about the pmwiki-users mailing list