mirror of
https://github.com/Jermolene/TiddlyWiki5.git
synced 2026-01-28 15:30:47 -08:00
* Initial Commit
* Update docs
* Add support for elseif blocks
* Another test
* WIP
* Change from `{%if%}` to `<%if%>`
See discussion here - https://talk.tiddlywiki.org/t/proposed-if-widget/7882/64
* Don't use the widget body as the template if a list-empty widget is present
See discussion here - https://github.com/Jermolene/TiddlyWiki5/pull/7710#issuecomment-1717193296
* List widget should search recursively for list-template and list-empty
* Allow block mode content within an if/then/else clause
* Update docs
* Add from-version tag to docs
37 lines
No EOL
590 B
Text
37 lines
No EOL
590 B
Text
title: Conditionals/BlockMode
|
|
description: Basic conditional shortcut syntax in block mode
|
|
type: text/vnd.tiddlywiki-multiple
|
|
tags: [[$:/tags/wiki-test-spec]]
|
|
|
|
title: Output
|
|
|
|
\procedure test(animal)
|
|
<% if [<animal>match[Elephant]] %>
|
|
|
|
! It is an elephant
|
|
|
|
<% else %>
|
|
|
|
<% if [<animal>match[Giraffe]] %>
|
|
|
|
! It is a giraffe
|
|
|
|
<% else %>
|
|
|
|
! It is completely unknown
|
|
|
|
<% endif %>
|
|
|
|
<% endif %>
|
|
|
|
\end
|
|
|
|
<<test "Giraffe">>
|
|
|
|
<<test "Elephant">>
|
|
|
|
<<test "Antelope">>
|
|
+
|
|
title: ExpectedResult
|
|
|
|
<h1 class="">It is a giraffe</h1><h1 class="">It is an elephant</h1><h1 class="">It is completely unknown</h1> |