|
META TOPICPARENT |
name="TWikiVariables" |
|
| Variables that can be used in the format string:
|
|
< < |
$web |
Name of the web(s), separated by commas, or 'all' |
|
> > |
|
|
$topic |
Topic name |
$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 |
$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, like 19 Apr 2025 - 21:24 |
$isodate |
Time stamp of last topic update, like 2025-04-19T21:24Z |
$rev |
Number of last topic revision, like 1.4 |
$username |
Login name of last topic update, like jsmith |
$wikiname |
Wiki user name of last topic update, like JohnSmith |
|
> > |
$date |
Time stamp of last topic update, e.g. 19 Apr 2025 - 21:24 |
$isodate |
Time stamp of last topic update, e.g. 2025-04-19T21:24Z |
$rev |
Number of last topic revision, e.g. 1.4 |
$username |
Login name of last topic update, e.g. jsmith |
$wikiname |
Wiki user name of last topic update, e.g. JohnSmith |
|
|
$wikiusername |
Wiki user name of last topic update, like Main.JohnSmith |
|
|
> > |
$createdate |
Time stamp of topic revision 1.1 |
$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 |
|
|
|
|
> > |
$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. In case of a multiple="on" search, the pattern is applied to the line found in each search hit. For example, $pattern(.*?\*.*?Email\:\s*([^\n\r]+).*) extracts the email address from a bullet of format * Email: ... . |
|
> > |
$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. |
|
|
$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 |
|
|
- First search:
-
%SEARCH{ "culture" format=" * $topic is referenced by: (list all references)" nosearch="on" nototal="on" }%
- Second search. For each hit we want this search:
|
|
< < |
-
-
%SEARCH{ "(topic found in first search)" format=" $topic" nosearch="on" nototal="on" }%
|
> > |
-
-
%SEARCH{ "(topic found in first search)" format="$topic" nosearch="on" nototal="on" separator=", " }%
|
|
- Now let's nest the two. We need to escape the second search, e.g. the first search will build a valid second search string. Note that we escape the second search so that it does not get evaluated prematurely by the first search:
- Use
$percnt to escape the leading percent of the second search
- Use
\" to escape the double quotes
|
|
Write this: |
|
< < | %SEARCH{ "culture" format=" * $topic is referenced by:$n * $percntSEARCH{ \"$topic\" format=\" $dollartopic\" nosearch=\"on\" nototal=\"on\" }$nop%" nosearch="on" nototal="on" }% |
> > | %SEARCH{ "culture" format=" * $topic is referenced by:$n * $percntSEARCH{ \"$topic\" format=\"$dollartopic\" nosearch=\"on\" nototal=\"on\" separator=\", \" }$nop%" nosearch="on" nototal="on" }% |
|
To get this: |
|
< < | |
> > |
- 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:
|
|
Most recently changed pages |
|
|
|
< < | -- TWiki:Main.PeterThoeny - 15 Dec 2003 |
> > | Embedding search forms to return a formatted result
Use an HTML form and an embedded formatted search on the same topic. You can link them together with an %URLPARAM{"..."}% variable. Example:
Write this:
<form action="%SCRIPTURLPATH%/view%SCRIPTSUFFIX%/%WEB%/%TOPIC%">
Find Topics:
<input type="text" name="q" size="32" value="%URLPARAM{"q"}%" />
<input type="submit" value="Search" />
</form>
Result:
%SEARCH{ search="%URLPARAM{"q"}%" format=" * $web.$topic: %BR% $summary" nosearch="on" }%
To get this:
Result:
-- TWiki:Main.PeterThoeny - 16 Mar 2004 |