Thanks Mark

I've applied your code as written but i'm still getting the same behaviour. 
Frustratingly, I can see what your trying to do, so I can't get my head 
around why it isn't working.....




On Sunday, 27 December 2020 at 19:28:47 UTC Mark S. wrote:

> 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/b7f51320-73da-48a4-953a-67e2ecf134a8n%40googlegroups.com.

Reply via email to