On Wednesday, June 16, 2021 at 2:50:58 AM UTC-7 [email protected] wrote:
> lets say I have a tiddler called Search which contains:
> www.google
> then in another tiddler i want to use this to create external links to
> different sites e.g.
> {{Search}}.com -> www.google.com
> {{Search}}.co.uk -> www.google.co.uk
> {{Search}}.fr -> www.google.fr
>
> the following doesn't work:
> <a href={{Search}}.com> link 1</a>
> what is the right syntax to achieve this?
>
To construct a parameter value (i.e., the value following the "href="
syntax), you need to use a "filtered transclusion", like this:
<a href={{{ [{Search}addsuffix[.com]] }}}> link 1</a>
<a href={{{ [{Search}addsuffix[.co.uk]] }}}> link 2</a>
<a href={{{ [{Search}addsuffix[.fr]] }}}> link 3</a>
Notes:
1) The filtered transclusion syntax is contained within tripled curly
braces: {{{ filter }}}
2) The filter syntax itself is contained inside a matched pair of single
square brackets: [...]
3) To reference the text content of a tiddler within a filter, use *single*
curly braces: {TiddlerName}
4) To append the desired literal text (i.e., ".com", ".co.uk", etc.) use
the addsuffix[...] operator
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/6e2a7daa-5488-4d00-904a-36a7b7e97c76n%40googlegroups.com.