TWiki Variables » Search » Category: Applications & Components

ADDTOHEAD -- add HTML to the HTML head section of the current page

  • Useful for TWiki applications to add custom CSS or JavaScript to the HTML head section of a topic. Supplied TWiki variables will be expanded. %ADDTOHEAD{}% expands in-place to an empty string, unless there is an error in which case the variable expands to an error string.
  • Syntax: %ADDTOHEAD{ "..." text="..." }%
  • Supported parameters:
    Parameter: Description: Comment:
    "..." ID of the head block, such as "MY_CSS" Optional but recommended
    text="..." HTML text to add to the head section Mutually exclusive with topic=""
    topic="Web.TopicName" Name of topic that contains the full HTML text to add to the head section, such as topic="Main.MyCssTopic" Mutually exclusive with text=""
    section="name" If topic parameter is used, includes only the specified named section, as defined in the topic by the STARTSECTION and ENDSECTION variables. Nothing is shown if the named section does not exists. section="" is equivalent to not specifying a section Optional
    requires="..., ..." Comma-separated list of other IDs this one depends on Optional
  • Category: ApplicationsAndComponentsVariables, DevelopmentVariables
  • Example: %ADDTOHEAD{ "MYBOX_CSS" text="<style type=\"text/css\"> .myBox { height: 22px; background-color: #AFB3C5; } </style>" }% (this topic)

COLORPICKER{} -- color picker for use in HTML forms for TWiki applications

COMMENT{ attributes } -- insert an edit box into the topic to easily add comments.

  • A %COMMENT% without parameters shows a simple text box.
  • A %COMMENT{}% can handle the following parameters:
    Parameter DescriptionSorted ascending Default
    button Button label text "Add comment"
    default Default text to put into the textarea of the prompt.  
    mode For compatibility with older versions only, synonymous with type  
    target Name of the topic to add the comment to the current topic
    location Regular expression specifying the comment location in the target topic. Read carefully the CommentPlugin documentation!  
    emailto Send comment by email. Use comma "," to seperate multiple email addresses. This feature is disabled by default. To enable this feature, please set up "$TWiki::cfg{Plugins}{CommentPlugin}{EmailEnabled} = 1;".  
    nonotify Set to "on" to disable change notification for target topics "off"
    nopost Set to "on" to disable insertion of the posted text into the topic. "off"
    noform Set to "on" to disable the automatic form that encloses your comment block - remember to insert <form> tags yourself! See CommentPluginExamples#noform for an example. "off"
    remove Set to "on" to remove the comment prompt after the first time it is clicked. "off"
    type This is the name of the template to use for this comment. Comment templates are defined in a TWiki template - see customization. If this attribute is not defined, the type is whatever is defined by COMMENTPLUGIN_DEFAULT_TYPE, either in this topic or in your WebPreferences. "below"

DASHBOARD -- build a dashboard with banner and boxes

DATEPICKER{} -- pop-up calendar to select a date for use in HTML forms

  • The %DATEPICKER{}% variable is handled by the DatePickerPlugin.
  • Syntax: %DATEPICKER{ name="..." value="..." }%
  • Parameters:
    Parameter Description Default Example
    name Name of input field.
    φ: No output is shown if the name parameter is missing, but the CSS and Javascript are loaded.
    (requiredφ) name="Start"
    value Initial date value. "" (today) value="2012-12-31"
    format Format of resulting date value.
    %a - abbreviated weekday name
    %A - full weekday name
    %b - abbreviated month name
    %B - full month name
    %C - century number
    %d - the day of the month (00 ... 31)
    %e - the day of the month (0 ... 31)
    %H - hour (00 ... 23)
    %I - hour (01 ... 12)
    %j - day of the year ( 000 ... 366)
    %k - hour (0 ... 23)
    %l - hour (1 ... 12)
    %m - month (01 ... 12)
    %M - minute (00 ... 59)
    %n - a newline character
    %p - "PM" or "AM"
    %P - "pm" or "am"
    %S - second (00 ... 59)
    %s - number of seconds since Epoch (since Jan 01 1970 00:00:00 UTC)
    %t - a tab character
    %U, %W, %V - the week number. The week 01 is the week that has the Thursday in the current year, which is equivalent to the week that contains the fourth day of January. Weeks start on Monday.
    %u - the day of the week (1 ... 7, 1 = MON)
    %w - the day of the week (0 ... 6, 0 = SUN)
    %y - year without the century (00 ... 99)
    %Y - year including the century (ex. 2012)
    %% - a literal % character
    "%Y-%m-%d" format="%e %b %Y"
    id ID of input field, optional. "id_" + name id="idStart"
    size Size of input field, in number of characters. (calculated as needed) size="12"
    class CSS class of input field. "twikiInputField" class="dateField"
    Additional HTML input field attributes, such as alt, disabled, maxlength, onblur, onchange, onfocus, readonly, style, tabindex, title    
  • Example:
    <form action="...">
    %DATEPICKER{ name="Start_Date" }%
    <form>
  • Expands to:
  • Category: ApplicationsAndComponentsVariables, DatabaseAndFormsVariables, DateAndTimeVariables, EditingAndContentUpdateVariables, FormattingAndRenderingVariables, UIAndVisualizationVariables
  • Related: DatePickerPlugin, TWikiForms (this topic)

