SID-00430: Expand Search Results On Template Copy
| Status: |
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.
--
VickiBrown - 2009-07-27
--
VickiBrown - 2009-07-27
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.