SID-01953: How to combine SEARCH and INCLUDE
| Status: |
Answered |
TWiki version: |
5.1.4 |
Perl version: |
5.6.1 |
| Category: |
CategorySearch |
Server OS: |
SLES 11.3 |
Last update: |
11 years ago |
Hi,
I try to create a topic which includes a list of section in other topics.
The first $topic in format works ell, but $topic in the INCLUDE variable
doesn't.
Any ideas?
Regads,
Daniel
%SEARCH{ "META\:TOPICPARENT.*\"%TOPIC%\"" web="IST" topic="^(SR)*" type="regex" nonoise="on" order="topic" header="|*Server:*|*Wartungsfenster:*|" format="| $topic | %INCLUDE{"$topic" }%"}%
--
Daniel Perabo - 2014-07-28
Discussion and Answer
TWiki evaluates variables inside-out, left-to-right. That is, in your case the INCLUDE is evaluated once before the SEARCH. You need to escape the INCLUDE so that it fires off once per search hit:
format="$percntINCLUDE{$topic}$percnt"
--
Peter Thoeny - 2014-07-28
Look also into much faster:
format="$text"
And into
bookview="on"
Detail in
VarSEARCH and
FormattedSearch.
--
Peter Thoeny - 2014-07-28
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.