1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-30 05:19:57 +00:00
TiddlyWiki5/core/ui/LayoutSwitcher.tid
jeremy@jermolene.com 34643a4279 Add icon to default page layout and show in switcher
Thanks @linonetwo

Fixes #7197
2023-01-16 13:21:40 +00:00

30 lines
1.1 KiB
Plaintext

title: $:/snippets/LayoutSwitcher
tags: $:/tags/ControlPanel/Appearance
caption: {{$:/language/ControlPanel/LayoutSwitcher/Caption}}
\whitespace trim
<$linkcatcher to="$:/layout">
<div class="tc-chooser">
<$list filter="[all[tiddlers+shadows]tag[$:/tags/Layout]] [[$:/core/ui/PageTemplate]] +[!is[draft]sort[name]]">
<$list
filter="[{$:/layout}!has[text]]"
variable="ignore"
emptyMessage="""\whitespace trim
<$set name="cls" filter="[all[current]field:title{$:/layout}]" value="tc-chooser-item tc-chosen" emptyValue="tc-chooser-item">
<div class=<<cls>>>
<$link to={{!!title}}>
''<$transclude tiddler={{{ [<currentTiddler>get[icon]] }}}/><$transclude field="name"/>''&#32;-&#32;<$transclude field="description"/>
</$link></div></$set>
""">
<$set name="cls" filter="[all[current]field:title[$:/core/ui/PageTemplate]]" value="tc-chooser-item tc-chosen" emptyValue="tc-chooser-item">
<div class=<<cls>>>
<$link to={{!!title}}>
''<$transclude tiddler={{{ [<currentTiddler>get[icon]] }}}/><$transclude field="name"/>''&#32;-&#32;<$transclude field="description"/>
</$link>
</div>
</$set>
</$list>
</$list>
</div>
</$linkcatcher>