ENCODE{string} -- encode a string to URL or HTML entities

  • Encode "special" characters to HTML numeric entities or to URL entities.
  • Encoded characters:
    • all non-printable ASCII characters below space, except newline ("\n") and linefeed ("\r")
    • HTML special characters "<", ">", "&", single quote (') and double quote (")
    • TWiki special characters "%", "[", "]", "@", "_", "*", "=" and "|"
  • Syntax: %ENCODE{"string"}%
  • Supported parameters:
    Parameter: Description: Default:
    "string" String to encode required (can be empty)
    type="url" Encode special characters for URL parameter use, like a double quote into %22 (this is the default)
    type="quotes" Escape double quotes with backslashes (\"), does not change other characters. This type does not protect against cross-site scripting. type="url"
    type="moderate" Encode special characters into HTML entities for moderate cross-site scripting protection: "<", ">", single quote (') and double quote (") are encoded. Useful to allow TWiki variables in comment boxes. type="url"
    type="safe" Encode special characters into HTML entities for cross-site scripting protection: "<", ">", "%", single quote (') and double quote (") are encoded. type="url"
    type="entity" Encode special characters into HTML entities, like a double quote into &#034;. Does not encode newline (\n) or linefeed (\r). type="url"
    type="entity"
    extra=" $n$r"
    For type="entity" only, use the extra parameter to encode additional characters to HTML numeric entities. Formatting tokens can be used, such as "$n" for newline. Note that type="entity" extra=" $n$r" is equivalent to type="html". type="url"
    extra=""
    type="html" Encode special characters into HTML entities. In addition to type="entity", it also encodes space, \n and \r. Useful to encode text properly in HTML input fields. See equivalent ENTITY. type="url"
  • Examples:
    • %ENCODE{"spaced name"}% expands to spaced%20name
    • %ENCODE{"spaced name" type="entity" extra=" "}% expands to spaced&#32;name
  • Notes:
    • Values of HTML input fields should be encoded as "html". A shorter %ENTITY{any text}% can be used instead of the more verbose %ENCODE{ "any text" type="html" }%.
      Example: <input type="text" name="address" value="%ENTITY{any text}%" />
    • Double quotes in strings must be escaped when passed into other TWiki variables.
      Example: %SEARCH{ "%ENCODE{ "string with "quotes"" type="quotes" }%" noheader="on" }%
    • Use type="moderate", type="safe", type="entity" or type="html" to protect user input from URL parameters and external sources against cross-site scripting (XSS). type="html" is the safest mode, but some TWiki applications might not work. type="safe" provides a safe middle ground, type="moderate" provides only moderate cross-site scripting protection.
  • Category: ApplicationsAndComponentsVariables, DevelopmentVariables, ExportAndPublishingVariables
  • Related: ENTITY, FORMFIELD, QUERYPARAMS, URLPARAM (this topic)

GET{"name"} -- get a variable

  • Get the value of a named variable, previously set with %SET{}%. The %SET{}% and %GET{}% variables are handled by the SetGetPlugin.
  • Syntax: %GET{ "name" default="..." }%
  • Parameters:
    Parameter Description Default
    "name" Name of variable. (required)
    format="..." Format with supported variables:
    $name for variable name
    $value for variable value
    $isdefined expanding to 1 or 0 depending if variable is defined or not
    $isset expanding to 1 or 0 depending if variable is logically true or false
    $ispersistent expanding to 1 or 0 depending if variable is persistent or not
    • all FormatTokens such as $dollar, $n, $percnt.
    "$value"
    default="..." Text shown if variable is not defined, e.g. not found. This parameter overrides the format parameter. "" (empty string)
  • Example: %GET{"lunch"}% returns Sushi if the following has been previously set:
    %SET{ "lunch" value="Sushi" }% - see more examples
  • Category: ApplicationsAndComponentsVariables, DevelopmentVariables
  • Related: IF, SET, SETGETDUMP, SetGetPlugin, SpreadSheetPlugin#FuncGET (this topic)

HEADLINES{"url"} -- show RSS and ATOM feeds in TWiki pages

  • The %HEADLINES{"url"}% variable is handled by the HeadlinesPlugin.
  • Syntax: %HEADLINES{ "http://..." }%
  • Parameters: (all but the first one are optional)
    "..." Source of RSS or ATOM feed; this can be a URL (starting with http) or a web.topic location for internal feeds
    refresh="60" Refresh rate in minutes for caching feed; "0" for no caching
    limit="12" Maximum number of items shown
    header="..." Header. May include these variables:
    - $channeltitle, $title: title of channel (channel.title)
    - $channellink, $link: link of channel (channel.link)
    - $channeldescription, $description: description (channel.description)
    - $channeldate, $date: publication date of the channel (channel.pubDate)
    - $rights: copyrights of the channel (channel.copyright)
    - $imagetitle: title text for site (image.title)
    - $imagelink: link for site (image.link)
    - $imageurl: URL of image (image.url)
    - $imagedescription: description of image (image.description)
    format="..." Format of one item. May include these variables:
    - $title: news item title (item.title)
    - $link: news item link (item.link)
    - $description: news item description (item.description)
    - $date: the publication date (item.pubDate, item.date)
    - $category: the article category (item.category)
    Details
  • Example: %HEADLINES{ "http://slashdot.org/slashdot.rdf" header="*[[$link][$title]]:* $description" format="$t* [[$link][$title]]" limit="4" }% shows the latest Slashdot news in bullet list format
  • Category: ApplicationsAndComponentsVariables, ImportVariables
  • Related: HeadlinesPlugin (this topic)

INCLUDE{"page"} -- include other topic or web page

  • Merges the content of a specified page into the current one before rendering.
  • Syntax: %INCLUDE{"page" ...}%
  • Supported parameters:
    Parameter: Description: Default:
    "SomeTopic" The name of a topic located in the current web, i.e. %INCLUDE{"WebNotify"}%  
    "Web.Topic" A topic in another web, i.e. %INCLUDE{"TWiki.SiteMap"}%  
    "http://..." A full qualified URL, i.e. %INCLUDE{"http://twiki.org:80/index.html"}%. Supported content types are text/html and text/plain by default. See allowanytype.
    IDEA! if the URL resolves to an attachment file on the server this will automatically translate to a server-side include.
     
    allowanytype="on" Suppress the content type checking in including the web page specified by a URL. disabled
    pattern="..." Include a subset of a topic or a web page. Specify a RegularExpression that scans from start ('^') to end and contains the text you want to keep in parenthesis, e.g., pattern="^.*?(from here.*?to here).*". IncludeTopicsAndWebPages has more. none
    headingoffset="2" Adjust the level of headings in the included topic. 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
    hidetoc="on" Remove %TOC% in included content. Useful to show table of contents in individual topics, while suppressing them if included in a big master document. TOC_HIDE_IF_
    INCLUDED
    setting
    rev="2" Include a previous topic revision; N/A for URLs top revision
    raw="on" (for HTTP inclusion) When a page is included via HTTP, normally TWiki will process it, doing the following: 1) Alter relative links to point back to originating host, 2) Remove some basic HTML tags (html, head, body, script) and finally 3) Remove newlines from HTML tags spanning multiple lines. If you prefer to include exactly what is in the source of the originating page set this to on. raw="on" is short for disableremoveheaders="on", disableremovescript="on", disableremovebody="on", disablecompresstags="on" and disablerewriteurls="on". disabled
    raw="on" (for topic inclusion) When a topic is included, normally TWiki variables in the included topic are expanded in the context of the inlcluded topic. If raw="on" is specified, that variable expansion does not happen. You may wonder what's that for and what are the implications, which are found out on IncludeTopicRaw.
    Because of the "in the raw" nature of the parapmeter, if it's specified, parameters such as encode, headingoffset, hidetoc, newline, nofinalnewline, and section are ignored.
    disabled
    literal="on" While using the raw option will indeed include the raw content, the included content will still be processed and rendered like regular topic content. To disable parsing of the included content, set the literal option to "on". disabled
    nofinalnewline="on" Delete the new line at the end of the result if exists disabled
    newline="$br" Convert newlines in textarea to other delimiters. Variable $br expands to <br /> tag, and $n to a newline. Other text is encoded based on encode parameter. no conversion
    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
    disableremoveheaders="on" Bypass stripping headers from included HTML (everything until first </head> tag) disabled
    disableremovescript="on" Bypass stripping all <script> tags from included HTML disabled
    disableremovebody="on" Bypass stripping the </body> tag and everything around over and below it disabled
    disablecompresstags="on" Bypass replacing newlines in HTML tags with spaces. This compression step rewrites unmatched <'s into &lt; entities unless bypassed disabled
    disablerewriteurls="on" Bypass rewriting relative URLs into absolute ones disabled
    disablefixlinks="on" Bypass fixing WikiWord links if include is done across webs. Fixing links in included text such as from SomeLink to Otherweb.SomeLink is usually desirable so that links in included text still point to the same target disabled
    warn="off" Warn if topic include fails: Fail silently (if off); output default warning (if set to on); else, output specific text (use $topic for topic name) %INCLUDEWARNING% preferences setting
    section="name" Includes only the specified named section, as defined in the included topic by the STARTSECTION and ENDSECTION variables. Nothing is shown if the named section does not exists. section="" is equivalent to not specifying a section  
    PARAMONE="val 1"
    PARAMTWO="val 2"
    Any other parameter will be defined as a variable within the scope of the included topic. The example parameters on the left will result in %PARAMONE% and %PARAMTWO% being defined within the included topic. A default value for a variable can be specified in the included topic in case the corresponding parameter is not specified, such as %PARAMONE{ default="..." }%  
  • Security Considerations:
    • The ability to INCLUDE arbitrary URLs, such as %INCLUDE{"http://www.google.com/"}% is turned off by default. To turn this on, ask your TWiki administrator to enable the {INCLUDE}{AllowURLs} flag in the Security setup section of configure.
    • JavaScript in included web pages is filtered out as a security precaution per default. Disable filtering with raw or disableremovescript parameter.
  • Examples: See IncludeTopicsAndWebPages
  • Category: ApplicationsAndComponentsVariables, DevelopmentVariables, ImportVariables
  • Related: BASETOPIC, BASEWEB, INCLUDINGTOPIC, INCLUDINGWEB, STARTINCLUDE, STOPINCLUDE, STARTSECTION, ENDSECTION, TOC, IncludeTopicsAndWebPages, ParameterizedVariables (this topic)

JQENDTAB -- end a JQuery tab within a tab pane

JQENDTABPANE -- end a JQuery tab pane

JQTAB -- start a JQuery tab within a tab pane

JQTABPANE -- start a JQuery tab pane

  • Create nice looking horizontal tab panes in TWiki topics. Write a sequence of %JQTAB{"..."}% and %JQENDTAB% pairs, and enclose them in %JQTABPANE% and %JQENDTABPANE%. Tab panes can be nested, e.g. within one tab you can add another tab pane. These variable are handled by the JQueryPlugin.
  • Syntax: %JQTABPANE% %JQTAB{"Tab 1}% ... %JQENDTAB% %JQTAB{"Tab 2}% ... %JQENDTAB% ... %JQENDTABPANE%
  • Example:
    %JQTABPANE%
    %JQTAB{"Tab 1"}%
    Tab 1 content...
    %JQENDTAB%
    %JQTAB{"Tab 2"}%
    Tab 2 content...
    %JQENDTAB%
    %JQENDTABPANE%
  • Category: ApplicationsAndComponentsVariables, FormattingAndRenderingVariables
  • Related: JQENDTAB, JQENDTABPANE, JQTAB, JQueryPlugin (this topic)

SET{"name" value="..."} -- set a variable

SETGETDUMP{...} -- dump persistent variables

TWISTY{ attributes } -- dynamically open and close sections of content

VOTE{ id="..." } -- define a poll in a TWiki topic

  • The %VOTE{}% variable is handled by the VotePlugin.
  • Syntax: %VOTE{ id="..." select1="..., ..., ..." }%
  • Parameters:
    Parameter Description Example
    id The identifier of the poll. You can have multiple independent votes in the same topic. id="Dining"
    selectN Defines the name of a select vote, where you select one from a ranges of options. N is a number that identifies this item within the poll e.g. select1, select2 etc. You must number all select and stars parameters uniquely and sequentially (e.g. select1 stars2 select3 select1="Drink"
    optionsN Each selectN must have a corresponding optionsN that defines a comma-separated list of the options that can be selected between. options1="Beer,Wine,Milk"
    starsN Defines the name of a rate vote, where you rate something by giving it a number of stars. N is a number that identifies this item within the poll e.g. select1, stars2 etc. You must number all select and stars parameters uniquely and sequentially (e.g. select1 stars2 select3 stars2="Usability"
    widthN Each starsN must have a corresponding widthN. This gives the number of stars to show e.g. width1="5" will show 5 stars. width2="10"
    formatN Defines the format of the results display. See formatting results, below. format="$large"
    chartN Defines the format of a single bar in the results bar chart generated for the corresponding select (for select type only). See formatting results, below. chart="<p>$option $score</p>"
    separator Defines the string to be used to separate each row in the result. separator="<br/>"
    global If set to "off", this makes the id local to this topic (the default). If set to "on" it will be a global poll that can be accessed from many topics. global="on"
    open If set to "off" this is a closed vote. If set to "on" it is open (the default) open="on"
    secret If set to "off", then the database will record who voted. If set to "on", votes are secret (the default) secret="on"
    saveto If set to the name of a topic, the poll results will be appended to the end of that topic. The results are formatted as a TWiki table for easy post-processing. saveto="Main.VoteResults"
    bayesian If set to "on", rating averages will be computed using the Bayesian average of this item against all the other items that have the same item in their stars field. This requires all the participating %VOTEs to be global, or to save their results to the same place using saveto. See http://www.thebroth.com/blog/118/bayesian-rating for more information about Bayesian rating. bayesian="off"
    submit If set to "off", this makes the %VOTE display the results of the vote without prompting for any input. This is useful when - for example - you want to show the results of a global vote, without permitting more voting.
  • Example: %VOTE{ id="FavouriteMeal" select1="Drink" options1="Beer,Wine,Milk,Water" select2="Food" options2="Steak,Bread,Pasta,Pizza" }% shows two selectors named "Drink" and "Food", respectively, and a "Vote" button
  • Category: ApplicationsAndComponentsVariables, DatabaseAndFormsVariables
  • Related: VotePlugin (this topic)

WORKFLOW*{} -- manage workflows

  • Associate a "state" with a topic and then control the work flow that the topic progresses through as content is added. The WorkflowPlugin expands the following variables:
  • Controlling topics in the workflow:
    • %WORKATTACHTOPIC% - Expands to a link that lets you attach to the topic (if the user is not able to modify the topic, either in the workflow sense or according to the standard access controls, the link will be struck out).
    • %WORKEDITTOPIC% - Expands to a link that lets you edit the topic (if the user is not able to modify the topic, either in the workflow sense or according to the standard access controls, the link will be struck out).
    • %WORKFLOWFORK{...}% - Expands to a button that will create a copy of the current topic (see below for more details)
    • %WORKFLOWTRANSITION% - Expands to either (a) a pull-down menu if the user can perform more than one transition, (b) a button if the current user can only perform one transition, or (c) empty space if the current user is not allowed to perform any action. You can change the format of the button using a CSS class.
  • Querying the workflow:
    • %WORKFLOWHISTORY% - Expands to the history of state transitions the topic has undergone. The format of the history is dictated by the WORKFLOWHISTORYFORMAT (described below).
    • %WORKFLOWLASTREV_State% - Expands to the version number when the document was last in the state State.
    • %WORKFLOWLASTTIME_State% - Expands to the timestamp when the document was last in the State last state. For example, %WORKFLOWLASTTIME_APPROVED% would be replaced by the timestamp when the document was last in the APPROVED state.
    • %WORKFLOWLASTVERSION_State% - Expands to a link to the version of the document when it was last in the state State.
    • %WORKFLOWSTATE% - Expands to the current state of the document. It can also be given a topic parameter (default), in which case the state of that topic is returned.
    • %WORKFLOWSTATEMESSAGE% - Expands to the corresponding message in the state table.
  • Category: ApplicationsAndComponentsVariables, EditingAndContentUpdateVariables, WorkflowAndAutomationVariables
  • Related: WorkflowPlugin for details (this topic)

Total: 18 variables

Related Topics: TWikiVariables, TWikiVariablesSearch, TWikiVariablesQuickStart

Topic revision: r1 - 2012-11-11 - 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.ApplicationsAndComponentsVariables.

antalya escort bursa escort eskisehir escort istanbul escort izmir escort