Tags:
create new tag
view all tags

SID-01083: Combine IF Clause and META{PARENT}

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

      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 Combine IF Clause and META{PARENT}
SupportCategory CategoryRendering
TWiki version 4.2.3
Server OS

Web server

Perl version

Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r4 - 2011-02-02 - SimonFeil
 
  • 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.