Search box

236 views
Skip to first unread message

paulgilbert2000

unread,
Jul 1, 2021, 9:47:46 PM7/1/21
to TiddlyWiki

Hi ,

I have a tiddler that has a filter that lists other tiddlers along with their details

the problem is the list is too long and big that it makes it hard to find the one particular tiddler i want to look at .

is there a way to add like a search box? where i can just enter the tiddler name and this would hide everything and display the one tiddler i entered its name

Charlie Veniot

unread,
Jul 2, 2021, 12:04:36 AM7/2/21
to TiddlyWiki
Hi,

Using TiddlyWiki.com for testing, create a new tiddler with the following content:

<$edit-text tiddler={{{ [<currentTiddler>addsuffix[ Data]] }}} field="search_value"/>

<$list variable="checkLength" filter="[<currentTiddler>addsuffix[ Data]get[search_value]length[]compare:number:gt[4]]"> //(enter at least 5 characters)//<br>
<$vars searchCriteria={{{  [<currentTiddler>addsuffix[ Data]get[search_value]]  }}}>
<$list filter="[all[tiddlers]search<searchCriteria>]">
<$link/><br>
</$list>
</$vars>
</$list>



mohamed maghrabi

unread,
Jul 2, 2021, 4:23:13 AM7/2/21
to TiddlyWiki
Thanks,

However is there a way to make the search more accurate , typing in "Hello there"   listed so many tiddlers  , i believe because it is seraching all tidder field ? if its the case could it be restrained to only searching one field, the title ?Capture10.PNG

Charlie Veniot

unread,
Jul 2, 2021, 10:11:40 AM7/2/21
to TiddlyWiki
For sure.  That's all documented here:  https://tiddlywiki.com/#search%20Operator

I much prefer the "wide open" (search all fields), so that if I can catch the tiddler I want by a selection of words I remember being wherever they happen to exist in the tiddler, so maybe a word from the title, a word from some custom field, a word from the text.

You could make the "field list" for search operator come from another edit text widget, so you have the flexibility of dynamically specifying which field(s) you want to search.



paulgilbert2000

unread,
Jul 8, 2021, 9:49:42 PM7/8/21
to TiddlyWiki
sorry to back to this again , but which part of the code does the search ? so if i would use [search:title,caption:literal,casesensitive[The first]]    like the example in the documentation , where would i put that in the code ?

Charlie Veniot

unread,
Jul 8, 2021, 10:25:55 PM7/8/21
to TiddlyWiki
G'day,

Give this a spin:

<$edit-text tiddler={{{ [<currentTiddler>addsuffix[ Data]] }}} field="search_value"/>

<$list variable="checkLength" filter="[<currentTiddler>addsuffix[ Data]get[search_value]length[]compare:number:gt[4]]"> //(enter at least 5 characters)//<br>
<$vars searchCriteria={{{  [<currentTiddler>addsuffix[ Data]get[search_value]]  }}}>
<$list filter="[search:title,caption:literal,casesensitive<searchCriteria>]">
<$link/><br>
</$list>
</$vars>
</$list>

paulgilbert2000

unread,
Jul 10, 2021, 10:15:23 PM7/10/21
to TiddlyWiki

works like a charm thank you very much :)

CJ Veniot

unread,
Jul 11, 2021, 11:19:54 AM7/11/21
to tiddl...@googlegroups.com
Good stuff.

If there are any naughty bits in there that are clear as mud and need some explaining, please reach out here.

That bit of TW code can probably be improved/condensed.  I do tend to have "wordy" solutions because I like to see the little steps involved in getting from A to Z, often ignoring much more elegant solutions (if I know of them).  There's always loads of refactoring potential in anything coming from this kid.

--
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/DbxeR4MQeIw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/be87cba3-979c-4994-bb74-0ec787493d26n%40googlegroups.com.

paulgilbert2000

unread,
Jul 12, 2021, 6:07:31 PM7/12/21
to TiddlyWiki
Hi,

no i think it was pretty understandable, its really my poor coding knowledge that makes me take a bit longer to get it :_)
Reply all
Reply to author
Forward
0 new messages