1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-04 17:16:18 +00:00

Use the cascade mechanism to choose between the edit and view templates

This commit is contained in:
jeremy@jermolene.com 2021-11-05 09:20:46 +00:00
parent 52907b98f9
commit 72c77f42da
4 changed files with 15 additions and 1 deletions

View File

@ -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">

View 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>

View File

@ -0,0 +1,5 @@
title: $:/config/TiddlerTemplateFilters/
tags: $:/tags/TiddlerTemplateFilter
draft: [is[draft]then[$:/core/ui/EditTemplate]]
default: [[$:/core/ui/ViewTemplate]]

View File

@ -0,0 +1,2 @@
title: $:/tags/TiddlerTemplateFilter
list: $:/config/TiddlerTemplateFilters/draft $:/config/TiddlerTemplateFilters/default