<<O>>  Difference Topic FormattedSearch (r1.52 - 27 Jul 2004 - PeterThoeny)
Changed:
<
<
META TOPICPARENT TWikiSearch
>
>
META TOPICPARENT TWikiVariables

TWIKI DOCS FEEDBACK: Please help in maintaining high quality documentation: fix this topic if you find errors or incomplete content. Post questions, error notes, and suggestions concerning the documentation on this page in the comments section below! To solve problems you are having using this part of TWiki, see the Support web, rather than commenting here. For more on TWiki feature development, see the Codev web. The docs on TWiki.org reflect the latest development release, not the latest beta and production releases.

TOC: No TOC in "TWiki.FormattedSearch"

Line: 8 to 8

Inline search feature allows flexible formatting of search result

Changed:
<
<
The default format of a %SEARCH{...}% as documented in TWikiVariables is a table consisting of topic names and topic summaries. Use the format="..." parameter to customize the search result. The format parameter typically defines a bullet or a table row containing variables, such as %SEARCH{ "food" format="| $topic | $summary |" }%.
>
>
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

Line: 45 to 45

$createusername Login name of topic revision 1.1, e.g. jsmith
$createwikiname Wiki user name of topic revision 1.1, e.g. JohnSmith
$createwikiusername Wiki user name of topic revision 1.1, e.g. Main.JohnSmith
Changed:
<
<
$summary Topic summary, with 162 characters
$summary(50) Topic summary, with 50 characters
$summary(showvarnames) Topic summary, with %ALLTWIKI{...}% variables shown as ALLTWIKI{...}
$summary(noheader) Topic summary, with leading ---+ headers removed
Note: The tokens can be combined into a comma separated list like $summary(100, showvarnames, noheader)
>
>
$summary Topic summary

$formname The name of the form attached to the topic; empty if none
$formfield(name) The field value of a form field; for example, $formfield(TopicClassification) would get expanded to PublicFAQ. This applies only to topics that have a TWikiForm
$formfield(name, 10) Form field value, "- " hyphenated each 10 characters
$formfield(name, 20, -<br />) Form field value, hyphenated each 20 characters with separator "-<br />"
$formfield(name, 30, ...) Form field value, shortended to 30 characters with "..." indication
$pattern(reg-exp) A regular expression pattern to extract some text from a topic (does not search meta data; use $formfield instead). In case of a multiple="on" search, the pattern is applied to the line found in each search hit.
• Specify a RegularExpression that covers the whole text (topic or line), which typically starts with .*, and must end in .*
• Put text you want to keep in parenthesis, like $pattern(.*?(from here.*?to here).*)
• Example: $pattern(.*?\*.*?Email\:\s*([^\n\r]+).*) extracts the email address from a bullet of format * Email: ...
• This example has non-greedy .*? patterns to scan for the first occurance of the Email bullet; use greedy .* patterns to scan for the last occurance
• Limitation: Do not use .*) inside the pattern, e.g. $pattern(.*foo(.*)bar.*) does not work, but $pattern(.*foo(.*?)bar.*) does
• Note: Make sure that the integrity of a web page is not compromised; for example, if you include an HTML table make sure to include everything including the table end tag
Changed:
<
<
$n or $n() New line. Use $n() if followed by alphanumeric character, e.g. write Foo$n()Bar instead of Foo$nBar
>
>
$n or $n() New line

$nop or $nop() Is a "no operation". This variable gets removed; useful for nested search
$quot Double quote ("). Alternatively write \" to escape it
$percnt Percent sign (%)
Line: 353 to 350

-- PeterThoeny - 22 Apr 2004

Deleted:
<
<
If you have to use a plugin and send it attributes, all in a nested search, everything has to be "double-escaped" to get the layout right. I saw confusion regarding this a couple of times, so here's a shot at a syntax you can use in your nested search:

format=\"... $dollarpercntPLUGINTAG{attribute=\\"value\\"}$dollarpercnt ...\"

-- SteffenPoulsen - 06 Apr 2005


META FORM DocsAdminForm  
META FIELD TopicClassification TopicClassification CurrentDocTopic
Revision r1.59 - 06 Apr 2005 - 18:49 - SteffenPoulsen
Revision r1.52 - 27 Jul 2004 - 02:38 - PeterThoeny