TWiki Variables » Search » Category: Searching & Listing

META -- displays meta-data

  • Provided mainly for use in templates, this variable generates the parts of the topic view that relate to meta-data (attachments, forms etc.) The formfield item is the most likely to be useful to casual users.
  • Syntax: %META{ "item" ...}%
  • Parameters:
Item Options Description
"formfield" name="...": name of the field. The field value can be shortened as described in FormattedSearch for $formfield.
newline="...": by default, each newline character will be rewritten to <br /> to allow metadata that contains newlines to be used in tables, etc. $n indicates a newline character.
bar="...": by default, each vertical bar is rewritten to an HTML entity so as to not be mistaken for a table separator.
encode="type": have the value encoded in the specified type. Possible types are the same as ENCODE's. If this is specified, newline and bar options are ignored.
topic="...": Get meta info of "Topic" or "Web.Topic"; default "%BASEWEB%.%BASETOPIC%".
Show a single form field
"form" topic="...": Get meta info of "Topic" or "Web.Topic"; default "%BASEWEB%.%BASETOPIC%". Generates the table showing the form fields. See Form Templates
"attachments" all="on" to show hidden attachments.
title="..." to show a title - only if attachments are displayed.
template="..." to use a custom template for the rendering of attachments; default attachtables is used.
topic="...": Get meta info of "Topic" or "Web.Topic"; default "%BASEWEB%.%BASETOPIC%".
Generates the list of attachments
"moved" topic="...": Get meta info of "Topic" or "Web.Topic"; default "%BASEWEB%.%BASETOPIC%". Details of any topic moves
"parent" dontrecurse="on": By default recurses up tree, this has some cost.
nowebhome="on": Suppress WebHome.
prefix="...": Prefix that goes before parents, but only if there are parents, default "".
format="...": Format string used to display each parent topic where $web expands to the web name, and $topic expands to the topic name; default: "[[$web.$topic][$topic]]"
suffix="...": Suffix, only appears if there are parents; default "".
separator="...": Separator between parents; default " > ".
topic="...": Get meta info of "Topic" or "Web.Topic"; default "%BASEWEB%.%BASETOPIC%".
Generates the parent link

METASEARCH -- special search of meta data

  • Syntax: %METASEARCH{...}%
  • Supported parameters:
Parameter: Description: Default:
type="topicmoved" What sort of search is required?
"topicmoved" if search for a topic that may have been moved
"parent" if searching for topics that have a specific parent i.e. its children
"field" if searching for topics that have a particular form field value (use the name and value parameters to specify which field to search)
Required
web="%WEB%" Wiki web to search: A web, a list of webs separated by whitespace, or all webs. Current web
topic="%TOPIC%" The topic the search relates to, for topicmoved and parent searches All topics in a web
name form field to search, for field type searches. May be a regular expression (see SEARCH).  
value form field value, for field type searches. May be a regular expression (see SEARCH).  
title="Title" Text that is prefixed to any search results empty
format="..." Custom format results. Supports same format strings as SEARCH. See FormattedSearch for usage, variables & examples Results in table
default="none" Default text shown if no search hit Empty

SEARCH{"text"} -- search content

  • Inline search, shows a search result embedded in a topic
  • Syntax: %SEARCH{"text" ...}%
  • Supported parameters:
Parameter: Description: Default:
"text" Search term. Is a keyword search, literal search, regular expression search, or query, depending on the type parameter. SearchHelp has more required
search="text" (Alternative to above) N/A
web="Name"
web="Main, Know"
web="all"
Comma-separated list of webs to search. You can specifically exclude webs from an all search using a minus sign - for example, web="all,-Secretweb". The special word all means all webs that do not have the NOSEARCHALL variable set to on in their WebPreferences. Note that TWikiAccessControls are respected when searching webs; it is much better to use them than NOSEARCHALL. Current web
topic="WebPreferences"
topic="*Bug"
Limit search to topics: A topic, a topic with asterisk wildcards, or a list of topics separated by comma. Note this is a list of topic names and must not include web names. All topics in a web
excludetopic="Web*"
excludetopic="WebHome, WebChanges"
Exclude topics from search: A topic, a topic with asterisk wildcards, or a list of topics separated by comma. Note this is a list of topic names and must not include web names. None
scope="topic"
scope="text"
scope="all"
Search topic name (title); the text (body) of topic; or all (title and body) "text"
type="keyword"
type="word"
type="literal"
type="regex"
type="query"
Control how the search is performed when scope="text" or scope="all"
keyword: use Google-like controls as in soap "web service" -shampoo; searches word parts: using the example, topics with "soapsuds" will be found as well, but topics with "shampoos" will be excluded
word: identical to keyword but searches whole words: topics with "soapsuds" will not be found, and topics with "shampoos" will not be excluded
literal: search for the exact string, like web service
regex: use a RegularExpression search like soap;web service;!shampoo; to search on whole words use \bsoap\b
query: query search of form fields and other meta-data, like (Firstname='Emma' OR Firstname='John') AND Lastname='Peel'
%SEARCHVAR- DEFAULTTYPE% preferences setting (literal)
sort="topic"
sort="created"
sort="modified"
sort="editby"
sort="parent"
sort=
 "formfield(name)"
