mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-23 10:07:19 +00:00
Update the ViewTemplate to be driven by tag
Now the ViewTemplate just renders the current tiddler through each template tagged `$:/tags/ViewTemplate`. This allows plugins (and users) to add/remove elements from the ViewTemplate easily, without overwriting the ViewTemplate itself. (For @giffmex)
This commit is contained in:
parent
8cbb98d44d
commit
daf439121b
@ -1,21 +1,5 @@
|
||||
title: $:/core/ui/ViewTemplate
|
||||
modifier: JeremyRuston
|
||||
|
||||
<div class="tw-tiddler-view"><div class="tw-tiddler-title"><div class="title"><$setstyle name="fill" value={{!!color}}><span class="tw-tiddler-controls"><$button popup="$:/state/tiddlerInfo" qualifyTiddlerTitles="yes" class="btn-invisible">{{$:/core/images/info-button}}</$button><$button message="tw-edit-tiddler" class="btn-invisible">{{$:/core/images/edit-button}}</$button><$button message="tw-close-tiddler" class="btn-invisible">{{$:/core/images/close-button}}</$button>
|
||||
|
||||
</span><$transclude target={{!!icon}}/> <$view field="title"/></$setstyle></div>
|
||||
|
||||
<$reveal type="nomatch" text="" default="" state="$:/state/tiddlerInfo" qualifyTiddlerTitles="yes" class="tw-tiddler-info" animate="yes">
|
||||
|
||||
<$transclude template="$:/core/ui/TiddlerInfo"/>
|
||||
|
||||
</$reveal></div>
|
||||
|
||||
<div class="tw-subtitle"><$view field="modifier" format="link"/> <$view field="modified" format="relativedate"/></div>
|
||||
|
||||
<div class="tw-tags-wrapper"><$list filter="[is[current]tags[]]" template="$:/core/ui/TagTemplate" listview="pop" itemClass="tw-tag-list-item"/></div>
|
||||
|
||||
<div class="body">
|
||||
<$view field="text" format="wikified">
|
||||
</$view>
|
||||
</div></div>
|
||||
<div class="tw-tiddler-view"><$list filter="[is[shadow]!has[draft.of]tag[$:/tags/ViewTemplate]] [!is[shadow]!has[draft.of]tag[$:/tags/ViewTemplate]]" hackTemplate=true/>
|
||||
</div>
|
||||
|
6
core/ui/ViewTemplate/body.tid
Normal file
6
core/ui/ViewTemplate/body.tid
Normal file
@ -0,0 +1,6 @@
|
||||
title: $:/core/ui/ViewTemplate/body
|
||||
tags: $:/tags/ViewTemplate
|
||||
|
||||
<div class="body">
|
||||
<$view field="text" format="wikified"/>
|
||||
</div>
|
4
core/ui/ViewTemplate/subtitle.tid
Normal file
4
core/ui/ViewTemplate/subtitle.tid
Normal file
@ -0,0 +1,4 @@
|
||||
title: $:/core/ui/ViewTemplate/subtitle
|
||||
tags: $:/tags/ViewTemplate
|
||||
|
||||
<div class="tw-subtitle"><$view field="modifier" format="link"/> <$view field="modified" format="relativedate"/></div>
|
4
core/ui/ViewTemplate/tags.tid
Normal file
4
core/ui/ViewTemplate/tags.tid
Normal file
@ -0,0 +1,4 @@
|
||||
title: $:/core/ui/ViewTemplate/tags
|
||||
tags: $:/tags/ViewTemplate
|
||||
|
||||
<div class="tw-tags-wrapper"><$list filter="[is[current]tags[]]" template="$:/core/ui/TagTemplate" listview="pop" itemClass="tw-tag-list-item"/></div>
|
12
core/ui/ViewTemplate/title.tid
Normal file
12
core/ui/ViewTemplate/title.tid
Normal file
@ -0,0 +1,12 @@
|
||||
title: $:/core/ui/ViewTemplate/title
|
||||
tags: $:/tags/ViewTemplate
|
||||
|
||||
<div class="tw-tiddler-title"><div class="title"><$setstyle name="fill" value={{!!color}}><span class="tw-tiddler-controls"><$button popup="$:/state/tiddlerInfo" qualifyTiddlerTitles="yes" class="btn-invisible">{{$:/core/images/info-button}}</$button><$button message="tw-edit-tiddler" class="btn-invisible">{{$:/core/images/edit-button}}</$button><$button message="tw-close-tiddler" class="btn-invisible">{{$:/core/images/close-button}}</$button>
|
||||
|
||||
</span><$transclude target={{!!icon}}/> <$view field="title"/></$setstyle></div>
|
||||
|
||||
<$reveal type="nomatch" text="" default="" state="$:/state/tiddlerInfo" qualifyTiddlerTitles="yes" class="tw-tiddler-info" animate="yes">
|
||||
|
||||
<$transclude template="$:/core/ui/TiddlerInfo"/>
|
||||
|
||||
</$reveal></div>
|
2
core/wiki/tags/ViewTemplate.tid
Normal file
2
core/wiki/tags/ViewTemplate.tid
Normal file
@ -0,0 +1,2 @@
|
||||
title: $:/tags/ViewTemplate
|
||||
list: [[$:/core/ui/ViewTemplate/title]] [[$:/core/ui/ViewTemplate/subtitle]] [[$:/core/ui/ViewTemplate/tags]] [[$:/core/ui/ViewTemplate/body]]
|
Loading…
Reference in New Issue
Block a user