mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-17 15:24:50 +00:00
Use the cascade mechanism to choose between the edit and view templates
This commit is contained in:
parent
52907b98f9
commit
72c77f42da
@ -14,7 +14,7 @@ tags: $:/tags/PageTemplate
|
||||
|
||||
</section>
|
||||
|
||||
<$list filter="[list[$:/StoryList]]" history="$:/HistoryList" template={{$:/config/ui/ViewTemplate}} editTemplate={{$:/config/ui/EditTemplate}} storyview={{$:/view}} emptyMessage={{$:/config/EmptyStoryMessage}}/>
|
||||
<$list filter="[list[$:/StoryList]]" history="$:/HistoryList" template="$:/core/ui/TiddlerTemplate" storyview={{$:/view}} emptyMessage={{$:/config/EmptyStoryMessage}}/>
|
||||
|
||||
<section class="story-frontdrop">
|
||||
|
||||
|
7
core/ui/TiddlerTemplate.tid
Normal file
7
core/ui/TiddlerTemplate.tid
Normal file
@ -0,0 +1,7 @@
|
||||
title: $:/core/ui/TiddlerTemplate
|
||||
|
||||
<$let template={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerTemplateFilter]get[text]] }}}>
|
||||
|
||||
<$transclude tiddler={{{ [<template>!is[blank]] ~[[$:/core/ui/ViewTemplate]] }}}/>
|
||||
|
||||
</$let>
|
5
core/wiki/config/TiddlerTemplateFilters.multids
Normal file
5
core/wiki/config/TiddlerTemplateFilters.multids
Normal file
@ -0,0 +1,5 @@
|
||||
title: $:/config/TiddlerTemplateFilters/
|
||||
tags: $:/tags/TiddlerTemplateFilter
|
||||
|
||||
draft: [is[draft]then[$:/core/ui/EditTemplate]]
|
||||
default: [[$:/core/ui/ViewTemplate]]
|
2
core/wiki/tags/TiddlerTemplateFilter.tid
Normal file
2
core/wiki/tags/TiddlerTemplateFilter.tid
Normal file
@ -0,0 +1,2 @@
|
||||
title: $:/tags/TiddlerTemplateFilter
|
||||
list: $:/config/TiddlerTemplateFilters/draft $:/config/TiddlerTemplateFilters/default
|
Loading…
Reference in New Issue
Block a user