[pmwiki-users] if action = whatever ... doesn't work?

Pico pmwiki at ben-amotz.com
Sun Aug 13 08:32:07 CDT 2006


Tegan Dowling wrote:
> I can't figure out whether the conditional (:if action browse:) and (:if 
> ! action edit:) are failing to work properly, or if (more likely) I'm 
> failing to understand and use the markup correctly.
> 
> Look at:
> http://www.pmwiki.org/wiki/Test7/HomePage
> 
> On the SideBar page for the wikigroup Test7 (I just used one that was 
> out there), I've put
> 
> |(:if ! action edit:)test1(:ifend:)
> and also
> ||(:if action browse:)test2(:ifend:)|
> 
> 
> I would expect both "test1" and "test2" to appear on the sidebar when 
> the page I'm viewing (whether that's Test7/HomePage or Test7/SideBar) is 
> in browse mode, but not when I have it in edit mode.
> 
> In fact, they both appear regardless of the page-action in effect.
> 
> Why is that?  Thanks!
> 

Use the action page variable and an equal condition, like this:

(:if equal {$Action} "browse":}
(:if !equal {$Action} "browse":}
(:if equal {$Action} "edit":}
(:if !equal {$Action} "edit":}

I do not believe that there is a separate action conditional.

Pico




More information about the pmwiki-users mailing list