[pmwiki-users] Re: Dynamic wiki trails - passing along the name of the trail page
John Rankin
john.rankin at affinity.co.nz
Sun Mar 13 22:37:12 CST 2005
On Monday, 14 March 2005 4:36 PM, Patrick R. Michaud <pmichaud at pobox.com> wrote:
>In answer to Christian's suggestion about {$URI-arg trail}, perhaps a
>better markup is simply:
>
> {?trail}
>
>which substitutes the current value of the "trail" uri-parameter.
>We would then end up with the following:
>
> - <<|TrailPage|>> generates nothing if the current page is not listed
> on TrailPage
> - If the current page is on TrailPage, then the previous/next links
> generated by <<|TrailPage|>> have ?trail=Group.TrailPage added to
> the urls.
> - The markup {?trail} is replaced with the value of "trail" from the url
> - Thus <<|{?trail}|>> results in links to the next/previous page for
> the trail currently being "followed", as given by the ?trail parameter,
> and as long as the reader remains on the trail.
>
>Of course, the problem with the {?trail} approach (where the trails come
>from the urls) is figuring out how someone manages to get on the ?trail
>in the first place. :-|
Possible answers:
The TrailPage contains a (:trailpage:) directive, which pmwiki interprets
as an instruction to add ?trail=$FullName to any links which follow the
directive. However, this doesn't help if you land on a page on a trail
from somewhere other than the TrailPage.
Or, pmwiki contains SDV($TrailPage,TrailPage); and an
if (PageExists(FmtPageName("\$Group.$TrailPage",$pagename)))
add ?trail=Group.TrailPage to all urls. An administrator can
override the default $TrailPage at the group, wiki or farm level.
Er, but what happens if a page is on more than one trail??
>
>That said, I think it's very fair to say that <<||>> should be
>changed to no output, and we need a decision about what <<|TrailPage|>>
>should produce when the current page is not on TrailPage.
Well, it *could* be configurable. Suppose the default is that
<<|TrailPage|>> -> '' when the current page is off the trail.
An author could override this by adding the following to TrailPage:
(:showofftrail:)
Or, if the default is that <<|TrailPage|>> -> <<|TrailPage|>> when
the current page is off the trail, an author can override this
by adding the following to TrailPage:
(:hideofftrail:)
I'm sure the choice of directive can be improved. Since we have to
read the Trailpage anyway, looking for another directive is no big
deal.
--
JR
--
John Rankin
More information about the pmwiki-users
mailing list