[pmwiki-users] Wiki trail in template header and footer
DaveG
pmwiki at solidgone.com
Sun Dec 11 22:45:24 CST 2005
Thank you very much. As you guessed, I was hacking this as I went along,
and got totally caught up in setting a variable. Didn't stop to think to
a simpler solution.
I'd like to write this up, and put it on the wiki. Is there a place it
fits best?
Patrick R. Michaud wrote:
> On Sun, Dec 11, 2005 at 11:21:13PM -0500, DaveG wrote:
>
>>Appologies for that -- it works as expected when used on a page that's
>>in the trail source. My last problem is to NOT show the trail when
>>$GLOBAL["TrailSource"] is not declared.
>
>
> Okay, this gets a bit tricky.
>
> Set the trail markup as follows:
>
> $TrailSource = '';
> Markup('^trail:', 'directives',
> '/^trail:(.*)/e',
> "PZZ(\$GLOBALS['TrailSource']='<<|$1|>>')");
>
> and then in the template, use
>
> <!--markup:$TrailSource-->
>
> The first line sets $TrailSource to an empty string, in case
> there's no (:trail:) markup. The trail markup sets $TrailSource
> to be the entire trail markup including the <<|...|>>.
>
> Pm
>
More information about the pmwiki-users
mailing list