This page is part of a static HTML representation of the TiddlyWiki at https://tiddlywiki.com/

ViewWidget

24th August 2017 at 8:55pm
Widgets

Introduction

The view widget displays the contents of a tiddler field in a specified format.

Content and Attributes

The content of the <$view> widget is displayed if the field or property is missing or empty.

AttributeDescription
tiddlerThe title of the tiddler (defaults to the current tiddler)
fieldThe name of the field to view (defaults to "text")
indexThe name of the index to view
formatThe format for displaying the field (see below)
templateOptional template string used with certain formats such as dates
subtiddlerOptional SubTiddler title when the target tiddler is a plugin (see below)
mode New in 5.1.15 Optional transclusion parsing mode for wikified formats. May be "inline" or "block" (the default)

Formats

The following formats can be specified in the format attribute:

FormatDescription
textPlain text
htmlencodedThe field is displayed with HTML encoding
urlencodedThe field is displayed with URL encoding
doubleurlencodedThe field is displayed with double URL encoding
htmlwikifiedThe field is wikified according to the mode attribute and the resulting HTML returned as plain text (ie HTML elements will appear in plain text)
plainwikifiedThe field is wikified according to the mode attribute and the text content of the resulting HTML returned as plain text (ie HTML elements will be removed)
htmlencodedplainwikifiedThe field is wikified according to the mode attribute and the text content of the resulting HTML returned as HTML encoded plain text (ie HTML elements will be removed)
dateThe field is interpreted as a UTC date and displayed according to the DateFormat specified in the template attribute
relativedateThe field is interpreted as a UTC date and displayed as the interval from the present instant
stripcommentsThe field is interpreted as JavaScript source code and any lines beginning \\# are stripped
jsencodedThe field is displayed as a JavaScript encoded string

SubTiddler Access

The view widget allows access to the individual tiddlers stored within a plugin.

The following example will view the core version of the tiddler $:/DefaultTiddlers even if it has been overridden:


<$view tiddler="$:/core" subtiddler="$:/DefaultTiddlers"/>

That renders as:

GettingStarted