My Free Form AMPScript block looks readable as I'm writing it, but as soon as I save it, it becomes one "big blob of AMPScript".

It's important for me to keep it readable, as the email marketeer using the free form block needs to decide which AMPScript variables to go for.

My AMPScript is set up like this:

<!--Script Blok-->
/* <div style="display:none"> */
/* AMPScript */
/* </div> */ 

This is what it looks like, when I set up the AMPScript. AMPScript before saving

This is what it looks like, when saved. AMPScript after

What do I need to change to make sure the "readability" of the AMPScript remains?

Thank you


The solution is to use an HTML content block instead of Free Form:

Use HTML-only instead of Free Form


Adam is correct. The reformatting is being done by the CKEditor component used in the Freeform and Text blocks, so using the HTML block will prevent that.

One other option to keep in mind is Code Snippets. Code snippets are sort of like HTML blocks, but they don't get the styling table that wraps blocks. They can also be referenced with AMPScript using the block functions (contentblockbykey and contentblockbyid). They are also handy when editing HTML since they can easily be inserted into your HTML either via the toolbar option or by typing the customerkey + tab.

Hope this helps!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.