[pmwiki-users] pmwiki-2.2.0-beta9 release (bugfix, pagevar filters in pagelists)

Roman romat2 at gmail.com
Tue Oct 3 09:12:25 CDT 2006


On 10/3/06, The Editor <editor at fast.st> wrote:
> On 10/3/06, Roman <romat2 at gmail.com> wrote:
> > > Haven't tried it, but it seems you could use the new $$var's that you
> > > pass into the pagelist template, combined with some kind of
> > > conditional in the pagelist to do this.  That is, something like:
> > >
> > >       (:pagelist $:State order=$:State begin=CA end=TX:)
> > >
> > > And then in pagelist template something like:
> > >
> > >       if item between $$begin and $$end, show in list
> > >
> > > Sorry about not showing the template code, but don't know how to do a
> > > condition alphabetically. Maybe someone else could come up with the
> > > actual template.  Hope this helps though.
> >
> > Caveman and Pico,
> > thank you for ideas. I found a solution with the help of
> > ConditionalExtension recipe. I defined this template:
> >
> > [[#test]]
> > (:if ( ge {{=$FullName}$:State} CA ) && ( lt {{=$FullName}$:State} TX ) :)
> > * {{=$FullName}$:State}
> > (:ifend:)
> > [[#testend]]
> >
> > and then used it this way:
> >
> > (:pagelist order=$:State fmt=#test:)
> >
> > Disadvantage of this method is that I have to define pagelist template
> > for each needed range. But it helps me to remove the only barrier of
> > massive utilization of page text variables on my site.
> >
> > Roman
> >
> Have you tried using $$begin and $$end in place of CA and TX?  That
> would allow you to use it for any range.
>
> Cheers,
> Caveman
>

I am not sure if I use it correctly, but

(:pagelist order=$:State fmt=#test begin=CA end=TX:)

does not return any page. In template, I just replaced hardcoded
values with {$$begin} and {$$end}.

[[#test]]
(:if ( ge {{=$FullName}$:State} {$$begin} ) && ( lt
{{=$FullName}$:State} {$$end} ) :)
* {{=$FullName}$:State}
(:ifend:)
[[#testend]]

Roman




More information about the pmwiki-users mailing list