Tags:
create new tag
view all tags

SID-00298: Embeded searches (passing variables)

Status: Answered 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

      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 Embeded searches (passing variables)
SupportCategory CategorySearch
TWiki version 4.2.4
Server OS RedHat EL4
Web server Apache 2
Perl version 5.8.5
Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r3 - 2009-05-08 - PeterThoeny
 
  • 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.