Line: 1 to 1 | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
On this page:
| |||||||||||||||||||||
Line: 6 to 6 | |||||||||||||||||||||
Inline search feature allows flexible formatting of search result | |||||||||||||||||||||
Deleted: | |||||||||||||||||||||
< < | Overview | ||||||||||||||||||||
The %SEARCH{...}% variable documented in TWikiVariables has a fixed format for the search result, that is, a table consisting of topic names and topic summaries. Use the format="..." parameter to specify a customized format of the search result. The string of the format parameter is typically a bullet list or table row containing variables (such as %SEARCH{ "food" format="| $topic | $summary |" }% ).
Syntax | |||||||||||||||||||||
Changed: | |||||||||||||||||||||
< < | Two paramters can be used to specify a customized search result: | ||||||||||||||||||||
> > | Two parameters can be used to specify a customized search result: | ||||||||||||||||||||
1. header="..." parameter | |||||||||||||||||||||
Changed: | |||||||||||||||||||||
< < | Use the header paramter to specify the header of a search result. It should correspond to the format of the format parameter. This parameter is optional. I.e. header="| *Topic:* | *Summary:* |" | ||||||||||||||||||||
> > | Use the header paramter to specify the header of a search result. It should correspond to the format of the format parameter. This parameter is optional. Example: header="| *Topic:* | *Summary:* |" | ||||||||||||||||||||
2. format="..." parameter | |||||||||||||||||||||
Changed: | |||||||||||||||||||||
< < | Use the format paramter to specify the format of one search hit. I.e. format="| $topic | $summary |" | ||||||||||||||||||||
> > | Use the format parameter to specify the format of one search hit.
Example: format="| $topic | $summary |" | ||||||||||||||||||||
Variables that can be used in the format string:
| |||||||||||||||||||||
Deleted: | |||||||||||||||||||||
< < |
| ||||||||||||||||||||
| |||||||||||||||||||||
Added: | |||||||||||||||||||||
> > |
| ||||||||||||||||||||
| |||||||||||||||||||||
Changed: | |||||||||||||||||||||
< < |
| ||||||||||||||||||||
> > |
| ||||||||||||||||||||
| |||||||||||||||||||||
Changed: | |||||||||||||||||||||
< < |
| ||||||||||||||||||||
> > |
$pattern(reg-exp) , specify a RegularExpression that scans from start to end and contains the text you want to keep in parenthesis, like $pattern(.*?(from here.*?to here).*) . You need to make sure that the integrity of a web page is not compromised; for example, if you include a table make sure to include everything including the table end tag.
Nested SearchSearch can be nested. For example, search for some topics, then form a new search for each topic found in the first search. The idea is to build the nested search string using a formatted search in the first search. Here is an example. We want to search for topics, do a nested search with each hit, and show the result as nested bullets. Parameters likescope="text" regex="on" nosearch="on" nototal="on" are omitted for simplicity.
| ||||||||||||||||||||
Deleted: | |||||||||||||||||||||
< < | Note: For $pattern(reg-exp) , specify a RegularExpression that scans from start to end and contains the text you want to keep in parenthesis, i.e. $pattern(.*?(from here.*?to here).*) . You need to make sure that the integrity of a web page is not compromised, i.e. if you include a table make sure to include everything including the table end tag. | ||||||||||||||||||||
Examples | |||||||||||||||||||||
Added: | |||||||||||||||||||||
> > | |||||||||||||||||||||
Bullet list showing topic name and summaryWrite this: | |||||||||||||||||||||
Line: 85 to 116 | |||||||||||||||||||||
Could not perform search. Error was: /bin/grep -E -i -l -H -- %TOKEN|U% %FILES|F% Grep for '__Back to\:__ TWikiFAQ' returned error | |||||||||||||||||||||
Changed: | |||||||||||||||||||||
< < | -- PeterThoeny - 28 Nov 2001 | ||||||||||||||||||||
> > | -- PeterThoeny - 16 May 2002 |