Sort the results of search by the topic names, topic creation time, last modified time, last editor, parent topic name, or named field of TWikiForms. The sorting is done web by web; if you want to sort across webs, create a formatted table and sort it with TablePlugin's initsort. Note that dates are sorted most recent date last (i.e at the bottom of the table). Legacy order parameter is used in case sort is not specified. Sort by topic name
start="0"
start="20"
Specify the number of results to skip. This is done after sorting if sort parameter is specified. This is intended for pagination of results. If this parameter is specified, %NTOPICS% in the search template is replaced with the number of topics matched. Without this parameter, %NTOPICS% doesn't exceed the limit value. No results skipped
limit="all"
limit="16"
Limit the number of results returned. This is done after sorting if sort parameter is specified. This parameter specifing the number of results remains the same in the presense of the start parameter. Assuming there are more than 20 results matched, start="10" limit="10" results in 11th to 20th results are returned All results
date="..." limits the results to those pages with latest edit time in the given time interval. All results
createdate="..." similar to date but it's about create time instead of last edit. You can specify both date and createdate, in which case topics matching both conditions are shown. All results
reverse="on" Reverse the direction of the search Ascending search
casesensitive="on" Case sensitive search Ignore case
bookview="on" BookView search, e.g. show complete topic text Show topic summary
nonoise="on" Shorthand for nosummary="on" nosearch="on" nototal="on" zeroresults="off" noheader="on" noempty="on" Off
nosummary="on" Show topic title only Show topic summary
nosearch="on" Suppress search string Show search string
noheader="on" Suppress default search header
Topics: Changed: By: , unless a header is explicitly specified
Show default search header, unless search is inline and a format is specified (Cairo compatibility)
nototal="on" Do not show number of topics found Show number
zeroresults="off" Suppress all output if there are no hits zeroresults="on", displays: "Number of topics: 0"
noempty="on" Suppress results for webs that have no hits. Show webs with no hits
headingoffset="2" Adjust the level of headings in text of topics found, taking effect in $text and $pattern() of a FormattedSearch. A "2" or "+2" increases the level by two, e.g. a ---+ H1 turns into a ---+++ H3. Positive and negative values are supported. Adjusted min and max levels are H1 and H6, respectively. no adjustment
header="..."
format="..."
footer="..."
Custom format results. See FormattedSearch for usage, variables & examples Results in table
default="..." Default message if there are no hits in a web. See FormattedSearch for usage, variables & examples No output
expandvariables="on" Expand variables before applying a FormattedSearch on a search hit. Useful to show the expanded text, e.g. to show the result of a SpreadSheetPlugin %CALC{}% instead of the formula Raw text
multiple="on" Multiple hits per topic. Each hit can be formatted. The last token is used in case of a regular expression ";" and search Only one hit per topic
nofinalnewline="on" If on, the search variable does not end in a line by itself. Any text continuing immediately after the search variable on the same line will be rendered as part of the table generated by the search, if appropriate. off
recurse="on" Recurse into subwebs, if subwebs are enabled. off
separator=", " Line separator between search hits "$n" (Newline)
newline="%BR%" Line separator within a search hit. Useful if you want to put multi-line content into a table cell, for example if the format="" parameter contains a $pattern() that captures more than one line, or contains a $formfield() that returns a multi-line textfield. "$n" (Newline)
encode="html" Encode special characters into HTML entities. If a FORMFIELD is passed into an HTML form field it should be encoded as "html". Additional encodings available: encode="quote", encode="moderate", encode="safe", encode="entity" and encode="url". See ENCODE for details. no encoding

TOPICLIST{"format"} -- topic index of a web

  • List of all topics in a web. The "format" defines the format of one topic item. It may include variables: The $topic variable gets expanded to the topic name, $marker to marker parameter where topic matches selection, and $web to the name of the web, or any of the standard FormatTokens.
  • Syntax: %TOPICLIST{"format" ...}%
  • Supported parameters:
