[pmwiki-users] One PageList using several fmt : possible ?

Petko Yotov 5ko at 5ko.fr
Fri Dec 10 03:09:30 CST 2010


On Friday 10 December 2010 03:53:54, ABClf wrote :
> For a basic example, imagine I want for my page Category.Something
> (and every page in group Category) to show this :
> -if group the page listed belongs to is Info, then extract the
> title_info ptv for linking
> -if group the page listed belongs to is not Info, then use its name for
> linking.
> 
> Info
> *my title
> *my other title
> 
> OtherGroup
> *name

Hello. 

In your template, [[{=$FullName}|+]], will show the page title when it exists, 
and the page name, when a title isn't defined.

However, you want to read a custom PTV title, not the regular page title. 
Something like this could work:

in Site.LocalTemplates
[[#myfmt]]
(:template first {=$Group}:)

:[[{=$Group}/]] /:
(:template each:)
(:if equal "{=$Group}" "Info":)
* [[{=$FullName}| {=$:title_info} ]]
(:else:)
* [[{=$Group}/{=$Name}]]
(:ifend:)
[[#myfmtend]]

In Category.GroupFooter:
(:pagelist link={*$FullName} fmt=#myfmt:)

The conditional (:if group Info:) wouldn't work as the "group" conditional is 
related to the page being browsed, ie. Category.SomePage.

Petko



More information about the pmwiki-users mailing list