Tags:
create new tag
view all tags

SID-01995: Expanding a variable to match SEARCH

Status: Answered Answered TWiki version: 6.0.1 Perl version: 5.8
Category: CategorySearch Server OS: RedHat Linux 7 Last update: 10 years ago

We have pages with line like

Resp:%REVINFO{"$ wikiusername" rev="1.1"}%

The variable could have different rev values.

From a form I want to give a WIKINAME and search for all pages that match the above line. This is order to find the respo for each page.

%SEARCH{
 "Resp:.* %URLPARAM{ "qname" default="%WIKINAME%" }%" 
 type="regex" 
 scope="text"
 web="%URLPARAM{ "qweb" default="%WEB%" }%"
 header="   * *Topic: Summary:*" 
 format="   * [[$topic]]: $wikiusername" 
}%

It appears that the variable is not expanded for the search.

Any ideas how to solve this?

-- Peter Jones - 2014-11-26

Discussion and Answer

Indeed, SEARCH looks at the raw page content, e.g. you can't search for the result of a TWiki variable.

It looks like you want to search for the creator of topics. For new topics you could add that info into a hidden TWiki Form Field of type label. For existing topics I do not see an immediate solution. You'd possibly need to patch existing topics to add the creator as a hidden form field?

-- Peter Thoeny - 2014-11-26

Hi Peter Thanks for the reply. It seems I will have to re-think. The requirement I have is that each page has a person 'responsible' and it could be the creator or some other editor. This information is to be located somewhere on the page and the web administrators can then use the data to sort topics by 'responsible'. This is for gardening purposes. It looks like a form would work but I would need to edit all existing topics.

-- Peter Jones - 2014-11-26

A TWiki form is the best to keep track of meta data like this. You could add a form programmatically, either with a quick & dirty script, or by using the GlobalReplacePlugin.

-- Peter Thoeny - 2014-11-28

Closing this question after more than 30 days of inactivity. Feel free to reopen if needed. Consider engaging one of the TWiki consultants if you need timely help. We invite you to get involved with the community, it is more likely you get community support if you support the open source project!

-- Peter Thoeny - 2015-12-03

      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 Expanding a variable to match SEARCH
SupportCategory CategorySearch
TWiki version 6.0.1
Server OS RedHat Linux 7
Web server apache
Perl version 5.8
Browser & version FF
Edit | Attach | Watch | Print version | History: r6 < r5 < r4 < r3 < r2 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r6 - 2015-12-03 - 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.