Parameter: Description: Default:
"format" Format of one line, may include $web (name of web), $topic (name of the topic), $marker (which expands to marker for the item matching selection only) "$topic"
format="format" (Alternative to above) "$topic"
separator=", " line separator "$n" (new line)
marker="selected" Text for $marker if the item matches selection "selected"
selection="TopicA, TopicB" Current value to be selected in list (none)
web="Name" Name of web Current web
  • Example: %TOPICLIST{"   * $web.$topic"}% creates a bullet list of all topics
  • Example: %TOPICLIST{separator=", "}% creates a comma separated list of all topics
  • Example: %TOPICLIST{" <option>$topic</option>"}% creates an option list (for drop down menus)
  • Example: <select>%TOPICLIST{" <option $marker value='$topic'>$topic</option>" separator=" " selection="%TOPIC%"}%</select> creates an option list of web topics with the current topic selected
  • Category: SearchingAndListingVariables, SystemInformationVariables
  • Related: SEARCH, WEBLIST (this topic)

WEBLIST{"format"} -- index of all webs

  • List of all webs. Obfusticated webs are excluded, e.g. webs with a NOSEARCHALL = on preference variable. The "format" defines the format of one web item. The $name variable gets expanded to the name of the web, $qname gets expanded to double quoted name, $marker to marker where web matches selection.
  • Syntax: %WEBLIST{"format" ...}%
  • Supported parameters:
Parameter: Description: Default:
"format" Format of one line, may include following items. In addtion, the standard special tokens are handled accordingly.
Item Description
$name the name of the web
$qname the name of the web in double quotes
$indentedname the name of the web with parent web names replaced by indents, for use in indented lists
$listindent expands to multiple-of-3 spaces for bullet (*) and numberd (1., a., etc.) lists. It's relative to the depth of the web specified by the subwebs parameter. See an example below.
$marker expands to marker for the item matching selection only
$web expands to the value specified by the web parameter
If you need to have a letter immediately after an item listed above, use $nop(), one of FormatTokens. e.g. $name$nop()a
"$name"
format="format" (Alternative to above) "$name"
separator=", " Line separator "$n" (new line)
web="" if you specify $web in format, it will be replaced with this ""
webs="public" Comma separated list of webs. There are special webs:
Item Description
public expands to all non-hidden webs.
cancopyto similar to public, but webs to which a topic of the current web cannot be copied to are excluded. Specifically, excluded are read-only webs and mirror webs.
canmoveto similar to cancopyto, but webs to which a topic of the current web cannot be moved to are excluded. Specifically, excluded are webs residing on different disks from the current web.
webtemplate expands to all template webs, whose name start with underscore (_)
NOTE 1: Administrators will see all webs, not just the public ones.
NOTE 2: If MetadataRepository is used and webs are required to be registered, then cancopyto, canmoveto, and webtemplate behave differently.
  • cancopyto and canmoveto results include all top level webs and subwebs of the current webs are listed regardless of accessibility - subwebs of non-current webs are excluded. They also include the user's subweb.
  • webtemplate result has top level template webs only.
"public"
marker="selected" Text for $marker if the item matches selection "selected"
selection="%WEB%" Current value to be selected in list selection="%WEB%"
subwebs="Sandbox" Show webs that are a sub-web of this one (recursivly) ""
depth="1" Specify the maximum depth of recursive search. E.g. %WEBLIST{depth="1"}% shows only top level webs. %WEBLIST{subwebs="Foo" depth="1"}% shows the direct subwebs of Foo. (no maximum depth)
limit="30" Limit number of webs to show "" (all)
overlimit="..." Message shown if over limit, such as: overlimit="   * [[%SYSTEMWEB%.SiteMap][More...]]" ""

Total: 5 variables

Related Topics: TWikiVariables, TWikiVariablesSearch, TWikiVariablesQuickStart

r1 - 11 Nov 2012 - 09:07:03 - TWikiContributor
 
Linux & Open Source for AT91 Microchip Microprocessors

Copyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.

Linux® is the registered trademark of Linus Torvalds in the U.S. and other countries.

Microchip and others, are registered trademarks or trademarks of Microchip Technology Inc. and its subsidiaries. This site is powered by the TWiki collaboration platform

Arm® and others are registered trademarks or trademarks of Arm Limited (or its affiliates). Other terms and product names may be trademarks of others.

Ideas, requests, contributions ? Connect to LinksToCommunities page.

Syndicate this siteRSS ATOM