Despite their appearance, TW macros aren't functions. That is, they don't "evaluate and return".
They are more "text expanders". The only thing a macro does is to replace $param$ with the value passed to it,
and replace $(variable)$ with the value of the variable (only if it was defined *outside* the macro).
It is up to the "caller" of the macro to determine how it is rendered, if at all. If the macro is invoked from wiki content,
then it is rendered, as if it had been typed right there; but, if the macro result is used as a parameter value for a widget
call, then it is not parsed, and it left up to the widget itself to use, as is.
So, for your purposes, to combine literal text and the contents of a tiddler, you could write something like this:
\define combined(paramstuff)
Stringstuff$(tiddlerstuff)$$paramstuff$
\end
and then invoke it like this:
<$vars tiddlerstuff={{$:/link/to/tiddler!!text}}>
<<combined 35>>
</$vars>
The enclosing $vars widget retrieves the value from the tiddler contents
The scope of the variable is only within the enclosing <$vars>...</$vars> section
For the use-case you mentioned in your OP, something like this might do:
\define makeurl()
\end
<$edit-text field="value1" />
<$edit-text field="value2" />
<$vars value1={{!!value1}} value2={{!!value2}}>
URL src is: <<makeurl>><br>
<iframe src=<<makeurl>> />
</$vars>
Of course, you could put the edit-text widgets into a separate tiddler (e.g., Tiddler2)
and then reference them in the $vars, using {{Tiddler2!!value1}} and {{Tiddler2!!value2}}
Hopefully, the above example code is enough to get you started in the right direction...
Let me know how it goes.
enjoy,
-e
Eric Shulman