2014-01-07 11:57:42 +00:00
created: 20130824154300000
2017-09-01 10:13:39 +00:00
modified: 20170901101236822
2014-09-10 23:06:19 +00:00
tags: Widgets
2013-08-24 15:45:45 +00:00
title: TiddlerWidget
2014-01-07 11:57:42 +00:00
type: text/vnd.tiddlywiki
2014-09-10 23:06:19 +00:00
caption: tiddler
2013-08-24 15:45:45 +00:00
! Introduction
2017-02-23 17:02:49 +00:00
The TiddlerWidget is used to set a value for the [[current tiddler|Current Tiddler]] variable, valid within the scope of the TiddlerWidget.
2013-08-24 15:45:45 +00:00
! Content and Attributes
|!Attribute |!Description |
2015-02-24 16:41:16 +00:00
|tiddler |The title of the tiddler to become the new [[current tiddler|Current Tiddler]] |
2014-08-02 12:39:02 +00:00
! CSS Class Variables
The tiddler widget assigns several useful CSS classes to variables that it creates:
2014-12-31 11:38:15 +00:00
; missingTiddlerClass
: `tc-tiddler-exists` or...
: `tc-tiddler-missing` depending on whether the tiddler exists
;shadowTiddlerClass
2015-01-02 17:11:37 +00:00
: `tc-tiddler-shadow` if the tiddler is a shadow tiddler
2014-12-31 11:38:15 +00:00
;systemTiddlerClass
2015-01-02 17:11:37 +00:00
:` tc-tiddler-system` if the tiddler is a system tiddler
2014-12-31 11:38:15 +00:00
;tiddlerTagClasses
2015-01-02 17:11:37 +00:00
: a space separated list of CSS classes named `tc-tagged-{tagname}`,<br>e.g. `tc-tagged-introduction`<br><br>''Note:'' tag names are URI encoded which means that the tag [[$:/tags/Macro]] appears as the CSS class `tc-tagged-%24%3A%2Ftags%2FMacro`. See [[How to apply custom styles by tag]] for more details
2014-08-02 12:39:02 +00:00
You can use these variables like this:
```
<$tiddler tiddler="MyOtherTiddler">
<div class=<<missingTiddlerClass>>>
<$transclude/>
2014-12-31 11:38:15 +00:00
</div>
2014-08-02 12:39:02 +00:00
</$tiddler>
```
See also [[$:/core/ui/ViewTemplate]].