2023-10-14 08:41:21 +00:00
|
|
|
title: Conditionals/NestedElseif
|
|
|
|
description: Nested elseif conditional shortcut syntax
|
|
|
|
type: text/vnd.tiddlywiki-multiple
|
|
|
|
tags: [[$:/tags/wiki-test-spec]]
|
|
|
|
|
|
|
|
title: Text
|
|
|
|
|
|
|
|
\whitespace trim
|
|
|
|
This is a 
|
2024-09-02 15:51:15 +00:00
|
|
|
<%if [<something>match[one]] %>
|
|
|
|
<%if [<another>match[one]] %>
|
2023-10-14 08:41:21 +00:00
|
|
|
Indian
|
2024-09-02 15:51:15 +00:00
|
|
|
<%elseif [<another>match[two]] %>
|
2023-10-14 08:41:21 +00:00
|
|
|
African
|
2024-09-02 15:51:15 +00:00
|
|
|
<%else%>
|
2023-10-14 08:41:21 +00:00
|
|
|
Unknown
|
2024-09-02 15:51:15 +00:00
|
|
|
<%endif%>
|
2023-10-14 08:41:21 +00:00
|
|
|
 Elephant
|
2024-09-02 15:51:15 +00:00
|
|
|
<%elseif [<something>match[two]] %>
|
2023-10-14 08:41:21 +00:00
|
|
|
Antelope
|
2024-09-02 15:51:15 +00:00
|
|
|
<%else%>
|
2023-10-14 08:41:21 +00:00
|
|
|
Crocodile
|
2024-09-02 15:51:15 +00:00
|
|
|
<%endif%>
|
2023-10-14 08:41:21 +00:00
|
|
|
, I think.
|
|
|
|
+
|
|
|
|
title: Output
|
|
|
|
|
|
|
|
<$let something="one" another="one">
|
|
|
|
{{Text}}
|
|
|
|
</$let>
|
|
|
|
|
|
|
|
<$let something="one" another="two">
|
|
|
|
{{Text}}
|
|
|
|
</$let>
|
|
|
|
|
|
|
|
<$let something="one" another="three">
|
|
|
|
{{Text}}
|
|
|
|
</$let>
|
|
|
|
|
|
|
|
<$let something="two">
|
|
|
|
{{Text}}
|
|
|
|
</$let>
|
|
|
|
|
|
|
|
<$let something="three">
|
|
|
|
{{Text}}
|
|
|
|
</$let>
|
|
|
|
+
|
|
|
|
title: ExpectedResult
|
|
|
|
|
|
|
|
<p>
|
|
|
|
This is a Indian Elephant, I think.
|
|
|
|
</p><p>
|
|
|
|
This is a African Elephant, I think.
|
|
|
|
</p><p>
|
|
|
|
This is a Unknown Elephant, I think.
|
|
|
|
</p><p>
|
|
|
|
This is a Antelope, I think.
|
|
|
|
</p><p>
|
|
|
|
This is a Crocodile, I think.
|
|
|
|
</p>
|