|
META TOPICPARENT |
name="TWikiVariables" |
|
|
Inline search feature allows flexible formatting of search result |
|
< < | 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 |" }% ). |
> > | 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 |
|
$topic(20) |
Topic name, "- " hyphenated each 20 characters |
$topic(30, -<br />) |
Topic name, hyphenated each 30 characters with separator "-<br />" |
$topic(40, ...) |
Topic name, shortended to 40 characters with "..." indication |
|
|
> > |
$parent |
Name of parent topic; empty if not set |
$parent(20) |
Name of parent topic, same hyphenation/shortening like $topic() |
|
|
$text |
Formatted topic text. In case of a multiple="on" search, it is the line found for each search hit. |
$locked |
LOCKED flag (if any) |
$date |
Time stamp of last topic update, e.g. 19 Apr 2025 - 13:48 |
|
|
$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. The pattern must cover the whole text (topic or line). For 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. |
|
> > |
$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 |
|
|
$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 (% ) |
$dollar |
Dollar sign ($ ) |
|
|
< < | Note: For $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. |
|
Examples |
|
Table showing form field values of topics with a form |
|
< < | Write this in the Know web: |
> > | In a web where there is a form that contains a TopicClassification field, an OperatingSystem field and an OsVersion field we could write: |
|
| *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: |
> > | To get this: |
|
|
| OperatingSystem: |
OsVersion: |
|
|
|
< < | |
> > | |
| |
|
|
< < | |
> > | |
| |
|
- ATasteOfTWiki is referenced by:
- FormattedSearch is referenced by:
- AnApplicationWithWikiForm, BackupRestorePlugin, EditTablePlugin, EmptyPlugin, FormatTokens, HeadlinesPlugin, IfStatements, InterwikiPlugin, LatexModePlugin, ManagingWebs, PreferencesPlugin, QuerySearch, RegularExpression, RenderListPlugin, SearchHelp, SearchPatternCookbook, SearchResultsPagination, SetGetPlugin, SlideShowPlugin, SmiliesPlugin, SpreadSheetPlugin, TWikiAccessControl, TWikiDocumentation, TWikiForms, TWikiHistory, TWikiMetaData, TWikiNetSkinPlugin, TWikiReferenceManual, TWikiReleaseNotes04x00, TWikiReleaseNotes04x01, TWikiScripts, TWikiSearchDotPm, TWikiSiteTools, TWikiTip018, TWikiTopics, TWikiUISearchDotPm, TWikiVariablesQuickStart, TagMePlugin, TwistyPlugin, VarCHILDREN, VarEDITFORMFIELD, VarFORMFIELD, VarMETA, VarMETASEARCH, VarSEARCH, VarURLPARAM, WatchlistPlugin, WebHome, WebLeftBar, WebTopMenu, WelcomeGuest
- TWikiAccessControl is referenced by:
- AllowWebCreateByUserMappingManager, AutonomousWebs, CopyingTopics, CustomUserGroupNotations, EditTablePlugin, FileAttachment, MainFeatures, ManagingTopics, ManagingUsers, ManagingWebs, PatternSkinCustomization, SitePermissions, SourceCode, TWikiAccessControl, TWikiDocumentation, TWikiForms, TWikiFuncDotPm, TWikiHistory, TWikiInstallationGuide, TWikiPreferences, TWikiReferenceManual, TWikiReleaseNotes04x01, TWikiReleaseNotes04x02, TWikiReleaseNotes06x00, TWikiScripts, TWikiSiteTools, TWikiTopics, TWikiTutorial, TWikiUserAuthentication, TWikiVariables, TagMePlugin, UserMasquerading, VarHIDE, VarSEARCH, WebPreferences, WebPreferencesHelp, WikiCulture, WikiWord
- TWikiSite is referenced by:
- AdminToolsCategory, InstantEnhancements, InterwikiPlugin, ManagingWebs, SiteMap, SiteStatisticsFooter, StartingPoints, TWikiAccessControl, TWikiDocumentation, TWikiGlossary, TWikiI18NDotPm, TWikiInstallationGuide, TWikiPreferences, TWikiReferenceManual, TWikiRegistration, TWikiReleaseNotes04x02, TWikiReleaseNotes05x00, TWikiReleaseNotes05x01, TWikiReleaseNotes06x00, TWikiScripts, TWikiSite, TWikiTopics, TWikiTutorial, TWikiUserAuthentication, TWikiUsersGuide, WabiSabi, WebHome, WebLeftBar, WebSiteTools, WebStatisticsFooter, WebTopMenu, WelcomeGuest, WhatDoesTWikiStandFor, WhatIsWikiWiki, WikiCulture, WikiReferences
- WabiSabi is referenced by:
- WhatIsWikiWiki is referenced by:
- WikiCulture is referenced by:
- WikiReferences is referenced by:
|
|
> > | Note: Nested search can be slow, especially if you nest more then 3 times. Nesting is limited to 16 levels. For each new nesting level you need to "escape the escapes", e.g. write $dollarpercntSEARCH{ for level three, $dollardollarpercntSEARCH{ for level four, etc. |
| Most recently changed pages
Write this: |
| Result: |
|
< < | -- TWiki:Main.PeterThoeny - 16 Mar 2004 |
> > | -- TWiki:Main.PeterThoeny - 26 Jul 2004 |
| |