[pmwiki-users] Grouping in pagelists

Petko Yotov 5ko at 5ko.fr
Thu Oct 23 09:34:35 CDT 2014


You can define in config.php a PageVariable containing the first 4 
characters of the name:

   $FmtPV['$Name4'] = 'substr($name, 0, 4)';

then use that variable in the pagelist template:

   (:template first {=$Name4}:)

I've enabled it on the Test page you created.

Petko

On 23.10.2014 09:49, Simon wrote:
> 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?
> 
> See http://www.pmwiki.org/wiki/Test/PageListGrouping or an
> attempt



More information about the pmwiki-users mailing list