1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-24 18:47:20 +00:00
TiddlyWiki5/editions/tw5.com/tiddlers/widgets/TiddlerWidget.tid
2014-08-04 13:31:52 +01:00

36 lines
1.2 KiB
Plaintext

created: 20130824154300000
modified: 20140802114152456
tags: widget
title: TiddlerWidget
type: text/vnd.tiddlywiki
! Introduction
The TiddlerWidget sets the CurrentTiddler that applies for processing its content.
! Content and Attributes
|!Attribute |!Description |
|tiddler |The title of the tiddler to become the new CurrentTiddler |
|class |CSS classes to be added to the generated elements |
! CSS Class Variables
The tiddler widget assigns several useful CSS classes to variables that it creates:
* ''missingTiddlerClass'': ''"tw-tiddler-exists"'' or ''"tw-tiddler-missing"'' depending upon whether the target tiddler exists
* ''shadowTiddlerClass'': ''"tw-tiddler-shadow"'' if the tiddler is a shadow tiddler
* ''systemTiddlerClass'': ''"tw-tiddler-system"'' if the tiddler is a system tiddler
* ''tiddlerTagClasses'': A space separated list of CSS classes named ''"tw-tagged-{tagname}"''. For example ''"tw-tagged-introduction"''. Note that tag names are UrlEncoded which means that the tag ''$:/tags/Macro'' appears as the CSS class ''"tw-tagged-%24%3A%2Ftags%2FMacro"''
You can use these variables like this:
```
<$tiddler tiddler="MyOtherTiddler">
<div class=<<missingTiddlerClass>>>
<$transclude/>
</$tiddler>
```
See also [[$:/core/ui/ViewTemplate]].