Tags:
create new tag
view all tags

SID-00430: Expand Search Results On Template Copy

Status: Answered Answered TWiki version: 4.2.4 Perl version:
Category: CategoryTemplates Server OS: Last update: 16 years ago

I want to templatize a page that creates a table from current search results.

e.g. my template topic contains somethnig like this

%TABLE{ caption="<b>Development Process</b>" initsort="1" initdirection="up" }%
| *Name* | *Complies (Y/N/n/a)*| *Comments* |
%SEARCH{ "META:FIELD.*?Type.*?Development Process" topic="Standards*" type="regex" 
   format="|$topic| | |" }%

which will produce a list (table) of all current Standards topics that match the "Development Process" type.

When I make a new instance topic from the template, I don't want to copy the (dynamic) SEARCH; I want to copy the current results. I want the resulting page to contain a static table of links with columns for adding compliance info and comments.

I had hoped that type=expandvariables would do the trick but it ignored the SEARCH line completely.

Is there any hope?

-- VickiBrown - 2009-07-21

Discussion and Answer

In the template topic, did you try to enclose the whole table including search in:

%STARTSECTION{ type="expandvariables" }%
...
%ENDSECTION{ type="expandvariables" }%

See details in "control over variable expansion", TWikiTemplates

-- PeterThoeny - 2009-07-25

Yes, that's what I meant by "I had hoped that type=expandvariables would do the trick".

However, after your comment, I experimented further and a simple SEARCH, e.g.

%STARTSECTION{ type="expandvariables" }%
%SEARCH{"Vbrown" casesensitive="on" scope="topic" format="   *  [[$topic]]"}%
%ENDSECTION{ type="expandvariables" }%
works.

So there seems to be something about the SEARCH code in my actual template that is preventing type=expandvariables; from working. It's complex SEARCH code, full of pattern=... sections. I will need to investigate further. (I also have plans to simplify the search dramatically; it's not my code. smile

-- VickiBrown - 2009-07-27

-- VickiBrown - 2009-07-27

      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 Expand Search Results On Template Copy
SupportCategory CategoryTemplates
TWiki version 4.2.4
Server OS

Web server

Perl version

Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r3 - 2009-07-27 - VickiBrown
 
  • 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.