SID-01637: Display icon based on a condition
| Status: |
Answered |
TWiki version: |
|
Perl version: |
|
| Category: |
|
Server OS: |
|
Last update: |
13 years ago |
I tried using the following statement inside a cell of a table
%IF{"istopic 'Sandbox.TestTopic'" then="%Y%" else="%X%"}%
All I am getting is something like "<img src=" in the cell, irrespective of whether the topic exists or not. Please help me with this.
--
Karthikeyan Elango - 2013-02-08
Discussion and Answer
This is because variables resolve inside out, e.g.
%Y% expands and contains double quotes, which terminates the IF prematurely. Either use single quotes for IF, or escape the variables, such as
then="$percntY$percnt". Details in
IfStatements and
VarIF.
--
Peter Thoeny - 2013-02-08
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.