Question
In a web we have groups of topics that have their own project theme. They don't merit a separate web but we would like to be able to have a different leftbar for each group.
So if a parent topic has many child topics we would like the child topics to inherit the parent's leftbar.
Using INCLUDE and/or IF/ELSE how can I do the following?
If parentsleftbar exists include it
else include defaultleftbar
Environment
--
PeterJones - 04 Oct 2007
Answer
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.
I'm making some progress by am having trouble resolving variables
I get the parent of the topic using this search.
* Set MYDADDY = %SEARCH{ "^%BASETOPIC%$" scope="topic" nosearch="on" type="regex" nototal="on" format="$percntCALC{$IF($EXACT($parent,), %HOMETOPIC%, $parent)}$percnt" }%
I then set a variable for the parents left bar topic
* Set DADDYLEFTBAR = %MYDADDY%LeftBar
The problem is then including this topic as the following does not work
%INCLUDE{"%DADDYLEFTBAR%" warn="off"}%
Even the Im only 1/2 way there as I really need something like
%INCLUDE{"%DADDYLEFTBAR%" warn="%INCLUDE{"%PROJECTLEFTBAR%" warn="LeftMenuBar"}%"}%
Any ideas?
--
PeterJones - 30 Oct 2007
Suppose you have a default WebLeftBar and a MyTopicWebLeftBar. This search will find the parent of the current topic, and writes it inside an INCLUDE. The 'WebLeftBar' is appended - if nothing is found only 'WebLeftBar' is included:
%INCLUDE{"%SEARCH{ "^%BASETOPIC%$" scope="topic" nosearch="on" type="regex" nonoise="on" format="$parent" }%WebLeftBar"}%
--
ArthurClemens - 30 Oct 2007
Thanks Arthur, this is what I was looking for.
In our case the SEARCH command goes into WebLeftBar, so I had to modify it to avoid rec curing inserts of WebLeftBar itself.
So I have a parent topic TheParent that has a corresponding left bar TheParentLeftBar. All children topics of TheParent inherit the left bar with
%INCLUDE{"%SEARCH{ "^%BASETOPIC%$" scope="topic" nosearch="on" type="regex" nonoise="on" format="$parent" }%LeftBar"}%
--
PeterJones - 04 Nov 2007