Would appreciate help with custom search

66 views
Skip to first unread message

Magnus

unread,
Apr 15, 2020, 8:38:14 PM4/15/20
to TiddlyWiki
1)
I get an error Internal javascript error when clicking any of two radio-button (I think) if the state-tiddler $:/state/customSearch where I store the state does not exist, how can I create the state-tiddler in the radio-button if it does not exist?

2)
In the custom search I use the 

<$list filter="[rank[species]search:caption{$:/state/customSearch}contains:summer_light{$:/state/customSearch!!summer_light_search}sort[caption]">//<$link to={{!!title}}><$view field="caption"/></$link>//<br></$list>

to search for all tiddler with the field value specified in the state-tiddler, but if the state-tiddler field is empty nothing is shown, I would like to see all tiddler regardless of the value in the target-tiddlers fields, how can I go about to do that?


/Magnus

Mark S.

unread,
Apr 16, 2020, 12:46:53 AM4/16/20
to TiddlyWiki


On Wednesday, April 15, 2020 at 5:38:14 PM UTC-7, Magnus wrote:

<$list filter="[rank[species]search:caption{$:/state/customSearch}contains:summer_light{$:/state/customSearch!!summer_light_search}sort[caption]">//<$link to={{!!title}}><$view field="caption"/></$link>//<br></$list>


There's a syntax error here -- needs to end ...sort[caption]]

 
to search for all tiddler with the field value specified in the state-tiddler, but if the state-tiddler field is empty nothing is shown, I would like to see all tiddler regardless of the value in the target-tiddlers fields, how can I go about to do that?


Are you saying that if the search doesn't find anything then you want to see ALL tiddlers? You could use the ~ ELSE clause to put
a fallback filter expression that shows all tiddlers in the event that the first run doesn't match any. See:

 

Reply all
Reply to author
Forward
0 new messages