2016-04-25 07:28:42 +00:00
caption: tm-fold-tiddler
created: 20160424232749223
2020-01-30 12:50:19 +00:00
modified: 20191028113537119
2016-04-25 07:28:42 +00:00
tags: Messages
title: WidgetMessage: tm-fold-tiddler
type: text/vnd.tiddlywiki
2020-01-30 12:50:19 +00:00
The `tm-fold-tiddler` message toggles the value of a state tiddler. It does so by setting the text of a state tiddler to either "<<.value "show">>" or "<<.value "hide">>", according to the fold state.
2016-04-25 07:28:42 +00:00
|!Name |!Description |
2020-01-30 12:50:19 +00:00
|param |ignored ... foldedState must be used |
|foldedState |State tiddler in which the fold state is stored |
2016-04-25 07:28:42 +00:00
2020-01-30 12:50:19 +00:00
<<.tip "The core uses a foldState prefix of `$:/state/folded/` + `tiddler title` to store the fold states for the default story view.">>
2016-04-25 07:28:42 +00:00
The `tm-fold-tiddler` message is usually generated with the ButtonWidget and is handled by the surrounding NavigatorWidget.
2020-01-30 12:50:19 +00:00
The core $:/core/ui/ViewTemplate defines a global variable `folded-state`, that is used with every tiddler. It's created like this:
```
\define folded-state()
$:/state/folded/$(currentTiddler)$
\end
```