[pmwiki-users] Knowing the count of pagelist before display

Martin Fick mogulguy at yahoo.com
Thu Nov 16 10:10:23 CST 2006


--- Pierre Racine <Pierre.Racine at sbf.ulaval.ca> wrote:

> This would need the pages to be sorted by the name
> of the director in order to work. 

Yes, yes, see the order=Director in the pagelist
below.


> Unfortunately, even if I order the pagelist, it
> doesn't work. 

This is either a bug or I have the syntax wrong (bad
documentation?), what version of pmwiki are you
running?  Are you saying that the ordering doesn't
work, or the template is bad (have you tried the
ordering with a simple format?)


> Probably the sorting is done after the template is 
> processed.

No, no that would seem really difficult and strange to
implement, :)


And, I found this in the release notes:

  # The (:pagelist:) command can now filter pages 
  based on the contents of page variables and/or 
  page text variables. For example, the following 
  directive displays only those pages that have an 
  "Xyz" page text variable with "some value":
  
  (:pagelist $:Xyz="some value":)
  

This means that you should be able to pre-filter 
your pagelist like this:

 (:pagelist group=Members $:Director=John
 fmt=#memberperdirector:)

and then make your pagelist easier and more effificent
(no need to filter out other directors in the
template, not need to sort the pagelist),

Also, the ReleaseNotes don't seem to mention anything
about being able to sort based on PageTextVariables,
strange,


-Martin


> > --- Martin Fick <mogulguy at yahoo.com> wrote:
> > > Another way to do it is like this with compound
> ifs
> > > and by sorting by Director which the docs say
> that you can do:
> > >
> > > (:pagelist group=Members order=Director dir=John
> > > fmt=#memberperdirector:)
> > >
> > Sorry, this time I left out the supervises line:
> > 
> >  [[#memberperdirector]]
> >  (:if expr equal {{=$FullName}$:Director} {$$dir}
> &&
> > equal ! {{=$FullName}$:Director}
> > {{<$FullName}$:Director}  :)
> > Supervises:
> >  (:if equal {{=$FullName}$:Director} {$$dir} :)
> >  '''[[{{=$FullName}$:Page} |
> >  {{=$FullName}$:Name}]]'''\\
> >  (:ifend:)
> >  [[#memberperdirectorend]]



 
____________________________________________________________________________________
Do you Yahoo!?
Everyone is raving about the all-new Yahoo! Mail beta.
http://new.mail.yahoo.com




More information about the pmwiki-users mailing list