[pmwiki-users] Pagelist question

Hans design5 at softflow.co.uk
Sun May 11 06:52:37 CDT 2008


Sunday, May 11, 2008, 9:37:09 AM, Jan Erik Moström wrote:

> I've got one entry/page and they all have the format 
> YYYYMMDDHHMMSS. My idea was to let pagelist only list the pages 
> that have names that are less or equal that the current date/time.

> I've been looking at the pagelist page but can't see any option 
> that would allow me to do this kind of listing. Then I tried to 
> figure out if I could make a list format that would do this, but 
> looking at ConditionalMarkup I'm unsure on how I should do.

You can define a pagelist format for this.

First install Conditional Extensions to give you numerical comparisons
http://www.pmwiki.org/wiki/Cookbook/ConditionalExtensions

Add a page variable for todays date according to your
general date/time naming convention for the blog page names.
For YYYYMMDDHHMMSS names add this to config.php:

# add page variable for now in format YYYYMMDDHHMMSS
$FmtPV['$Now'] = 'strftime("%Y%m%d%H%M%S", time() )';

Then create a pagelist format in Site.LocalTemplates like this
(modify to what you want it to show, but you see the use of the conditional):

[[#bloglist]]
(:if le {=$Name} {$Now}:)
* [[{=$FullName}|+]]
(:if:)
[[#bloglistend]]

The 'le' conditional comes from ConditionalExtensions and means lesser
or equal.

Use with (:pagelist ......... fmt=bloglist :)


  ~Hans




More information about the pmwiki-users mailing list