This code snippet is quite repetitive:
<ul>
<% if [all[current]has[email]] %>
<li>''Email'': {{!!email}}</li>
<% endif %>
<% if [all[current]has[phone]] %>
<li>''Phone'': {{!!phone}}</li>
<% endif %>
<% if [all[current]has[family]] %>
<li>''Family'': {{!!family}}</li>
<% endif %>
<% if [all[current]has[manager]] %>
<li>''Manager'': {{!!manager}}</li>
<% endif %>
</ul>
Write a procedure that wraps the logic that's repeated here, and call it four times to produce the same result.
Hint: To transclude a field of the current tiddler whose name is in a variable, use the $transclude
widget with the $field
parameter: <$transclude $field=<<myvariable>>/>
.
Go to answer: Ex:ConditionalProcedure/answer