CMS Development

Rob-NWB
Participant

How do you insert a personalization token into the image src url?

I am trying to insert a personalization token into the image source but it keeps breaking.

 

This is the personalization token as created when using the WYSIWYG insert tool:

{{ personalization_token("contact.hack_var_rma_number", "RA911-OOPS") }}

This token, on its own, works fine without fault.

 

The image URL that I am trying to manipulate is this:

https://barcode.tec-it.com/barcode.ashx?code=Code128&modulewidth=fit&data=RA456578978&dpi=72&imagetype=gif&rotation=0&color=&bgcolor=&fontcolor=&quiet=0&qunit=mm

Note the: data=RA456578978 where the RA number is what I am trying to drop the personalization token into.

 

When I combine them:

I get this:

<img src="https://barcode.tec-it.com/barcode.ashx?code=Code128&amp;modulewidth=fit&amp;data={{ personalization_token("contact.hack_var_rma_number", "RA911-OOPS") }}&amp;dpi=72&amp;imagetype=gif&amp;rotation=0&amp;color=&amp;bgcolor=&amp;fontcolor=&amp;quiet=0&amp;qunit=mm" alt="barcode" width="185" style="width: 185px; max-width: 185px;">

Which flags the double quotes red and everything after the close double braces of the personalization token.

 

I am curious to know how I can make this work so that the output src url is the same as the first code snippet above, with the RA number being different?

 

Please advise

0 Upvotes
1 Reply 1
jennysowyrda
Community Manager
Community Manager

How do you insert a personalization token into the image src url?

Hi @Rob-NWB,

 

Are you still experiencing this issue? 

 

If you are still stuck, can you please share as much detail, screenshots and public links so we can see where you are working and where you are getting stuck? 

 

Thank you,
Jenny

0 Upvotes