[pmwiki-users] Pagelist : count inner sections (not total) ?

Petko Yotov 5ko at 5ko.fr
Sun Apr 30 09:48:06 PDT 2023


Oh, you couldn't have found the example earlier since I added it just 
now. :-)

Petko

On 30/04/2023 18:43, ABClf wrote:
> I'm gonna try soon ;
> thank you for the example link I haven't found by myself.
> Gilles.
> 
> Le dim. 30 avr. 2023 à 18:05, Petko Yotov <5ko at 5ko.fr> a écrit :
>> 
>> You can probably do something like this:
>> 
>> [[#lasteachcount]]
>> (:template last "{=$:attestation}":)
>> {=$:attestation} ({$$EachCount})
>> [[#lasteachcountend]]
>> 
>> (:pagelist ... fmt=#lasteachcount:)
>> 
>> See an example similar to what you describe near the top of this page:
>> 
>>    https://www.pmwiki.org/wiki/Test/EachCount
>> 
>> Petko
>> 
>> 
>> 
>> On 30/04/2023 17:44, ABClf wrote:
>> > Hello,
>> >
>> > I have set up a pagelist for listing ptv {=$:attestation} (it's a
>> > year), then format the output to be grouped by ptv {=$:attestation} :
>> >
>> > [[#triparan]]
>> > (:template first {=$:attestation}:)
>> >
>> > !!!!{=$:attestation}
>> > (:template each:)
>> > # [[{=$FullName}|+]] @@{=$:attestation}@@ – ''{=$:sens}''
>> > [[#triparanend]]
>> >
>> > pagelist is :
>> > (:pagelist group=Bob link={(substr {*$FullName} 0 -6)} fmt=#triparan
>> > order=$NbSource $:attestation=- order={=$:attestation}:)
>> >
>> > This works ;
>> > i get something like
>> >
>> > 1900
>> > 1. blabla
>> > 2. bloblo
>> >
>> > 1903
>> > 1. blibli
>> > 2. blublu
>> > 3. blybly
>> >
>> > My question is : does something exist which would make possible to
>> > count how many items are collected for every section (in order, not to
>> > show the content, but to count it) ; which, formatted, would give me
>> > something like :
>> >
>> > 1900 (2) 1903 (3)
>> >
>> > I don't know whether {$$EachCount} can do the job and, if yes, how to
>> > use it ?
>> > (https://www.pmwiki.org/wiki/PmWiki/PageListTemplates)
>> >
>> > Thank you,
>> > Gilles.
>> >



More information about the pmwiki-users mailing list