[pmwiki-users] Conditional markup with multi-line page variables

Andrew Thompson aatbass at googlemail.com
Mon Jun 30 12:39:26 CDT 2008


Subject: Conditional markup with multi-line page variables
Perhaps I'm doing something stupid, but I've tried lots of variations,
so this is possibly a bug.

My aim is to display the contents of a variable, with appropriate
headings, only when the variable is set. If the variable has a
single-line value, everything works perfectly, eg:

CODE:
(:ShopList: Nuts:)

(:if !equal {$:ShopList} "":)
!!!!Shopping List:
*{$:ShopList}
(:ifend:)

OUTPUT:
Shoppling List:
  * Nuts

That works exactly as it should, but, if ShopList has a multi-line
value, I still get the correct output for my shopping list, but it is
preceded on the screen by the if statement, with ShopList expanded,
eg:

CODE:
(:ShopList: Nuts
*Bananas
*Apples
*Oranges:)

(:if !equal {$:ShopList} "":)
!!!!Shopping List:
*{$:ShopList}
(:ifend:)

OUTPUT:

(:if !equal Nuts
  * Apples
  * Oranges "":)

Shoppling List:
  * Nuts
  * Apples
  * Oranges

I've tried every workaround I can think of, to no avail, so any
suggestions would be much appreciated.

Thanks.



More information about the pmwiki-users mailing list