Use Fields like Tag

I am looking for code or solutions (perhaps a filter) to use fields like tags!
There are many cases users like to use a dedicated field instead of tags.

Example:

  • There are many tiddlers have a field ingredients
  • The field ingredients stores data like title list
    • for illustration, tiddler Season Salad has ingredients field with value: salt [[lemon juice]] pepper

What I need

  • a filter to returns all tiddlers has non-empty ingredients
  • a filter to list all tiddlers have special value in the ingredients field like salt`

So can I have something equal to tags[] operator and tag macro!

I appreciate sharing any resources/solutions/suggestions in this regard.

  • a filter to returns all tiddlers has non-empty ingredients
<$list filter="[all[tiddlers]has[ingredients]]">
  • a filter to list all tiddlers have special value in the ingredients field like salt
<$list filter="[all[tiddlers]] :filter[enlist{!!ingredients}match[salt]]">

enjoy,
-e

1 Like

Thank you Eric!
Can I have a mix of these filters to list tiddlers like below? That means list sorted ingredients one by one and show tiddlers having them beneath? I assume :filter[enlist{!!ingredients}match[salt]] is faster than contains:ingredients[salt]

lemon juice

  1. tiddler one
  2. tiddler two
  3. tiddler three
  4. tiddler four

pepper

  1. tiddler xx
  2. tiddler two
  3. tiddler three

salt

  1. tiddler xx
  2. tiddler two

Hi!
Jed made a generic tags Plugin which does what you want:
https://ooktech.com/jed/ExampleWikis/GenericTagFields/

1 Like