Hack: Condition to check that tiddler is missing, not exists (works with qualified titles too, good for state tiddlers)

60 views
Skip to first unread message

bimlas

unread,
Nov 2, 2018, 11:04:27 AM11/2/18
to TiddlyWiki
The sidebar of my wiki contains a list of tags that can be filtered through the search bar. The problem is that the tag list is refreshed after typing each character in the search bar, which is slow (it shows up to 200 tags). To make it work quicker, I've written a condition that looks at whether the search bar bar is visible: if so, it hides the tag list so it does not have to update it.

<$list filter="[prefix[$:/state/popup/search-dropdown]] [[The other is not exists]] +[first[]!is[system]]">

Because of `!is[system]`, the state tiddler will never be on the output, only the other title if it's the first (if the state tiddler exists, then the other title is in the second position).

The filter works with qualified titles, so it can be used with any state tiddler.


bimlas

unread,
Nov 2, 2018, 11:13:00 AM11/2/18
to TiddlyWiki
Sorry, I copied only the half of the example:

<$list filter="[prefix[$:/state/popup/search-dropdown]] [[The other is not exists]] +[first[]!is[system]]">
Search dropdown is not shown
</$list>

Reply all
Reply to author
Forward
0 new messages