Question
Hello,
I've defined a nested search which allows me to find two topic levels, starting from a parent one.
From this I've two problems, and I don't know if what I intend is possible.
First, I'd like to put the search request in a variable. That does not cause any issues.
But I'd like the first element of the search to be a parameter, a variable.
To explain it simply, I'd like to define the search string in a variable in the
WebPreferences for example, and then be able to use this search but providing a custom root e.g. changing the variable containing the root topic name.
The problem is that the search string is analysed during the first affectation, and so is the root topic variable. So I can't change it.
I tryed to put a in the search string, but then, it is never analysed.
So Is there a way to do that ?
Here is my search string and my root topic variable :
(I added escape char for the surrounding '%' before posting it !)
(By the way, this search works fine if used without wanting to change the WEBROOTTOPIC)
#Set WEBROOTTOPIC =
RootTopic
#Set WEBTREEVIEW = \%SEARCH{ "\%META:TOPICPARENT\{name="\%WEBROOTTOPIC\%"\}\%" type="regex" format="$n *
$topic $n$percntSEARCH{\"\$percntMETA:TOPICPARENT\{name=\$quot$topic\$quot\}\$percnt\" type=\"regex\" format=\" * $dollartopic\" nosearch=\"on\" nototal=\"on\" }$nop%" nosearch="on" nototal="on" }\%
Many thanks
Environment
--
TWikiGuest - 17 Apr 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.
simplified example in action?
* Set WEBROOTTOPIC = WebHome
* Set WEBTREEVIEWNONVARIABLE = %SEARCH{ "META:TOPICPARENT{name=\"WebHome\"}%" type="regex" topic="HowToPutAParametrizedSearchInVar"}%
* Set WEBTREEVIEW = %SEARCH{ "META:TOPICPARENT{name=\"%WEBROOTTOPIC%\"}%" type="regex" topic="HowToPutAParametrizedSearchInVar"}%
WEBTREEVIEWNONVARIABLE
%WEBTREEVIEWNONVARIABLE%
WEBTREEVIEW
%WEBTREEVIEW%
other options
you may want to consider using a parameterise INCLUDE instead - at least until someone works out how to make this work
for an example, see the
BugsContrib - and the way we call the Tabulator topic
--
SvenDowideit - 24 Apr 2007
Closing this after more than 30 days inactivity; re-open if needed...
--
PeterThoeny - 02 Jun 2007