SOLVED

Constraining a mktEditable image proportions in email template

Go to solution
Anonymous
Not applicable

Constraining a mktEditable image proportions in email template

Hello,

I am trying to create a mktEditable image that will retain its proportions and style attributes when edited. The placeholder image in my template has the following style attributes: width="100%" height="230" style="display: block; outline:none; text-decoration:none; -ms-interpolation-mode: bicubic;". When I try to replace the image when creating a test email, the image loses these style attributes. 

Does anyone know how I can create mktEditable images that will retain their proportions and style attributes when edited?

Thanks!
Tags (1)
1 ACCEPTED SOLUTION

Accepted Solutions
Anonymous
Not applicable

Re: Constraining a mktEditable image proportions in email template

Hello Ann,

Have you tried storing the image url in a token and then just reference the token within the image tag inside the mktEditable region? The image should get rendered based on the section's style settings regardless of its actual dimensions.

Not sure if this answers your question, but I've found it makes things much easier if I store the image url in a token rather than manually going into the mktEditable region and replace the image. I know it will always get rendered properly regardless of the image's dimensions.

Here's an example:
<div class="mktEditable" id="header-image" ><img style="display: block;" src="{{my.HeaderImage}}" alt="" height="230" width="560" border="0"></div>

Hope this helps!

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Re: Constraining a mktEditable image proportions in email template

Ann,

What happens to the image when you lose the style attributes? Except for making it a block image,  I think those styles are superflous (i.e. img don't usually have a text-decoration property set). 
Anonymous
Not applicable

Re: Constraining a mktEditable image proportions in email template

Hello Ann,

Have you tried storing the image url in a token and then just reference the token within the image tag inside the mktEditable region? The image should get rendered based on the section's style settings regardless of its actual dimensions.

Not sure if this answers your question, but I've found it makes things much easier if I store the image url in a token rather than manually going into the mktEditable region and replace the image. I know it will always get rendered properly regardless of the image's dimensions.

Here's an example:
<div class="mktEditable" id="header-image" ><img style="display: block;" src="{{my.HeaderImage}}" alt="" height="230" width="560" border="0"></div>

Hope this helps!