Apologies Stephan,
your code does work. I replicated the setup with an error in the data
dictionnary, having it be of type json instead of
application/x-tiddler-dictionary.
Thanks for your help. If you could still get to my questions about the $()$
syntax and the non-cascading transclusion, it would help me understand why
your code works and mine does not.
Looking forward to improving my skills and to the newly released 5.1.0
version (fresh out of beta).
Thanks again,
Robert Naud
On Friday, September 19, 2014 4:07:27 AM UTC-4, Stephan Hradek wrote:
>
> The problem is: You need one more level of evaluation. Additionally I
> suggest to change your logic a bit.
>
> Why not create a tiddler "MyDomains" (or "$:/MyDomains") as a data tiddlre
> like so:
>
> domain1:domA.com
> domain2:domB.com
>
> And then in the server tiddler simply name the domain name - don't use
> transclusion syntax:
>
> title:MySertver
> text:{{!!myTemplate}}
> domain:domain1
> server:sampleserver
>
> and this would be the mytemplate (with local macros for illustration)
>
> \define link(protocol, server, path)
> $protocol$$server$.$(dom)$$path$
> \end
>
> \define build(protocol:"http://", server, domain, path)
> <$set name="dom" value={{MyDomains##$domain$}}>
> <$macrocall $name="link" protocol="$protocol$" server="$server$" path=
> "$path$"/>
> </$set>
> \end
>
> <$macrocall $name="build" protocol="https://" domain={{!!domain}}
> server={{!!server}} path="/sample/path.html"/>
>
>
> In "build" we first have one evaluation, setting the variable "dom" to the
> value stored in "MyDomains" under the index whose value we take from the
> field "domain".
>
> In "link" we simply concatenate.
>
--
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 post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.