[pmwiki-users] Pagelist conditional: One of two PTV not empty?

Patrick R. Michaud pmichaud at pobox.com
Sun Feb 28 12:47:13 CST 2016


On Sun, Feb 28, 2016 at 12:35:32PM -0600, Chuck G wrote:
> Petko Yotov <5ko at 5ko.fr> Wrote in message:
> > On 2016-02-27 12:55, Oliver Betz wrote:
> >> how can I get a pagelist where at least one of the PTV "foo" or "bar"
> >> are not empty?
> > 
> > If the PTV are short one-line strings, you can probably use a 
> > conditional in the pagelist template:
> > 
> > (:template each:)
> > (:if expr ! equal "{=$:PTV1}" "" && ! equal "{=$:PTV2}" "" :)
> > * {=$Fullname} has either PTV1 or PTV2 not empty.
> > (:ifend:)
> 
> I think you need OR (||), not AND (&&).

Or even avoid the junction altogether:

    (:if ! equal "{=$:PTV1}{=$:PTV2}" "" :)
    * {=$Fullname} has either PTV1 or PTV2 not empty.
    (:ifend:)

Pm



More information about the pmwiki-users mailing list