Here's another version that doesn't need to define a macro and also provides an input field for the search term:
<$edit-text tiddler="$:/temp/google" tag="input" placeholder="enter search text" default="" />
<$button message="tm-open-external-window" param={{{ [[
https://www.google.com?q=]] +[addsuffix<currentTiddler>] +[addsuffix[+]] +[addsuffix{$:/temp/google}] +[split[ ]join[+]] }}}>
search
</$button>
1) Define a tiddler (e.g., "Google") containing the above code
2) Create any other tiddler containing the following:
How it works:
* As with the previous macro version, the desired URL is constructed using the currentTiddler value
* Instead of using a macro parameter to insert the search term, and $edit-text widget is used to save the term input into a temporary tiddler, $:/temp/google
* The contents of $:/temp/google are appended to the constructed URL
* A $button widget is used to open a new 'external' browser window with the fully constructed URL
To use it:
* Instead of invoking a macro (i.e., <<google ...>>), transclusion is used (i.e., {{||Google}} to display the input field and button
* Note the use of || in the transclusion. This allows the *context* of the containing tiddler to be applied, which means that the value of currentTiddler is the title of the tiddler in which the transclusion occurs, rather than the title of the tiddler in which the input field and button are defined.
Again, let me know how it goes...
enjoy,
-e