Why the conditional shortcut syntax is not working in my procedure

\procedure dyn-tbl-category-list-test(tbl_column_mode)
<$let 
tbl-column-mode={{{ [<currentTiddler>get[tbl-column-mode-value]] ~[<tbl_column_mode>] }}}
>
<%if [<currentTiddler>tbl-column-mode[view]] %>
<$transclude $variable="dyn-tbl-subcategory-show-field" tid=tests fieldname=one />
<%elseif [<currentTiddler>tbl-column-mode[edit]] %>
<$edit-text class="tc-max-width" tiddler=tests field=one tag="input"/>
<%endif%>
</$let>
\end

This is only a demo procedure I have created to show the problem I am facing. Actual issue occurs within a large chunk of code - I didn’t post the actual code since it will make it difficult for others to help me.

The procedure call is seen in this tiddler - My TiddlyWiki — a non-linear personal web notebook

Procedure code is here - My TiddlyWiki — a non-linear personal web notebook

<%if [<currentTiddler>tbl-column-mode[view]] %>

means:
"if the currentTiddler has a field named tbl-column-mode that contains a value of view"

However, perhaps what you meant to say is:
"if the variable named tbl-column-mode has a value equal to view

which should be written this way:

<%if [<tbl-column-mode>match[view]] %>

hope this helps…

-e

1 Like

Thank you @EricShulman That solved the issue. I am wondering why I didn’t think of that.