Closed JoernBerkefeld closed 7 months ago
This one can be pretty useful in two cases:
I will add a more thorough explanation to the page.
A simple example though:
<script runat=server>
var IS_PROD = {{IS_PROD}};
var MC_SUBDOMAIN = "{{SUBDOMAIN}}";
var CLIENT_ID = "{{CLIENT_ID}}";
var CLIENT_SECRET = "{{CLIENT_SECRET}}";
</script>
{ //...
{
"dev-tokens": {
"IS_PROD": false,
"MC_SUBDOMAIN": "mc-dummy-subdomain",
"CLIENT_ID": "cl-id-12345",
"CLIENT_ID": "cl-secret-98765"
},
"prod-tokens": {
},
/...
}
ok, that is in fact what we call templating in mcdev. had a feeling but wasn't sure. I'm assuming you use Mustache? You might want to consider using 3 curly brackets because that ensures the text is used as-is. otherwise it might end up doing some unwanted extra conversions...
Yup, it's templating & Mutache. The name "tokens" is a bit of a legacy thing.
Good idea, GTL probably will not be supported in the current implementation. But that way I will probably need to choose another templating package.
I am adding this to Usage
tab on the page.
I am preparing a new version of the extension, that has an option to set the Mustache Tags.
good thinking :)
Deployed yesterday in v0.2.0.
There is way more documentation on this topic now: https://fib3.vercel.app/ssjs-vsc/4_templating Also, since v0.4.4 (will be pre-released today) you can set these in the Config Panel.
whats that for? is that supposed to be templating / auto-replacement logic? if yes, could you provide a real-life example to make it easy to understand?
you mention it on https://fib3.github.io/ssjs-vsc/settings/ and on https://fib3.github.io/ssjs-vsc/use/ but neither description is giving actual examples