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 !!keywords field 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 takes 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/611dc5c9-7d5f-4352-b0db-c22137a0f6d6o%40googlegroups.com.