Tags:
create new tag
view all tags

SID-01798: Hiding Topic Content

Status: Answered Answered TWiki version: Perl version:
Category: CategoryRendering Server OS: Last update: 12 years ago

Hiding some topic content (such as setting preference variables), while still having the content be executed during rendering, would improve end-user readability.

For example, the following content:

  • Set WizardOfOz = Pay no attention to that man behind the curtain!

Is there a way to hide contiguous content in the middle of a topic? (Perhaps: You!? <hide> You are a very bad man! </hide> No my dear, I'm a very good man. I'm just a very bad wizard.

-- Patrick Townsend-Wells - 2013-09-11

Discussion and Answer

You can use HTML comments: <!-- this is hidden; works over multiple lines too -->

You can also use the HIDE variable, see VarHIDE.

-- Peter Thoeny - 2013-09-11

However, HTML comments do not seem to be executed when rendering a topic.

The pointed issue is that "SetGetPlugin" variables do not seem to work inside an IF statement condition. However the following does work: setting a local variable in a topic to a "SetGetPlugin" variable and then using that local variable in an IF condition.

  • Set Previous.Topic.Local = %GET{"Previous.Topic"}%
%IF{"$ Previous.Topic.Local='Topic.Display.Name'" then=" . . . "}%

But that leaves the local variable setting line out swaying in the breeze. Perhaps the way to go is to put in a white text style.

Other questions: Why is the "$" necessary in an IF condition? Is there a way to get "SetGetPlugin" variables to work directly in an IF condition?

-- Patrick Townsend-Wells - 2013-09-11

Oh...I see your HIDE variable line. I'll try that.

BTW, "Topic.Display.Name" in the above should be "Previous.Topic.Display.Name" The whole point of this little exercise is to be able to control the content displayed in a web's topics by the display name of the topic that the user was previously in.

-- Patrick Townsend-Wells - 2013-09-11

Oops...my bad. I incorrectly interpreted the results of the HTML comment line result.

BOTH the HTML comments and the HIDE variable do two things: Hide the text and cause code (at least the stuff I'm using) to be executed.

Good job!

-- Patrick Townsend-Wells - 2013-09-11

Oh no...ran a simple, conclusive test.

BOTH the HTML comments and the HIDE variable do hide the text, but code inside them does NOT get executed.

However, "SetGetPlugin" variables can be directly used in IF conditions:

%IF{"'%GET{"Set.Get.Plugin.Variable"}%'='Go.Ahead.Value'" then="..."}%

-- Patrick Townsend-Wells - 2013-09-11

      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 Hiding Topic Content
SupportCategory CategoryRendering
TWiki version

Server OS

Web server

Perl version

Browser & version

Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r3 - 2013-09-11 - PatrickTownsendWells
 
  • 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.