SID-01083: Combine IF Clause and META{PARENT}
| Status: |
Answered |
TWiki version: |
4.2.3 |
Perl version: |
|
| Category: |
CategoryRendering |
Server OS: |
|
Last update: |
15 years ago |
Hi, I want to check whether the parent TOPIC equals a special topic. For example: If Parenttopic = "SpecialTopic" Then "Hello World!",
I tried it with the following Syntax without any success:
%IF{' %META{"parent" dontrecurse="on" format="$topic"}%="SpecialTopic" '} then="Hello World!"}%
The following works fine and results in "SpecialTopic":
%META{"parent" dontrecurse="on" format="$topic"}%
Can anybody help?
Thx in advance.
Simon
--
SimonFeil - 2011-01-24
Discussion and Answer
Not tested, but this should work. Make sure to compare a quoted string with a quoted string.
%IF{ "'%META{"parent" dontrecurse="on" format="$topic"}%'='SpecialTopic'" then="Hello World!" }%
--
PeterThoeny - 2011-01-24
Seems to work, thx a lot!
Simon
--
SimonFeil - 2011-02-02
If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.