[tw5] Re: Filter display of Dictionary List items based on tiddler's field??
I'll think about that. Sometimes I may want to select and copy the text. I'll have to think of which I want to do more. Thanks!! On Tuesday, May 24, 2022 at 12:27:54 PM UTC-4 Eric Shulman wrote: > One final tweak to the code: > instead of: > ``` > <$checkbox index=<> checked="1" unchecked="0"/> <> > ``` > I suggest putting the item text within the body of the $checkbox widget, > like this: > ``` > <$checkbox index=<> checked="1" unchecked="0"> <> > > ``` > This allows you to click on the item text to toggle the checkbox. > > -e > On Tuesday, May 24, 2022 at 9:12:15 AM UTC-7 David wrote: > >> Thanks! >> >> That is perfect!. I think I have several other pages that can enjoy this >> kind of feature, as well. >> >> On Tuesday, May 24, 2022 at 8:38:12 AM UTC-4 Eric Shulman wrote: >> >>> On Tuesday, May 24, 2022 at 4:36:35 AM UTC-7 David wrote: >>> ``` <$list filter="[indexes[]search:title:literal[Vegas]sort[]]" variable=item> ``` >>> But it seems your code snippet is not working with the variable/field in there. It works fine when I put some static text there, though, as seen in my line above. >>> >>> The problem is due to the surrounding `<$tiddler tiddler="Dictionary >>> Tiddler">... ` widget. >>> Because of this, the reference to `{!!searchText}` is looking in >>> "Dictionary Tiddler" for the field contents. >>> One way around this is to remove the `$tiddler` widget and hard-code the >>> "Dictionary Tiddler" title, like this: >>> ``` >>> <$list filter="[[Dictionary >>> Tiddler]indexes[]search:title:literal{!!searchText}sort[]]" variable=item> >>> <$checkbox tiddler="Dictionary Tiddler" index=<> checked="1" >>> unchecked="0"/> >>> <> >>> >>> ``` >>> This allows the `{!!searchText}` reference to point to a field in the >>> tiddler containing the `<$list>` widget, rather than the "Dictionary >>> Tiddler" itself. >>> >>> However... if the intention is to eventually enable lookups using >>> different Dictionary Tiddlers, then the following code may be more useful: >>> ``` >>> <$edit-text field="searchText"/> >>> <$select field="dictionary"> >>>Dictionary Tiddler >>>Another Dictionary >>>Some Other Dictionary >>>etc... >>> >>> >>> <$let searchText={{!!searchText}}> >>> <$tiddler tiddler={{!!dictionary}}> >>> <$list >>> filter="[all[current]indexes[]search:title:literalsort[]]" >>> variable=item> >>> >>> <$checkbox index=<> checked="1" unchecked="0"/> >>> <> >>> >>> >>> >>> ``` >>> Basically, this sets a variable to the value of the searchText field >>> before using `$tiddler` to change the current tiddler, >>> and then uses the value of that variable in the filter syntax. It also >>> lets you select a dictionary tiddler title from a >>> droplist input, and then uses that title in the `$tiddler` widget, so >>> that the lookup points to another dictionary while >>> still using the searchText input from the current tiddler. >>> >>> enjoy, >>> -e >>> >> -- You received this message because you are subscribed to the Google Groups "TiddlyWiki" group. To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/a6e41a9b-8423-4b69-93d6-da535e3bfc3bn%40googlegroups.com.
[tw5] Re: Filter display of Dictionary List items based on tiddler's field??
One final tweak to the code: instead of: ``` <$checkbox index=<> checked="1" unchecked="0"/> <> ``` I suggest putting the item text within the body of the $checkbox widget, like this: ``` <$checkbox index=<> checked="1" unchecked="0"> <> ``` This allows you to click on the item text to toggle the checkbox. -e On Tuesday, May 24, 2022 at 9:12:15 AM UTC-7 David wrote: > Thanks! > > That is perfect!. I think I have several other pages that can enjoy this > kind of feature, as well. > > On Tuesday, May 24, 2022 at 8:38:12 AM UTC-4 Eric Shulman wrote: > >> On Tuesday, May 24, 2022 at 4:36:35 AM UTC-7 David wrote: >> >>> ``` >>> <$list >>> filter="[indexes[]search:title:literal[Vegas]sort[]]" >>> variable=item> >>> ``` >>> >> But it seems your code snippet is not working with the variable/field in >>> there. It works fine when I put some static text there, though, as seen in >>> my line above. >>> >> >> The problem is due to the surrounding `<$tiddler tiddler="Dictionary >> Tiddler">... ` widget. >> Because of this, the reference to `{!!searchText}` is looking in >> "Dictionary Tiddler" for the field contents. >> One way around this is to remove the `$tiddler` widget and hard-code the >> "Dictionary Tiddler" title, like this: >> ``` >> <$list filter="[[Dictionary >> Tiddler]indexes[]search:title:literal{!!searchText}sort[]]" variable=item> >> <$checkbox tiddler="Dictionary Tiddler" index=<> checked="1" >> unchecked="0"/> >> <> >> >> ``` >> This allows the `{!!searchText}` reference to point to a field in the >> tiddler containing the `<$list>` widget, rather than the "Dictionary >> Tiddler" itself. >> >> However... if the intention is to eventually enable lookups using >> different Dictionary Tiddlers, then the following code may be more useful: >> ``` >> <$edit-text field="searchText"/> >> <$select field="dictionary"> >>Dictionary Tiddler >>Another Dictionary >>Some Other Dictionary >>etc... >> >> >> <$let searchText={{!!searchText}}> >> <$tiddler tiddler={{!!dictionary}}> >> <$list >> filter="[all[current]indexes[]search:title:literalsort[]]" >> variable=item> >> >> <$checkbox index=<> checked="1" unchecked="0"/> >> <> >> >> >> >> ``` >> Basically, this sets a variable to the value of the searchText field >> before using `$tiddler` to change the current tiddler, >> and then uses the value of that variable in the filter syntax. It also >> lets you select a dictionary tiddler title from a >> droplist input, and then uses that title in the `$tiddler` widget, so >> that the lookup points to another dictionary while >> still using the searchText input from the current tiddler. >> >> enjoy, >> -e >> > -- You received this message because you are subscribed to the Google Groups "TiddlyWiki" group. To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/b573c5d5-0049-4964-b267-8b4e4f5d46e7n%40googlegroups.com.
[tw5] Re: Filter display of Dictionary List items based on tiddler's field??
Thanks! That is perfect!. I think I have several other pages that can enjoy this kind of feature, as well. On Tuesday, May 24, 2022 at 8:38:12 AM UTC-4 Eric Shulman wrote: > On Tuesday, May 24, 2022 at 4:36:35 AM UTC-7 David wrote: > >> ``` >> <$list >> filter="[indexes[]search:title:literal[Vegas]sort[]]" >> variable=item> >> ``` >> > But it seems your code snippet is not working with the variable/field in >> there. It works fine when I put some static text there, though, as seen in >> my line above. >> > > The problem is due to the surrounding `<$tiddler tiddler="Dictionary > Tiddler">... ` widget. > Because of this, the reference to `{!!searchText}` is looking in > "Dictionary Tiddler" for the field contents. > One way around this is to remove the `$tiddler` widget and hard-code the > "Dictionary Tiddler" title, like this: > ``` > <$list filter="[[Dictionary > Tiddler]indexes[]search:title:literal{!!searchText}sort[]]" variable=item> > <$checkbox tiddler="Dictionary Tiddler" index=<> checked="1" > unchecked="0"/> > <> > > ``` > This allows the `{!!searchText}` reference to point to a field in the > tiddler containing the `<$list>` widget, rather than the "Dictionary > Tiddler" itself. > > However... if the intention is to eventually enable lookups using > different Dictionary Tiddlers, then the following code may be more useful: > ``` > <$edit-text field="searchText"/> > <$select field="dictionary"> >Dictionary Tiddler >Another Dictionary >Some Other Dictionary >etc... > > > <$let searchText={{!!searchText}}> > <$tiddler tiddler={{!!dictionary}}> > <$list > filter="[all[current]indexes[]search:title:literalsort[]]" > variable=item> > > <$checkbox index=<> checked="1" unchecked="0"/> > <> > > > > ``` > Basically, this sets a variable to the value of the searchText field > before using `$tiddler` to change the current tiddler, > and then uses the value of that variable in the filter syntax. It also > lets you select a dictionary tiddler title from a > droplist input, and then uses that title in the `$tiddler` widget, so that > the lookup points to another dictionary while > still using the searchText input from the current tiddler. > > enjoy, > -e > -- You received this message because you are subscribed to the Google Groups "TiddlyWiki" group. To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/61995960-bea2-48a3-a12e-be205e5e424en%40googlegroups.com.
[tw5] Re: Filter display of Dictionary List items based on tiddler's field??
On Tuesday, May 24, 2022 at 4:36:35 AM UTC-7 David wrote: > ``` > <$list > filter="[indexes[]search:title:literal[Vegas]sort[]]" > variable=item> > ``` > But it seems your code snippet is not working with the variable/field in > there. It works fine when I put some static text there, though, as seen in > my line above. > The problem is due to the surrounding `<$tiddler tiddler="Dictionary Tiddler">... ` widget. Because of this, the reference to `{!!searchText}` is looking in "Dictionary Tiddler" for the field contents. One way around this is to remove the `$tiddler` widget and hard-code the "Dictionary Tiddler" title, like this: ``` <$list filter="[[Dictionary Tiddler]indexes[]search:title:literal{!!searchText}sort[]]" variable=item> <$checkbox tiddler="Dictionary Tiddler" index=<> checked="1" unchecked="0"/> <> ``` This allows the `{!!searchText}` reference to point to a field in the tiddler containing the `<$list>` widget, rather than the "Dictionary Tiddler" itself. However... if the intention is to eventually enable lookups using different Dictionary Tiddlers, then the following code may be more useful: ``` <$edit-text field="searchText"/> <$select field="dictionary"> Dictionary Tiddler Another Dictionary Some Other Dictionary etc... <$let searchText={{!!searchText}}> <$tiddler tiddler={{!!dictionary}}> <$list filter="[all[current]indexes[]search:title:literalsort[]]" variable=item> <$checkbox index=<> checked="1" unchecked="0"/> <> ``` Basically, this sets a variable to the value of the searchText field before using `$tiddler` to change the current tiddler, and then uses the value of that variable in the filter syntax. It also lets you select a dictionary tiddler title from a droplist input, and then uses that title in the `$tiddler` widget, so that the lookup points to another dictionary while still using the searchText input from the current tiddler. enjoy, -e -- You received this message because you are subscribed to the Google Groups "TiddlyWiki" group. To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/f819aafb-7fc8-452a-ab9c-26b8ca5b7e29n%40googlegroups.com.
[tw5] Re: Filter display of Dictionary List items based on tiddler's field??
``` <$list filter="[indexes[]search:title:literal[Vegas]sort[]]" variable=item> ``` Thanks for replying. I'll note that other forum for future questions. But it seems your code snippet is not working with the variable/field in there. It works fine when I put some static text there, though, as seen in my line above. On Monday, May 23, 2022 at 9:34:47 PM UTC-4 Eric Shulman wrote: > On Monday, May 23, 2022 at 6:04:21 PM UTC-7 David wrote: > ``` > <$list filter="[all[current]indexes[]containssort[]]" > variable=item> > ``` > > `contains>` is incorrect for two reasons: > > * The field reference `!!searchText` should enclosed with curly braces: > `{!!searchText}`, not angle brackets. Remember: the delimiters around > filter operands correspond to the type of operand: square brackets are for > literal text, angle brackets are for variable names, curly braces are for > tiddler field references. > * The `contains` operator is used to search within items of a list field. > To search the items in the current filter input, use the `search:title` > operator. Note that, although the input items are actually indexes, for > the purposes of the `search` operator, they are handled as a list of > "titles". > * Also note that, while `all[current]` is valid usage here, you could use > `` instead. There's no semantic difference, but > `` is *slightly* more efficient than `all[current]`, since > it doesn't have to parse the "current" operand to retrieve the tiddler > title. > > Thus, your filter should be: > ``` > <$list > filter="[indexes[]search:title:literal{!!searchText}sort[]]" > variable=item> > ``` > > enjoy, > -e > > P.S. I recommend visiting https://talk.tiddlywiki.org/ for a more active > group in which to ask questions. > -- You received this message because you are subscribed to the Google Groups "TiddlyWiki" group. To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/b6b88911-c2d3-4a18-baff-9b25897d63a7n%40googlegroups.com.