Tags:
create new tag
view all tags

SID-01637: Display icon based on a condition

Status: Answered 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

      Change status to:
ALERT! 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.
SupportForm
Status Answered
Title Display icon based on a condition
SupportCategory

TWiki version

Server OS

Web server

Perl version

Browser & version

Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r2 - 2013-02-08 - PeterThoeny
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.