FORMAT -- format a list of objects

Parameters

Parameter Description Default
"one, two, three" The list to be expanded into the format. Required. Currently only two types of list data are supported; topic names (type="topic") and plain strings (type="string").  
format Format string; see Supported formatting tokens for possible values.  
header Text to come before the formatted output  
footer Text to come after the formatted output  
separator Separator between formatted elements $n
type Treat input list as either topic or string topic

Examples

   %FORMAT{"one,two,three" type="string" format="   * $item"}%
   %FORMAT{"%SKIN%"
      header="the Skin setting is evaluated in this order:"
      format="   1 =$topic="
      footer="   1 =default="
   }%

Supported formatting tokens

If type="topic" (the default) the format string can contain any of the topic-specific format tokens specified in FormattedSearch ($web, $topic, $parent, $text, $locked, $date, $isodate, $index, $item, $rev, $username, $wikiname, $wikiusername, $createdate, $createusername, $createwikiname, $createwikiusername, $summary, $changes, $formname, $formfield, $pattern, $count, $ntopics, $nhits, $pager). In addition, the macro supports all the standard FormatTokens.

If type="string" then the comma separated list is treated as a list of strings. In this case, the format tokens $index and $item will return the position of the item in the list (1-based), and the item itself, respectively. Note that a comma can be embedded in the data using the standard formatting token $comma.

The FORMAT macro is currently only of use in formatting lists of topics, or of simple strings. It will be extended in future releases to add the capability to render other object types.

IDEA! For more sophisticated handling of string lists, consider installing Foswiki:Extensions.FilterPlugin

SEARCH, ENCODE, FormattedSearch
Kontakt
Pädagogische Hochschule Schwyz
Zaystrasse 42
CH-6410 Goldau
T +41 41 859 05 90
info@phsz.ch Dies ist ein Wiki des Fachkerns Medien und Informatik der Pädagogischen Hochschule Schwyz. Für Fragen wenden Sie sich bitte an wikiadmin@phsz.ch
This page was cached on 07 Feb 2025 - 17:33.
This website is using cookies. More info. That's Fine