Search in Sidebar not working for tagged Tiddler

I tagged the Tiddler with $:/tags/SideBar → search in Sidebar not working anymore.

What is missing / what is wrong?

Thanks for feedback.

Hello @StS ,

which tiddler did you tag with $:/tags/SideBar ?

Best wishes,
Simon

Ah - okay I think now I understand…

The search that works on the left side doesn’t work when it’s in the sidebar

Do you have some custom code for the search field?

Best,
Simon

Your code refers to a selection field in the current tiddler. This works fine when the code is rendered in a tiddler in the StoryRiver. However, when rendered in the SideBar, there is NO currentTiddler definition, so the input and subsequent references to it don’t work.

One way to fix this is to store the input in a $:/temp tiddler, so that the code doesn’t depend upon the value of “currentTiddler”, like this:

<$edit-text $tiddler="$:/temp/selection" placeholder=Suche... /> 
<$let selection={{$:/temp/selection}}>
...

There is something wrong:

<span style="color: rgb(144,238,144)">Stefan/</span>
<$edit-text $tiddler="$:/temp/selection" placeholder=Suche... /> 
<$let selection={{$:/temp/selection}}>

<$set name="selection" value={{!!selection}}>

<span style="font-size: 0.85em">

<$list filter="[!is[system]sort[caption]prefix[Stefan/]search:title,caption<selection>]">
   <li><$link/></li>
</$list>

Try this:

<span style="color: rgb(144,238,144)">Stefan/</span>
<$edit-text tiddler="$:/temp/selection" tag="input" placeholder=Suche... /> 
<span style="font-size: 0.85em">
<$list filter="[!is[system]sort[caption]prefix[Stefan/]search:title,caption{$:/temp/selection}]">
   <li><$link/></li>
</$list>

Notes:

  • In the $edit-text widget, the tiddler parameter should NOT start with $. Also, add tag="input" parameter (otherwise the widget defaults to showing a multi-line text area)
  • Completely omit the $let and $set widgets, and just refer to {$:/temp/selection} directly as the operand for the search:... filter operator.

Thanks @EricShulman for the fast replay and solution - works great! :+1:

Note that you can also simplify the filter, like this:

<$list filter="[prefix[Stefan/]search:title,caption{$:/temp/selection}sort[caption]]">
   <li><$link/></li>
</$list>

Notes:

  • Since you are restricting the tiddler titles to prefix[Stefan/], there is no need to use !is[system]
  • For better performance, apply the sort[caption] operator last so it sort only on items that match the prefix and search operators

Good hint - I learned a lot :slight_smile:
Thanks!