The reason it doesn't work is because when you put [[MySingleWordTag]] in 
tags, TW strips off the [[ and ]], so your text no longer matches.

The following worked in my tests. It uses the filter run evaluation to 
determine if braces need to be added, only adding them if there is more 
than one word.

<$vars myfilter="[split[ ]count[]compare:integer:eq[1]]" lf="[[" rt="]]" >

<$select field='tags'>
<$list 
filter='[_object_type[location]!title<currentTiddler>!tag<currentTiddler>]'>
<option value={{{ [<currentTiddler>filter<myfilter>] 
[<currentTiddler>addprefix<lf>addsuffix<rt>]+[first[]] }}}><$view 
field='title'/></option>
</$list></$select>

</$vars>


On Sunday, December 27, 2020 at 9:10:26 AM UTC-8 [email protected] 
wrote:

> Hello all
>
> I've got a select widget set up in the body of a tiddler to choose that 
> tiddler's tag from a list of other tiddlers, in order to facilitate easy 
> moving around within a table of contents. The widget is set up as follows:
>
> *<$select field='tags'><$list 
> filter='[_object_type[location]!title<currentTiddler>!tag<currentTiddler>]'><option
>  
> value=<<linkup>>><$view field='title'/></option></$list></$select>*
>
> *_object_type* is a custom field I've set up, and "location" is one of 
> its possible values. *<<linkup>>* is seperately defined as:
>
>
> *\define linkup() [[$(currentTiddler)$]]*
>
> The linkup macro is used to make sure the tags are applied correctly for 
> tiddlers in the list with spaces in their names. 
>
> The strange issue I'm having however, is that once I choose an option in 
> the dropdown box, it only remains displayed visually in the box  *if the 
> name contains spaces*. If it does not, then the dropdown box appears to 
> be empty (though the tag is still applied correctly). 
>
> This is mostly a cosmetic issue, but one I'm curious about and would love 
> to know if anyone understands this behaviour, as ideally I'd like the box 
> to continue to display whatever has been selected.
>
> Many thanks in advance if anyone knows what's going on here.
>
> Joseph
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/5c0fd226-4480-4b04-8164-07c880c74ecfn%40googlegroups.com.

Reply via email to