[pmwiki-users] Nested IFs / setting variables with directives

Patrick R. Michaud pmichaud at pobox.com
Sat Sep 30 09:52:15 CDT 2006


On Sat, Sep 30, 2006 at 09:41:11AM -0400, Pico wrote:
> Mike wrote:
> > I want to define a multilanguage backlink in my footer pages. However, 
> > this backlink shouldn't show up on Index (start) pages. So I need 
> > something like (pseudo code, sorry)
> > 
> > if page!=index
> >     if userlang = en
> >        "back to main"
> >     if userlang = de
> >        "zurück"
> > end if
> > 
> Note that PmWiki allows you to combine conditionals.  
> [...]
>
> if page!=index and userlang = en
> "back to main"
> if page!=index and userlang = de
> "zurück"
> end if

It might also be useful to use phrase translations:

    (:if ! name Index:)$[back to main](:if:)

and then programmatically define translations of "back to main".
This could be done through additional XLPages or programmatically
from a local customization.

Pm




More information about the pmwiki-users mailing list