[pmwiki-users] Re: "Dynamic" wiki trails - passing along the name of the trail page
chr at home.se
chr at home.se
Wed Mar 9 08:35:36 CST 2005
On Wed, 9 Mar 2005, Patrick R. Michaud wrote:
> > http://www.pmwiki.org/wiki/Test/SomePage?trail=Test/TrailPage
> > It doesn't feel so good to force where the trail links are shown, so
> > unless you modify the template to allocate space for the trail, I think
> > we'll need a special markup which will then be replaced with the "dynamic"
> > trail.
>
> I propose <<||>>, or perhaps even <<|{$Trail}|>>.
Works for me. Hmm... what about generalizing this idea of extracting the
an argument from the URI? We could then in principle write the markup like
this:
<<|(:URI-arg trail:)|>>
where (:URI-arg trail:) would extract the trail=... from the URI -- if it
exists. You could imagine using (:URI-arg trail default=Main.TrailPage:)
to set a default value for the variable. Maybe you'd prefer using
{$URI-arg trail}
to extract an argument, and consequently
<<|{$URI-arg trail}|>>
A slight problem is then what <<||>> should result in.. I'd probably vote
for it to show nothing at all.
> But this still feels like a halfway measure to me -- if we're going this far,
> there ought to be some way to have the trail automatically appear
> even w/o the markup. But so far the mechanisms I can imagine for doing this
> aren't very pleasing.
Well... what are the options:
* Always allocate trail(s) their own space on the page template (this
could be good or bad depending on what your template looks like).
* Allow a directive to manually insert the "current" trail, if it exists
(this includes using GroupHeader and/or GroupFooter)
* Others?
I think using GroupHeader/GroupFooter could work well for me...
especially if there was someway to only insert this special markup
if the argument is there... This means we'd need something like:
(:if URI-arg-exists=trail:)
Current trail: <<|{$URI-arg trail}|>>
(:ifend:)
Anyway... I suspect that if we implement something like the above and
people start using it, we'll soon get requests for this to be
automatically inserted... then we can ask them where/how they'd like it
inserted...
Btw, I think it would be nice if "directives" were always possible to
write in the "standard" way, i.e. using (:directive:)... that would be
easier for me to explain to newbies, then I could tell them:
All PmWiki directives and commands can be written as (:...:).
To see a list of available directives, go to this page...
I suspect it can be a bit overwhelming for a newbie to see all the various
markup alternatives, especially "short forms" of them... at least it is
easy to recognize (:...:) as some kind of directive (and then look in the
documentation to see what it does).
An advantage with (:trail TrailPage:) is that it's relatively easy to
understand from when looking at the wiki source, whereas <<|TrailPage|>>
is easy because it's sort of similar to the rendered result.
Anyway, I'm definitely not suggesting discarding <<|Trail|>>, rather that
we allow something like (:trail ...:) to be used as a synonym. And in
extension, that we always try to have a (:...:)-form of directives as a
backup.
/Christian
--
Christian Ridderström, +46-8-768 39 44 http://www.md.kth.se/~chr
More information about the pmwiki-users
mailing list