[pmwiki-users] How to list categories used on any given page

Petko Yotov 5ko at 5ko.fr
Fri Dec 9 02:21:49 CST 2011


There is a solution using a custom PageVariable {$Links} and an example 
listing of the categories of a cookbook recipe (Flipbox):

  http://www.pmwiki.org/wiki/PITS/01204

Petko

On Friday 09 December 2011 08:30:10, kirpi at kirpi.it wrote :
> I am trying to use categories in a way that, when listing a given
> category, for each page I get:
>  - Title
>  - List of categories used on that page
> 
> So, imagine you go to page Category.Beta, you see something like:
>   Page One - tags: Alpha, Beta, Gamma, Omega
>   Page Two - tags: Delta, Eta, Theta, Beta, Sigma
>   Page Six - tags: Rho, Tau, Beta, Lambda
> 
> Yet I cannot find the way to list categories used on any given page.
> 
> My approach is:
> 
> In Category.GroupFooter I have
>  (:pagelist link={*$FullName} list=normal fmt=#mylist:)
> which works and lists the pages.
> 
> In Site.LocalTemplates I have
> 
>   >>comment<<
> 
>   [[#csv]]
>   (:template first {=$Group}:)
>   (:template each:)
>   [[{=$Group}/{=$Namespaced}]](:if ! equal {>$Group}:),(:if:)
>   [[#csvend]]
> 
>   >><<
> 
>   (:if false:)
>   [[#mylist]]
>   (:template each:)
>   * [[{=$FullName}|{=$Title}]] - tags: (:pagelist group=Category
> list=normal fmt=#csv:)
>   [[#mylistend]]
>   (:ifend:)
> 
> This way I get full the list comma separated categories for each listed
> page. Now, how can I now filter those specific to each page, please?



More information about the pmwiki-users mailing list