TWiki Formatted Search

Inline search feature allows flexible formatting of search result

The default output format of a %SEARCH{...}% 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 |" }%. See %SEARCH{...}% for other search parameters, such as separator="".

Syntax

Three parameters can be used to customize a search result:

1. header="..." parameter

Use the header parameter 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:* |"

Variables that can be used in the header string:

Name: Expands To:
$web Name of the web
$n or $n() New line. Use $n() if followed by alphanumeric character, e.g. write Foo$n()Bar instead of Foo$nBar
$nop or $nop() Is a "no operation". This variable gets removed; useful for nested search
$quot or \" Double quote (")
$aquot Apostrophe quote (')
$percnt Percent sign (%)
$dollar Dollar sign ($)
$lt Less than sign (<)
$gt Greater than sign (>)

2. format="..." parameter

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:

Name:Sorted descending Expands To:
$wikiusername Wiki user name of last topic update, like Users.JohnSmith
$wikiname Wiki user name of last topic update, e.g. JohnSmith
$web Name of the web
$username Login name of last topic update, e.g. jsmith
$topictitle Topic title, in order of sequence defined by: Form field named "Title", topic preference setting named TITLE, topic name
$topic(40, ...) Topic name, shortened to 40 characters with "..." indication
$topic(30, -<br />) Topic name, hyphenated each 30 characters with separator "-<br />"
$topic(20) Topic name, "- " hyphenated each 20 characters
$topic Topic name
$tntopics The total number of topics matched
$text(encode:type) Same as above, but encoded in the specified type. Possible types are the same as in ENCODE. Though ENCODE can take the extra parameter, $text(encode:type) cannot. Example: $text(encode:html)
$text Formatted topic text. In case of a multiple="on" search, it is the line found for each search hit.
$summary(showvarnames) Topic summary, with %ALLTWIKI{...}% variables shown as ALLTWIKI{...}
$summary(noheader) Topic summary, with leading ---+ headers removed
Note: The tokens can be combined, for example $summary(100, showvarnames, noheader)
$summary(expandvar) Topic summary, with %ALLTWIKI{...}% variables expanded
$summary(50) Topic summary, up to 50 characters shown
$summary Topic summary, just the plain text, all TWiki variables, formatting and line breaks removed; up to 162 characters
$rev Number of last topic revision, e.g. 4
$quot or \" Double quote (")
$query(query-syntax, quote:") Strings in QuerySearch result are quoted with the specified quote. Useful to triple-quote strings for use in SpreadSheetPlugin's CALCULATE, such as $query(attachments.comment, quote:''') which returns a list of triple-quoted attachment comment strings -- the spreadhseet funcions will work properly even if comment strings contain commas and parenthesis
$query(query-syntax, encode:type) QuerySearch result is encoded in the specified type. This is in parallel to $formfield(name, encode:type) mentioned above
$query(query-syntax) Access topic meta data using SQL-like QuerySearch syntax. Example:
$query(attachments.arraysize) returns the number of files attached to the current topic
$query(attachments[name~'*.gif'].size) returns an array with size of all .gif attachments, such as 848, 1425, 923
$query(parent.name) is equivalent to $parent
$percnt Percent sign (%)
$pattern(reg-exp, encode:type) A text extracted by reg-exp is encoded in the specified type. This is in parallel to $formfield(name, encode:type) mentioned above
$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 e-mail 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
$parent(20) Name of parent topic, same hyphenation/shortening like $topic()
$parent Name of parent topic; empty if not set
$nwebs The number of webs searched
$ntopics Number of topics found in current web. This is the current topic count, not the total number of topics
$nop or $nop() Is a "no operation". This variable gets removed; useful for nested search
$nhits Number of hits if multiple="on". Cumulative across all topics in current web. Identical to $ntopics unless multiple="on"
$n or $n() New line. Use $n() if followed by alphanumeric character, e.g. write Foo$n()Bar instead of Foo$nBar
$lt Less than sign (<)
$locked LOCKED flag (if any)
$isodate Time stamp of last topic update, e.g. 2024-03-28T17:45Z
$gt Greater than sign (>)
$formname The name of the form attached to the topic; empty if none
$formfield(name, render:display) Form field value, rendered for display. For example, a form field of type color will render as a colored box. If not specified, the raw value is returned, such as a color value #336699. The render:display parameter can be combined with other parameters, but must be used after the parameters described below.
$formfield(name, encode:type) Form field value, encoded in the specified type. Possible types are the same as in ENCODE: quote, moderate, safe, entity, html, url and csv. The encode:type parameter can be combined with other parameters described below, but it needs to be the last parameter. Example: $formfield(Description, 20, encode:html)
$formfield(name, 30, ...) Form field value, shortened to 30 characters with "..." indication
$formfield(name, 20, -<br />) Form field value, hyphenated each 20 characters with separator "-<br />"
$formfield(name, 10) Form field value, "- " hyphenated each 10 characters
$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
$dollar Dollar sign ($)
$date Time stamp of last topic update, e.g. 2024-03-28 - 17:45
$createwikiusername Wiki user name of topic revision 1, e.g. Users.JohnSmith
$createwikiname Wiki user name of topic revision 1, e.g. JohnSmith
$createusername Login name of topic revision 1, e.g. jsmith
$createdate Time stamp of topic revision 1
$count(reg-exp) Count of number of times a regular expression pattern appears in the text of a topic (does not search meta data). Follows guidelines for use and limitations outlined above under $pattern(reg-exp). Example: $count(.*?(---[+][+][+][+]) .*) counts the number of <H4> headers in a page.
$changes(n) Summary of changes between latest rev and rev n
$changes Summary of changes between latest rev and previous rev
$aquot Apostrophe quote (')

3. footer="..." parameter

Use the footer parameter to specify the footer of a search result. It should correspond to the format of the format parameter. This parameter is optional.
Example: footer="| *Topic* | *Summary* |"

Variables that can be used in the footer string:

Name: Expands To:
$web Name of the web
$ntopics Number of topics found in current web
$tntopics The total number of topics matched
$nwebs The number of webs searched
$nhits Number of hits if multiple="on". Cumulative across all topics in current web. Identical to $ntopics unless multiple="on"
$n or $n() New line. Use $n() if followed by alphanumeric character, e.g. write Foo$n()Bar instead of Foo$nBar
$nop or $nop() Is a "no operation". This variable gets removed; useful for nested search
$quot or \" Double quote (")
$aquot Apostrophe quote (')
$percnt Percent sign (%)
$dollar Dollar sign ($)
$lt Less than sign (<)
$gt Greater than sign (>)

4. default="..." parameter

Use the default parameter to specify a default message if there are no hits in a web. This parameter is optional.
Example: default="| *Note* | Nothing found in the [[$web.WebHome][$web]] web |"

Variables that can be used in the default string:

Name: Expands To:
$web Name of the web
$n or $n() New line. Use $n() if followed by alphanumeric character, e.g. write Foo$n()Bar instead of Foo$nBar
$nop or $nop() Is a "no operation". This variable gets removed; useful for nested search
$quot or \" Double quote (")
$aquot Apostrophe quote (')
$percnt Percent sign (%)
$dollar Dollar sign ($)
$lt Less than sign (<)
$gt Greater than sign (>)

Results pagination

When a search return many results, you may want to paginate them having the following line below the results.

«Prev   1   2   3   4   5   Next»

SearchResultsPagination describes how to do it.

Evaluation order of variables

By default, variables embedded in the format parameter of %SEARCH{}% are evaluated once before the search. This is OK for variables that do not change, such as %SCRIPTURLPATH%. Variables that should be evaluated once per search hit must be escaped. For example, to escape a conditional:
    %IF{ "..." then="..." else="..." }%
write this:
    format="$percntIF{ \"...\" then=\"...\" else=\"...\" }$percnt"

Examples

Here are some samples of formatted searches. The SearchPatternCookbook has other examples, such as creating a picklist of usernames, searching for topic children and more.

Bullet list showing topic name and summary

Write this:

%SEARCH{
 "FAQ"
 scope="topic"
 nosearch="on"
 nototal="on"
 header="   * *Topic: Summary:*"
 format="   * [[$topic]]: $summary"
 footer="   * *Topic: Summary*"
}%

To get this:

  • Topic: Summary:
  • TWikiFAQ: Frequently Asked Questions About TWiki This is a real FAQ, and also a demo of an easily implemented knowledge base solution. To see how it`s done, view the source...
  • TWikiFaqTemplate: FAQ: Answer: Back to: TWikiFAQ Contributors:
  • TextFormattingFAQ: Text Formatting FAQ This topics lists frequently asked questions on text formatting. Text formatting applies to people who edit TWiki pages in raw edit mode . TextFormattingRules...
  • Topic: Summary

Table showing form field values of topics with a form

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" type="regex" nosearch="on" nototal="on" format="| [[$topic]] | $formfield(OperatingSystem) | $formfield(OsVersion) |" }%

To get this:

Topic: OperatingSystem OsVersion
IncorrectDllVersionW32PTH10DLL OsWin 95/98
WinDoze95Crash OsWin 95

Extract some text from a topic using regular expression

Write this:

%SEARCH{
 "__Back to\:__ TWikiFAQ"
 scope="text"
 type="regex"
 nosearch="on"
 nototal="on"
 header="TWiki FAQs:"
 format="   * $pattern(.*?FAQ\:[\n\r]*([^\n\r]+).*) [[$topic][Answer...]]"
}%

To get this:

TWiki FAQs:

  • How can I create a simple TWiki Forms based application? Answer...
  • How do I delete or rename a topic? Answer...
  • How do I delete or rename a file attachment? Answer...
  • Why does the topic revision not increase when I edit a topic? Answer...
  • TWiki is distributed under the GPL (GNU General Public License). What is GPL? Answer...
  • I've problems with the WebSearch. There is no Search Result on any inquiry. By clicking the Index topic it's the same problem. Answer...
  • What happens if two of us try to edit the same topic simultaneously? Answer...
  • I would like to install TWiki on my server. Can I get the source? Answer...
  • What does the "T" in TWiki stand for? Answer...
  • So what is this WikiWiki thing exactly? Answer...
  • Everybody can edit any page, this is scary. Doesn't that lead to chaos? Answer...

Nested Search

Search 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. Let's search for all topics that contain the word "culture" (first search), and let's find out where each topic found is linked from (second search).

  • 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" 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
    • Use $dollar to escape the $ of $topic
    • Use $nop to escape the }% sequence

Write this:

%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:

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.

Note: Another option, instead of a nested search, is to create a hash. Refer to the blog TWiki:Blog.BlogEntry201603x1. A search using hashes, if possible, may be significantly faster than a nested search.

Most recently changed pages

Write this:

%SEARCH{
 "\.*"
 scope="topic"
 type="regex"
 nosearch="on"
 nototal="on"
 sort="modified"
 reverse="on"
 format="| [[$topic]] | $wikiusername  | $date |"
 limit="7"
}%=

To get this:

AnonimizedUsers AndreaSterbini 2021-07-09 - 14:18
CalendarPlugin TWikiContributor 2021-03-14 - 03:34
WebLeftBarWebsList AndreaSterbini 2020-11-01 - 11:03
AnonimizePlugin AndreaSterbini 2019-07-25 - 10:12
DefaultWebBar AndreaSterbini 2019-05-15 - 08:07
InterWikis TWikiContributor 2017-08-13 - 05:40
TWikiRegistration TWikiContributor 2015-08-23 - 21:23

Search with conditional output

A regular expression search is flexible, but there are limitations. For example, you cannot show all topics that are up to exactly one week old, or create a report that shows all records with invalid form fields or fields within a certain range, etc. You need some additional logic to format output based on a condition:

  1. Specify a search which returns more hits then you need
  2. For each search hit apply a spreadsheet formula to determine if the hit is needed
  3. If needed, format and output the result
  4. Else supress the search hit

This requires the TWiki:Plugins.SpreadSheetPlugin. The following example shows all topics in the Users web that have been updated in the last 7 days.

Write this:

%CALCULATE{$SET(weekold, $TIMEADD($TIME(), -7, day))}%
%SEARCH{ "." scope="topic" type="regex" web="Users" nonoise="on" sort="modified" reverse="on" format="$percntCALCULATE{$IF($TIME($date) < $GET(weekold), <nop>, | [[$web.$topic][$topic]] | $wikiusername | $date | $rev |)}$percnt" limit="100" }%

  • The first line sets the weekold variable to the serialized date of exactly one week ago
  • The SEARCH has a deferred CALCULATE. The $percnt makes sure that the CALCULATE gets executed once for each search hit
  • The CALCULATE compares the date of the topic with the weekold date
  • If topic is older, a <nop> is returned, which gets removed at the end of the TWiki rendering process
  • Otherwise, the search hit is formatted and returned
  • This example is for illustration only, it is easier to use the date="..." paramter in SEARCH to restrict the date.

To get this:

FedericoSampalmieri TWikiRegistrationAgent 2024-03-28 - 16:29 1
AndreaMonforte TWikiRegistrationAgent 2024-03-28 - 12:09 1
MarcoPettisano TWikiRegistrationAgent 2024-03-28 - 10:46 1
MarcoN TWikiRegistrationAgent 2024-03-27 - 19:57 1
LucaxPerins TWikiRegistrationAgent 2024-03-27 - 17:42 1
DavideManfredi TWikiRegistrationAgent 2024-03-27 - 14:52 1
SofiaRuggeri2 TWikiRegistrationAgent 2024-03-27 - 11:41 1
GabrielemMercolinoBookmarks GabrielemMercolino 2024-03-27 - 10:37 2
RussoAdriano TWikiRegistrationAgent 2024-03-27 - 10:07 1
VictorSticchi TWikiRegistrationAgent 2024-03-27 - 09:09 1
YuXiao TWikiRegistrationAgent 2024-03-26 - 21:08 1
OrnellaMassomaKane TWikiRegistrationAgent 2024-03-26 - 19:26 1
AndreaGreco TWikiRegistrationAgent 2024-03-26 - 18:24 1
GiovanniScafetta TWikiRegistrationAgent 2024-03-26 - 18:17 1
FrancescoMinichelli TWikiRegistrationAgent 2024-03-26 - 17:29 1
LucaPicano TWikiRegistrationAgent 2024-03-26 - 16:51 1
LorenzoMantione TWikiRegistrationAgent 2024-03-26 - 16:46 1
RiccardoVirili TWikiRegistrationAgent 2024-03-26 - 11:12 1
SimonePaolelli TWikiRegistrationAgent 2024-03-26 - 11:09 1
LucaMicarelli TWikiRegistrationAgent 2024-03-26 - 11:02 1
FedericoScarselletta TWikiRegistrationAgent 2024-03-26 - 10:07 1
FilippoOliviero TWikiRegistrationAgent 2024-03-26 - 09:33 1
PietroRinaldi TWikiRegistrationAgent 2024-03-26 - 08:07 1
MattiaPatetta TWikiRegistrationAgent 2024-03-26 - 07:48 1
ClarensKoci TWikiRegistrationAgent 2024-03-25 - 18:40 1
JacopoSantoro TWikiRegistrationAgent 2024-03-25 - 17:03 1
GianmarcoTassi TWikiRegistrationAgent 2024-03-25 - 16:59 1
MatteoCarnicelli TWikiRegistrationAgent 2024-03-25 - 16:58 1
VeronicaNeccia TWikiRegistrationAgent 2024-03-25 - 16:57 1
AbdelkarimMoumni TWikiRegistrationAgent 2024-03-25 - 16:05 1
SimoneNozza TWikiRegistrationAgent 2024-03-25 - 15:40 1
MattiaMaiorano TWikiRegistrationAgent 2024-03-25 - 15:09 1
LucaSansone TWikiRegistrationAgent 2024-03-25 - 14:54 1
AglaiaNorzaWatchlist AglaiaNorza 2024-03-25 - 11:19 1
DragosGabrielGeana TWikiRegistrationAgent 2024-03-25 - 11:13 1
TommasoPaglino TWikiRegistrationAgent 2024-03-25 - 11:11 1
CharmaineKristelMedrano TWikiRegistrationAgent 2024-03-25 - 11:09 1
GabrieleManna TWikiRegistrationAgent 2024-03-25 - 11:09 1
MirkoRoselli TWikiRegistrationAgent 2024-03-25 - 11:05 1
DanieleMattei TWikiRegistrationAgent 2024-03-25 - 11:03 1
ChanghongDenisYe TWikiRegistrationAgent 2024-03-25 - 11:00 1
SimonePieretti TWikiRegistrationAgent 2024-03-25 - 10:50 1
RiccardoOrsola TWikiRegistrationAgent 2024-03-25 - 09:20 1
LeonardoGuido TWikiRegistrationAgent 2024-03-25 - 09:14 1
RiccardoPagnozzi TWikiRegistrationAgent 2024-03-25 - 09:14 1
FlavioPiratoni TWikiRegistrationAgent 2024-03-25 - 08:51 1
FedericoSacchetti TWikiRegistrationAgent 2024-03-25 - 08:46 1
DarioOjog TWikiRegistrationAgent 2024-03-25 - 08:04 1
SimoneMazzi TWikiRegistrationAgent 2024-03-25 - 00:10 1
ErinRustani TWikiRegistrationAgent 2024-03-24 - 20:40 1
TommasoR TWikiRegistrationAgent 2024-03-24 - 20:24 1
BogdanMihaiTuvene TWikiRegistrationAgent 2024-03-24 - 20:04 1
MatteoSelva TWikiRegistrationAgent 2024-03-24 - 19:45 1
ErosPangilinan TWikiRegistrationAgent 2024-03-24 - 18:55 1
LeonardoPremutico TWikiRegistrationAgent 2024-03-24 - 18:28 1
DanieleSauli TWikiRegistrationAgent 2024-03-24 - 18:22 1
AntSal00 TWikiRegistrationAgent 2024-03-24 - 18:10 1
MatteoMei TWikiRegistrationAgent 2024-03-24 - 18:06 1
AlessiaTancredi TWikiRegistrationAgent 2024-03-24 - 15:42 1
AlessandroDori TWikiRegistrationAgent 2024-03-24 - 14:57 1
LiciaMoriconiPapisca TWikiRegistrationAgent 2024-03-23 - 22:36 1
MarcoProdomo TWikiRegistrationAgent 2024-03-23 - 18:14 1
DanieleZu TWikiRegistrationAgent 2024-03-23 - 16:33 1
FlavioMattoni TWikiRegistrationAgent 2024-03-23 - 16:18 1
LorenzoSarrecchia TWikiRegistrationAgent 2024-03-23 - 15:55 1
MirkoMarraffa TWikiRegistrationAgent 2024-03-23 - 15:46 1
MatteoPanchetti TWikiRegistrationAgent 2024-03-23 - 15:11 1
FlavioSiragusa TWikiRegistrationAgent 2024-03-23 - 13:48 1
LorenzoMercuri TWikiRegistrationAgent 2024-03-23 - 13:37 1
LeonardoMarelli TWikiRegistrationAgent 2024-03-23 - 13:36 1
MarcoSeverini TWikiRegistrationAgent 2024-03-23 - 13:32 1
EdoardoCiaraldi TWikiRegistrationAgent 2024-03-23 - 12:43 1
RiccardoPerria TWikiRegistrationAgent 2024-03-23 - 10:28 1
SamueleSciatore TWikiRegistrationAgent 2024-03-22 - 22:23 1
TiffanyHarto TWikiRegistrationAgent 2024-03-22 - 18:43 1
AndreaPuglia TWikiRegistrationAgent 2024-03-22 - 16:50 1
LorenzoPaonni TWikiRegistrationAgent 2024-03-22 - 16:44 1
JomarAldrinPangilinan JomarAldrinPangilinan 2024-03-22 - 16:40 2
LucaMontagner TWikiRegistrationAgent 2024-03-22 - 16:09 1
CristinaPorceddu TWikiRegistrationAgent 2024-03-22 - 16:09 1
LucaM TWikiRegistrationAgent 2024-03-22 - 15:56 1
ChiareDaze TWikiRegistrationAgent 2024-03-22 - 15:50 1
LeonardoRossi TWikiRegistrationAgent 2024-03-22 - 15:45 1
AngeloMeridiani TWikiRegistrationAgent 2024-03-22 - 15:11 1
ErikHovsepPeterNassimian TWikiRegistrationAgent 2024-03-22 - 15:08 1
AlessioGianni TWikiRegistrationAgent 2024-03-22 - 15:05 1
MariannaMartini TWikiRegistrationAgent 2024-03-22 - 14:57 1
GianluigiZona TWikiRegistrationAgent 2024-03-22 - 14:56 1
FrancescoMolinari96 TWikiRegistrationAgent 2024-03-22 - 14:54 1
DavidePioLandriscina DavidePioLandriscina 2024-03-22 - 14:42 2
AlessioSacco TWikiRegistrationAgent 2024-03-22 - 14:37 1
FelipeSampedro TWikiRegistrationAgent 2024-03-22 - 14:32 1
MohamedTaha TWikiRegistrationAgent 2024-03-22 - 12:09 1
AlessandroMilos TWikiRegistrationAgent 2024-03-22 - 12:09 1
AurelioSantarelli TWikiRegistrationAgent 2024-03-22 - 12:01 1
RideewitageLachithaSangeethPerera TWikiRegistrationAgent 2024-03-22 - 09:20 1
KevinAlessioFlorinNegoita TWikiRegistrationAgent 2024-03-22 - 09:15 1

The condition can be anything you like. To restrict search based on a date range it is easier to use the date="" parameter as shown in the next example.

Restrict search based on a date range

A search can be restricted based on a date range. The following example is identical to the previous one, showing all topics in the Users web that have been updated in the last 7 days.

Write this:

%SEARCH{
 "."
 scope="topic"
 type="regex"
 web="%USERSWEB%"
 nonoise="on"
 sort="modified"
 reverse="on"
 format="| [[$web.$topic][$topic]] | $wikiusername | $date | $rev |"
 limit="100"
 date="P1w/$today"
}%=

To get this:

FedericoSampalmieri TWikiRegistrationAgent 2024-03-28 - 16:29 1
AndreaMonforte TWikiRegistrationAgent 2024-03-28 - 12:09 1
MarcoPettisano TWikiRegistrationAgent 2024-03-28 - 10:46 1
MarcoN TWikiRegistrationAgent 2024-03-27 - 19:57 1
LucaxPerins TWikiRegistrationAgent 2024-03-27 - 17:42 1
DavideManfredi TWikiRegistrationAgent 2024-03-27 - 14:52 1
SofiaRuggeri2 TWikiRegistrationAgent 2024-03-27 - 11:41 1
GabrielemMercolinoBookmarks GabrielemMercolino 2024-03-27 - 10:37 2
RussoAdriano TWikiRegistrationAgent 2024-03-27 - 10:07 1
VictorSticchi TWikiRegistrationAgent 2024-03-27 - 09:09 1
YuXiao TWikiRegistrationAgent 2024-03-26 - 21:08 1
OrnellaMassomaKane TWikiRegistrationAgent 2024-03-26 - 19:26 1
AndreaGreco TWikiRegistrationAgent 2024-03-26 - 18:24 1
GiovanniScafetta TWikiRegistrationAgent 2024-03-26 - 18:17 1
FrancescoMinichelli TWikiRegistrationAgent 2024-03-26 - 17:29 1
LucaPicano TWikiRegistrationAgent 2024-03-26 - 16:51 1
LorenzoMantione TWikiRegistrationAgent 2024-03-26 - 16:46 1
RiccardoVirili TWikiRegistrationAgent 2024-03-26 - 11:12 1
SimonePaolelli TWikiRegistrationAgent 2024-03-26 - 11:09 1
LucaMicarelli TWikiRegistrationAgent 2024-03-26 - 11:02 1
FedericoScarselletta TWikiRegistrationAgent 2024-03-26 - 10:07 1
FilippoOliviero TWikiRegistrationAgent 2024-03-26 - 09:33 1
PietroRinaldi TWikiRegistrationAgent 2024-03-26 - 08:07 1
MattiaPatetta TWikiRegistrationAgent 2024-03-26 - 07:48 1
ClarensKoci TWikiRegistrationAgent 2024-03-25 - 18:40 1
JacopoSantoro TWikiRegistrationAgent 2024-03-25 - 17:03 1
GianmarcoTassi TWikiRegistrationAgent 2024-03-25 - 16:59 1
MatteoCarnicelli TWikiRegistrationAgent 2024-03-25 - 16:58 1
VeronicaNeccia TWikiRegistrationAgent 2024-03-25 - 16:57 1
AbdelkarimMoumni TWikiRegistrationAgent 2024-03-25 - 16:05 1
SimoneNozza TWikiRegistrationAgent 2024-03-25 - 15:40 1
MattiaMaiorano TWikiRegistrationAgent 2024-03-25 - 15:09 1
LucaSansone TWikiRegistrationAgent 2024-03-25 - 14:54 1
AglaiaNorzaWatchlist AglaiaNorza 2024-03-25 - 11:19 1
DragosGabrielGeana TWikiRegistrationAgent 2024-03-25 - 11:13 1
TommasoPaglino TWikiRegistrationAgent 2024-03-25 - 11:11 1
CharmaineKristelMedrano TWikiRegistrationAgent 2024-03-25 - 11:09 1
GabrieleManna TWikiRegistrationAgent 2024-03-25 - 11:09 1
MirkoRoselli TWikiRegistrationAgent 2024-03-25 - 11:05 1
DanieleMattei TWikiRegistrationAgent 2024-03-25 - 11:03 1
ChanghongDenisYe TWikiRegistrationAgent 2024-03-25 - 11:00 1
SimonePieretti TWikiRegistrationAgent 2024-03-25 - 10:50 1
RiccardoOrsola TWikiRegistrationAgent 2024-03-25 - 09:20 1
LeonardoGuido TWikiRegistrationAgent 2024-03-25 - 09:14 1
RiccardoPagnozzi TWikiRegistrationAgent 2024-03-25 - 09:14 1
FlavioPiratoni TWikiRegistrationAgent 2024-03-25 - 08:51 1
FedericoSacchetti TWikiRegistrationAgent 2024-03-25 - 08:46 1
DarioOjog TWikiRegistrationAgent 2024-03-25 - 08:04 1
SimoneMazzi TWikiRegistrationAgent 2024-03-25 - 00:10 1
ErinRustani TWikiRegistrationAgent 2024-03-24 - 20:40 1
TommasoR TWikiRegistrationAgent 2024-03-24 - 20:24 1
BogdanMihaiTuvene TWikiRegistrationAgent 2024-03-24 - 20:04 1
MatteoSelva TWikiRegistrationAgent 2024-03-24 - 19:45 1
ErosPangilinan TWikiRegistrationAgent 2024-03-24 - 18:55 1
LeonardoPremutico TWikiRegistrationAgent 2024-03-24 - 18:28 1
DanieleSauli TWikiRegistrationAgent 2024-03-24 - 18:22 1
AntSal00 TWikiRegistrationAgent 2024-03-24 - 18:10 1
MatteoMei TWikiRegistrationAgent 2024-03-24 - 18:06 1
AlessiaTancredi TWikiRegistrationAgent 2024-03-24 - 15:42 1
AlessandroDori TWikiRegistrationAgent 2024-03-24 - 14:57 1
LiciaMoriconiPapisca TWikiRegistrationAgent 2024-03-23 - 22:36 1
MarcoProdomo TWikiRegistrationAgent 2024-03-23 - 18:14 1
DanieleZu TWikiRegistrationAgent 2024-03-23 - 16:33 1
FlavioMattoni TWikiRegistrationAgent 2024-03-23 - 16:18 1
LorenzoSarrecchia TWikiRegistrationAgent 2024-03-23 - 15:55 1
MirkoMarraffa TWikiRegistrationAgent 2024-03-23 - 15:46 1
MatteoPanchetti TWikiRegistrationAgent 2024-03-23 - 15:11 1
FlavioSiragusa TWikiRegistrationAgent 2024-03-23 - 13:48 1
LorenzoMercuri TWikiRegistrationAgent 2024-03-23 - 13:37 1
LeonardoMarelli TWikiRegistrationAgent 2024-03-23 - 13:36 1
MarcoSeverini TWikiRegistrationAgent 2024-03-23 - 13:32 1
EdoardoCiaraldi TWikiRegistrationAgent 2024-03-23 - 12:43 1
RiccardoPerria TWikiRegistrationAgent 2024-03-23 - 10:28 1
SamueleSciatore TWikiRegistrationAgent 2024-03-22 - 22:23 1
TiffanyHarto TWikiRegistrationAgent 2024-03-22 - 18:43 1
AndreaPuglia TWikiRegistrationAgent 2024-03-22 - 16:50 1
LorenzoPaonni TWikiRegistrationAgent 2024-03-22 - 16:44 1
JomarAldrinPangilinan JomarAldrinPangilinan 2024-03-22 - 16:40 2
LucaMontagner TWikiRegistrationAgent 2024-03-22 - 16:09 1
CristinaPorceddu TWikiRegistrationAgent 2024-03-22 - 16:09 1
LucaM TWikiRegistrationAgent 2024-03-22 - 15:56 1
ChiareDaze TWikiRegistrationAgent 2024-03-22 - 15:50 1
LeonardoRossi TWikiRegistrationAgent 2024-03-22 - 15:45 1
AngeloMeridiani TWikiRegistrationAgent 2024-03-22 - 15:11 1
ErikHovsepPeterNassimian TWikiRegistrationAgent 2024-03-22 - 15:08 1
AlessioGianni TWikiRegistrationAgent 2024-03-22 - 15:05 1
MariannaMartini TWikiRegistrationAgent 2024-03-22 - 14:57 1
GianluigiZona TWikiRegistrationAgent 2024-03-22 - 14:56 1
FrancescoMolinari96 TWikiRegistrationAgent 2024-03-22 - 14:54 1
DavidePioLandriscina DavidePioLandriscina 2024-03-22 - 14:42 2
AlessioSacco TWikiRegistrationAgent 2024-03-22 - 14:37 1
FelipeSampedro TWikiRegistrationAgent 2024-03-22 - 14:32 1
MohamedTaha TWikiRegistrationAgent 2024-03-22 - 12:09 1
AlessandroMilos TWikiRegistrationAgent 2024-03-22 - 12:09 1
AurelioSantarelli TWikiRegistrationAgent 2024-03-22 - 12:01 1
RideewitageLachithaSangeethPerera TWikiRegistrationAgent 2024-03-22 - 09:20 1
KevinAlessioFlorinNegoita TWikiRegistrationAgent 2024-03-22 - 09:15 1

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"}%/%WEB%/%TOPIC%">
Find Topics: 
<input type="text" name="q" size="32" value="%URLPARAM{"q" encode="entity"}%" />&nbsp;<input type="submit" class="twikiSubmit" value="Search" />
</form>
Result:
%SEARCH{
 search="%URLPARAM{"q" encode="search"}%"
 type="keyword"
 format="   * $web.$topic: %BR% $summary"
 nosearch="on"
}%

To get this:

Find Topics:  
Result:

Related Topics: UserDocumentationCategory, SearchHelp, VarSEARCH, VarENCODE, SearchResultsPagination, SearchPatternCookbook, RegularExpression, QuerySearch

-- Contributors: TWiki:Main.PeterThoeny, TWiki:Main.CrawfordCurrie, TWiki:Main.SopanShewale


This topic: TWiki > WebHome > TWikiVariables > FormattedSearch
Topic revision: r28 - 2018-07-14 - TWikiContributor
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 1999-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback
Note: Please contribute updates to this topic on TWiki.org at TWiki:TWiki.FormattedSearch.