This is a stripped-down version of a single section of Grok TiddlyWiki, optimized for fast loading and readability by search engines. Some features are missing.

For the full Grok TiddlyWiki experience, please visit the wiki version of this page.

Ex:ConditionalProcedure/answer

 29th August 2024 at 9:28pm
\procedure contact-info-item(field)
  <% if [all[current]has<field>] %>
    <li>
      ''<<field>>'':
      <$transclude $field=<<field>>/>
    </li>
  <% endif %>
\end

!! Information about {{!!title}}

<ul>
  <<contact-info-item "email">>
  <<contact-info-item "phone">>
  <<contact-info-item "family">>
  <<contact-info-item "manager">>
</ul>

Note that the result of this snippet is slightly different than the original code in that the field names are no longer capitalized. If you're fussy about this, you can use the $text widget and the sentencecase[] operator in a filtered transclusion to upper-case the first letter of the field name:

\procedure contact-info-item(field)
  <% if [all[current]has<field>] %>
    <li>
      ''<$text text={{{ [<field>sentencecase[]] }}}/>'':
      <$transclude $field=<<field>>/>
    </li>
  <% endif %>
\end
Go to question: Ex:ConditionalProcedure