SID-00298: Embeded searches (passing variables)
| Status: |
Answered |
TWiki version: |
4.2.4 |
Perl version: |
5.8.5 |
| Category: |
CategorySearch |
Server OS: |
RedHat EL4 |
Last update: |
16 years ago |
I'm trying to make a project tracker, and the frontend uses an embeded search.
This search looks for all topics in the current web that use the "SystemsProjectForm" and have their "Status" set to "COMPLETED". For each topic it finds it is supposed to print out all of the bullet points found in that topic.
What I'm finding is that topic="$topic" does not seem to work, but if I change $topic to the specific name of one of the topics it works fine. Should this work? or should I be escaping something out to make sure $topic evaluates the correct Topic name.
Thanks!
--
TomCorrigan - 2009-05-07
Discussion and Answer
The
topic="" parameter in
VarSEARCH is only used to narrow down the search scope, such as
topic="Project*" to all topics that start with "Project".
You can use a
RegularExpression $pattern() within the
format="" parameter to pull out just the bullets. More at
FormattedSearch.
--
PeterThoeny - 2009-05-07
Solution discussed at
TWikiIRC:2009-05-07&sel=42#l38
:
- Use a
format="" with this pattern: $pattern(.*?COMMENT\{type=\"below\".*?((\n \* ?[^\n]*){1,5}).*)
- Specify
newline="%BB%" parameter to convert newlines into breaking bullet (line break and bullet) so that the search result can be placed into a TWiki table cell without breaking the table.
--
PeterThoeny - 2009-05-08
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.