<<O>> Difference Topic FormattedSearch (r1.3 - 02 Dec 2001 - MikeMannix?) |
<<O>> Difference Topic FormattedSearch (r1.2 - 29 Nov 2001 - PeterThoeny?) |
Line: 1 17 to 1 17 | ||||||||
---|---|---|---|---|---|---|---|---|
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. I.e. header="| *Topic:* | *Summary:* |"
| |||||||
Line: 21 to 21 | ||||||||
Changed: | ||||||||
< < |
Use the format paramter to specify the format of one search hit. I.e. format="| $topic | $summary |"
| |||||||
> > |
Use the format paramter to specify the format of one search hit. I.e. format="| $topic | $summary |"
| |||||||
Line: 25 to 26 | ||||||||
Added: | ||||||||
> > |
| |||||||
Line: 29 to 30 | ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
Line: 31 to 34 | ||||||||
Added: | ||||||||
> > |
| |||||||
Line: 33 to 36 | ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
Line: 55 to 58 | ||||||||
Changed: | ||||||||
< < |
%SEARCH{ "[T]opicClassification.*?value=\"[P]ublicFAQ\"" scope="text" regex="on" nosearch="on" nototal="on" format="| [[$topic]] | $formfield(OperatingSystem?) | $formfield(OsVersion?) |" }%
| |||||||
> > |
%SEARCH{ "[T]opicClassification.*?value=\"[P]ublicFAQ\"" scope="text" regex="on" nosearch="on" nototal="on" format="| [[$topic]] | $formfield(OperatingSystem) | $formfield(OsVersion) |" }%
| |||||||
Line: 82 to 85 | ||||||||
Changed: | ||||||||
< < |
-- PeterThoeny? - 24 Oct 2001 | |||||||
> > |
-- PeterThoeny? - 28 Nov 2001 |
<<O>> Difference Topic FormattedSearch (r1.1 - 25 Oct 2001 - PeterThoeny?) |
Line: 1 to 1 | |||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Added: | |||||||||||||||||||||||||||||||||
> > |
%SEARCH{... format="..."}% Variable
PrefaceBy default, the format for displaying a search result is fixed, e.g. a table with rows of topic name and topic summary. Use theformat="..." 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 (i.e. %SEARCH{ "food" format="| $topic | $summary |" }% ).
SyntaxTwo paramters can be used to specify a customized search result: 1.header="..." parameter
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:* |"
2. format="..." parameter
Use the format paramter to specify the format of one search hit. I.e. format="| $topic | $summary |"
Variables that can be used in the format string:
$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.
ExamplesBullet list showing topic name and summaryWrite this:%SEARCH{ "FAQ" scope="topic" nosearch="on" nototal="on" header=" * *Topic: Summary:*" format=" * [[$topic]]: $summary" }%
To get this:
Table showing form field values of topics with a formWrite this in the Know web:| *Topic:* | *OperatingSystem:* | *OsVersion:* | %SEARCH{ "[T]opicClassification.*?value=\"[P]ublicFAQ\"" scope="text" regex="on" nosearch="on" nototal="on" format="| [[$topic]] | $formfield(OperatingSystem?) | $formfield(OsVersion?) |" }%
To get this:
Extract some text from a topic using regular expressionWrite this:%SEARCH{ "__Back to\:__ TWikiFAQ" scope="text" regex="on" nosearch="on" nototal="on" header="TWiki FAQs:" format=" * $pattern(.*?FAQ\:[\n\r]*([^\n\r]+).*) [[$topic][Answer...]]" }%
To get this:
TWiki FAQs:
|
Topic FormattedSearch . { View | Diffs | r1.3 | > | r1.2 | > | r1.1 | More } output as: { } |
Revision r1.1 - 25 Oct 2001 - 02:13 - PeterThoeny? Revision r1.3 - 02 Dec 2001 - 12:33 - MikeMannix? |