Boris Mann 7th June 2021 at 7:42am
"Items" have a "retailers" field – here I call it "stores".
The Stores tiddler has a list
field that lists the Stores. I'm also tagging them with Store
.
!! List by retailer
<$list filter="[list[Retailers]]" variable="retailer">
!!! <<retailer>>
<$list filter="[<retailer>listed[retailers]tag[Item]]" variable="item">
<$checkbox tiddler=<<item>> tag="Selected"/> <$link to=<<item>>><<item>></$link><br/>
</$list>
</$list>
Grocery Item View Template
\define checkit()
<$action-listops $field="retailers" $subfilter="[<retailer>]"/>
\end
\define uncheckit()
<$action-listops $field="retailers" $subfilter="-[<retailer>]"/>
\end
\define allactions() <$action-deletefield dummy/>
<$list filter="[all[current]tag[Item]]">
''Retailers:''<br/>
<$list filter="[list[Retailers]]" variable="retailer">
<$list filter="[all[current]contains:retailers<retailer>]" variable="dummy">
<$checkbox field="dummy" checked="yes" unchecked="no" default="yes" uncheckactions=<<uncheckit>> actions=<<allactions>>/><<retailer>><br/>
</$list>
<$list filter="[all[current]!contains:retailers<retailer>]" variable="dummy">
<$checkbox field="dummy" checked="yes" unchecked="no" default="no" checkactions=<<checkit>> actions=<<allactions>>/><<retailer>><br/>
</$list>
</$list>
</$list>
Link: https://marxsal.github.io/various/groceries.html