Hi All,
A use case has come up where sometimes I will have a circumstance where a token is required to have a null value. In this case it is a text token. As we know the token must be pre-pouulated so is there are way with script that if the value = 00 then display nothing within the assets.
Thanks in advance
Solved! Go to Solution.
OK, on the Text {{my.token}} side, how about just store an HTML comment:
<!-- -->
If you're just plopping the token into your HTML, this will be fine.
If you're embedding in JS then you can still check for that specific value, it just won't be "magic":
if ( "{{my.token}}" != "<!-- -->" ) {
// it's not empty
}
A Velocity token is implicitly emptyable, since it can just contain a comment
##
I'd just use a Velocity token instead of a Text token.
Hi Sanford,
Makes sence although I do need it to render on LP as well.
OK, on the Text {{my.token}} side, how about just store an HTML comment:
<!-- -->
If you're just plopping the token into your HTML, this will be fine.
If you're embedding in JS then you can still check for that specific value, it just won't be "magic":
if ( "{{my.token}}" != "<!-- -->" ) {
// it's not empty
}
Thanks, I may need you magical assistance with this one.