[pmwiki-users] Conditional Statement and Relative page references

Patrick R. Michaud pmichaud at pobox.com
Mon Nov 5 17:39:02 CST 2007


On Mon, Nov 05, 2007 at 06:16:33PM -0500, DaveG wrote:
> 
> I'm trying to create a conditional statement to determine which page I'm 
> currently on:
>     (:if group Notes and name GardenFence:)HERE WE ARE!(:ifend:)

Try:

   (:if name Notes.GardenFence:)HERE WE ARE!(:ifend:)

This will work even for an included page, as the "name" and 
"group" conditionals always check the currently displayed page, 
as opposed to the page that the markup appears in.

What you gave above would work except that compound conditionals
(i.e., "and"/"or") require brackets or the "expr" prefix:

  (:if expr group Notes and name GardenFence:)HERE WE ARE!(:ifend:)
  (:if [ group Notes and name GardenFence ] :)HERE WE ARE!(:ifend:)

But the single (:if name Notes.GardenFence:) is simpler.  :-)

Pm



More information about the pmwiki-users mailing list