[pmwiki-users] Grouping in pagelists

John Rankin john.rankin at affinity.co.nz
Thu Oct 23 02:59:00 CDT 2014


> Lets say I have a lot of pages in the format yyyy-mm-dd-description.
>
> I want to group then by year.
>
> Can anyone suggest a way of making
>
> (:template first {(substr {=$Name} 0 4)}:)
>
> work?

I did something recently with a page list of "first lines" where I needed
to group them by first letter of the first line. The only way I could get
this to work was with an if following the (:template each:):

(:if ! equal {(substr "{>$FirstLine}" 0 1)} {(substr "{=$FirstLine}" 0 1)}:)
< do something when the first letter changes >
(:ifend:)

substr doesn't seem to work inside a (:template ... :) directive.

Hope this helps.

>
> See http://www.pmwiki.org/wiki/Test/PageListGrouping for an attempt
>
> thanks
>
> Simon
> _______________________________________________
> pmwiki-users mailing list
> pmwiki-users at pmichaud.com
> http://www.pmichaud.com/mailman/listinfo/pmwiki-users
>


-- 
John Rankin




More information about the pmwiki-users mailing list