[pmwiki-users] Using Page Text Variables in a pagelist

Simon nzskiwi at gmail.com
Sun Jul 17 05:06:42 CDT 2016


Thank you.
Indeed the page text variable calculation which includes a markup
expression does not embed in the pagelist.

Appreciate your very quick reply.

Now fixed, [1 <http://ttc.org.nz/pmwiki/pmwiki.php/Webteam/2012March>].

____
http://kiwiwiki.nz

On 17 July 2016 at 20:39, Petko Yotov <5ko at 5ko.fr> wrote:

> A misunderstanding about PageTextVariables comes up often.
>
> The reality is that the value is always the text that is written in the
> page. It is only evaluated when the variable is printed/output to HTML. So
> when you want to sort by that variable, all values in all pages are the
> not-yet-evaluated text strings, and the order function does what it can
> with them. It does not process/evaluate the text at this point.
>
> With your page names, it will be simpler to use a PageVariable, not a
> PageTextVariable:
>
>   $FmtPV['$NameToYearMonth'] = 'strftime("%Y%m", strtotime($name))';
>
> Then use (:pagelist order=$NameToYearMonth:)
>
>
> If this is not possible, writing in the wiki page:
>   (:MonthNum:07:)
>
> might be easier for some than:
>   (:MonthNum:{(ftime fmt=%m when="{$Namespaced}")}:)
>
> and this would work for ordering.
>
> Petko
>
> ---
> Change log     :  http://www.pmwiki.org/wiki/PmWiki/ChangeLog
> Release notes  :  http://www.pmwiki.org/wiki/PmWiki/ReleaseNotes
> If you upgrade :  http://www.pmwiki.org/wiki/PmWiki/Upgrades
>
>
> On 2016-07-17 09:31, Simon wrote:
>
>> In a page[1 <http://ttc.org.nz/pmwiki/pmwiki.php/FixtureCard/2016April>]
>> I
>> declare the page text variables
>>
>> (:Year:{(substr {$Name} 0 4)}:)
>> (:MonthNum:{(ftime fmt=%m when="{$Namespaced}")}:)
>>
>> Note the page name is in the format yyyymonth. e.g "2016 April"
>>
>>
>> I create a pagelist[2
>> <http://ttc.org.nz/pmwiki/pmwiki.php/FixtureCard/GroupHeader>][3
>> <http://ttc.org.nz/pmwiki/pmwiki.php/Site/LocalTemplates>] with an order
>> based on the page text variables
>> (:pagelist group=FixtureCard name=2*,-*Half*,-*ClubNight* fmt=#grouptrail
>> order=$:Year,$:MonthNum :)
>>
>> I'm not getting the order I expect from the pagelist.
>>
>> If anyone can suggest where I could look to get this to work I'd
>> appreciate
>> it
>>
>
> _______________________________________________
> pmwiki-users mailing list
> pmwiki-users at pmichaud.com
> http://www.pmichaud.com/mailman/listinfo/pmwiki-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.pmichaud.com/pipermail/pmwiki-users/attachments/20160717/458f0976/attachment.html>


More information about the pmwiki-users mailing list