[pmwiki-users] using a page's category to generate a wikitrail

tamouse mailing lists tamouse.lists at gmail.com
Thu Mar 29 09:32:29 CDT 2012


How would I use a page's category to generate a wikitrail?

What I would like to do is generate a trail based on what category a
page is assigned to to make a trail of all the various items in the
category such as:

   prev || up || next

Presently, I'm doing this by setting a Parent page text variable for
each page and generating the trail based on all the pages assigned to
that parent, like so:

In any given page:

(:Parent:ParentPage:)

Then, in the GroupHeader:

(:pagelist $:Parent={*$:Parent} group={*$Group} fmt=#parenttrail
name=-Template,-HomePage,-*-*:)

And #parenttrail is:

(:if false:)
[[#parenttrail]]
(:template each :)
(:if2 equal {*$FullName} {=$FullName}:)
>>navtrailright<<
(:if3 ! equal "" "{>$Name}" :)[[{>$Name}|+]](:if3end:)
>><<
>>navtrailleft<<
(:if3 ! equal "" "{<$Name}" :)[[{<$Name}|+]](:if3end:)
>><<
>>navtrailmiddle<<
[[{*$:Parent}]]
>><<
(:if2:)
[[#parenttrailend]]
(:if:)

Instead of using the Parent PTV, I'd like to use the (first) Category
the page contains, which is usually set in:

(:Categories:[[!Cat1]], [[!Cat2]], ... [[!CatN]]:)

Is this possible?

(To see how this works now, visit
http://wiki.tamaratemple.com/Recipes/BlueberryPancakes)



More information about the pmwiki-users mailing list