mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-12-26 10:00:34 +00:00
46 lines
1.8 KiB
Plaintext
46 lines
1.8 KiB
Plaintext
title: ViewWidget
|
|
created: 201310241419
|
|
modified: 20141022131222150
|
|
tags: Widgets
|
|
caption: view
|
|
|
|
! 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.
|
|
|
|
|!Attribute |!Description |
|
|
|tiddler |The title of the tiddler (defaults to the CurrentTiddler) |
|
|
|field |The name of the field to view (defaults to "text") |
|
|
|index |The name of the index to view |
|
|
|format |The format for displaying the field (see below) |
|
|
|template |The optional template used with certain formats |
|
|
|subtiddler |Optional SubTiddler title when the target tiddler is a [[plugin|Plugins]] (see below) |
|
|
|
|
!! Formats
|
|
|
|
The following formats can be specified in the `format` attribute:
|
|
|
|
|!Format |!Description |
|
|
|''text'' |Plain text |
|
|
|''htmlwikified'' |The field is wikified and the resulting HTML returned as plain text |
|
|
|''htmlencoded'' |The field is displayed with HTML encoding issues |
|
|
|''date'' |The field is interpreted as a UTC date and displayed according to the DateFormat specified in the `template` attribute |
|
|
|''relativedate'' |The field is interpreted as a UTC date and displayed as the interval from the present instant |
|
|
|''stripcomments'' |The field is interpreted as JavaScript source code and any lines beginning `\\#` are stripped |
|
|
|''jsencoded'' |The field is displayed as a JavaScript encoded string |
|
|
|
|
! SubTiddler Access
|
|
|
|
The view widget allows access to the individual tiddlers stored within a [[plugin|Plugins]].
|
|
|
|
The following example will view the core version of the tiddler [[$:/DefaultTiddlers]] even if it has been overridden:
|
|
|
|
<<wikitext-example-without-html '
|
|
<$view tiddler="$:/core" subtiddler="$:/DefaultTiddlers"/>
|
|
|
|
'>>
|