Eric,
Thanks for that. I also made the mistake of using keywords that were
already in the title.
Tony
On Friday, June 5, 2020 at 1:13:13 PM UTC+10, Eric Shulman wrote:
>
> On Thursday, June 4, 2020 at 7:41:02 PM UTC-7, TonyM wrote:
>>
>> I have tried to encourage myself to review tiddlers and record keywords
>> relating to the subject in a keywords field.
>> I modified your keywords variable as follows
>> keywords={{{ [<currentTiddler>] [{!!keywords}] +[addsuffix[+]] +[
>> addsuffix{$:/temp/google}] +[split[ ]join[+]] }}}
>> To include those keywords as well.
>>
>
> Your modified keywords adds the $:/temp/google input contents twice!
>
> For example, if the keywords field contains "foo bar" and the
> $:/temp/google input field contents is "test this", then the result of the
> inline filter is:
> New+Tiddler+test+this+foo+bar+test+this
>
> This is because
> +[addsuffix{$:/temp/google}]
> is applied to both the "[<currentTiddler>]" and "[{!!keywords}]" filter
> runs
>
> The correct keywords filter syntax should actually be this:
> keywords={{{ [<currentTiddler>] [{!!keywords}] [{$:/temp/google}] +[split[
> ]join[+]] }}}
>
> which lists all three sources of search terms (current tiddler, keywords
> field, and input field), splits them at any embedded spaces, and then joins
> the whole list with "+" signs to produce this result:
> New+Tiddler+foo+bar+test+this
>
> The new code is thus:
> <$edit-text tiddler="$:/temp/google" tag="input" placeholder="enter search
> text" default="" />
> <$vars keywords={{{ [<currentTiddler>] [{!!keywords}] [{$:/temp/google}]
> +[split[ ]join[+]] }}}>
> <$vars URL={{{ [[https://www.google.com/search?q=]] +[addsuffix
> <keywords>] }}}>
> <$button message="tm-open-external-window" param=<<URL>>>
> {{$:/core/images/advanced-search-button}} </$button>
> </$vars>
> </$vars>
>
> 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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/b4e946b3-b714-4d5e-bdcd-bda9df4b6059o%40googlegroups.com.