If JS Token Returns Value=null, collapse entire block? | Community
Skip to main content
Kelsey_Hope
Level 2
May 1, 2018
Solved

If JS Token Returns Value=null, collapse entire block?

  • May 1, 2018
  • 1 reply
  • 2944 views

Hello,

We have a JS Token that we use in our Marketo emails. When the result is null we set the default text to direct users to contact our customer service team. However, we would like to change this so that the entire block of content disappears when the result is null. Can this be done?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Grégoire_Miche2

A JS token in an email ? You mean a velocity token ?

It will not be possible to change the block presence, unless the block IS the token. In velocity, you can output all the html you need, so this should be possible. You will have to:

  • move the whole block HTML to the token
  • Make the whole code conditional
  • create a specific block in you email template that has no border and a 0 default height which only content will be the token.

-Greg

1 reply

Grégoire_Miche2
Grégoire_Miche2Accepted solution
Level 10
May 1, 2018

A JS token in an email ? You mean a velocity token ?

It will not be possible to change the block presence, unless the block IS the token. In velocity, you can output all the html you need, so this should be possible. You will have to:

  • move the whole block HTML to the token
  • Make the whole code conditional
  • create a specific block in you email template that has no border and a 0 default height which only content will be the token.

-Greg

Kelsey_Hope
Level 2
May 1, 2018

Thank you, this is very helpful! Do you think this is something that someone with a passing experience with HTML could do, or would it be better to contract some hours with Marketo to do this?

Grégoire_Miche2
Level 10
May 1, 2018

Better have someone skilled in Velocity.

Marketo consultants is not the only source of skills, there some partners and freelances that can help you too.

-Greg