I have this code that illustrates what I'd like to do. I know I could make each data element a separate tiddler and work with them that way, but for this, I'd like to keep it all in one tiddler.
I'd like to only show fields with a certain value.
I already have a loop that iterates over the fields with a certain prefix, which gets the field names I want to check. But I don't know how to dynamically access the content/value of the field.
Basically what I want to do is show a list of the values (text in the "checked" attribute) of checked fields.
P.S. "mi" is for menu item, so that I can differentiate these fields from default or other tiddler fields.
|!Item|!Customize|!Notes|
|<$checkbox field="mi_chalupa" checked="Chalupa" unchecked="No" default="No"> Chalupa</$checkbox> |Chipotle Sauce||
|<$checkbox field="mi_tripleupa" checked="Tripelupa" unchecked="No" default="No"> Tripelupa</$checkbox> |||
|<$checkbox field="mi_nacho_fries" checked="Nacho Fries" unchecked="No" default="No"> Nacho Fries</$checkbox> |||
!! Chosen Items
<!-- This is dynamic, but
1. I can't get the field's content/value to display
2. I only want to display the content/value of the field if it is not "No", or some other string, I don't care what.
-->
<$list filter="[all[current]fields[]prefix[mi_]]" variable="x">
<$view field="<x>" /><br />
</$list>
---
<!-- This does what I want, but is not dynamic, and shows Tiddler name instead of field value -->
<$list filter="[all[current]!mi_chalupa[No]]" variable="x">
<<x>><br />
</$list>