mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-28 12:29:56 +00:00
b5360db375
Ref [discussion](https://groups.google.com/d/msg/tiddlywiki/S-DliskYksE/55c6_CssCgAJ).
43 lines
1.4 KiB
Plaintext
43 lines
1.4 KiB
Plaintext
created: 20130824154300000
|
|
modified: 20150220162134000
|
|
tags: Widgets
|
|
title: TiddlerWidget
|
|
type: text/vnd.tiddlywiki
|
|
caption: tiddler
|
|
|
|
! Introduction
|
|
|
|
The TiddlerWidget is used to set a value for the [[current tiddler|Current Tiddler]] variable, valid within the scope of the TiddlerWidget.
|
|
|
|
! Content and Attributes
|
|
|
|
|!Attribute |!Description |
|
|
|tiddler |The title of the tiddler to become the new [[current tiddler|Current Tiddler]] |
|
|
|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
|
|
: `tc-tiddler-exists` or...
|
|
: `tc-tiddler-missing` depending on whether the tiddler exists
|
|
;shadowTiddlerClass
|
|
: `tc-tiddler-shadow` if the tiddler is a shadow tiddler
|
|
;systemTiddlerClass
|
|
:` tc-tiddler-system` if the tiddler is a system tiddler
|
|
;tiddlerTagClasses
|
|
: 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
|
|
|
|
You can use these variables like this:
|
|
|
|
```
|
|
<$tiddler tiddler="MyOtherTiddler">
|
|
<div class=<<missingTiddlerClass>>>
|
|
<$transclude/>
|
|
</div>
|
|
</$tiddler>
|
|
```
|
|
|
|
See also [[$:/core/ui/ViewTemplate]].
|