Best Practices: mktEditable on non-div elements for emails?

Casey_Grimes
Level 10

Best Practices: mktEditable on non-div elements for emails?

The "mktEditable" class is only supported for <div> elements, and tends to cause problems when used for other elements, so we recommend modifying your template.

So, I saw @Grant Booth mention this in a forum reply a little bit ago and this piqued my curiosity: in the beginning of working with Marketo email templates, I did in fact use separate divs for editable elements but have migrated towards using the class directly on table cells for tidying purposes. Thus far, I haven't seen any issues (if only because the tags operate similarly)—but is this going to cause problems either on Marketo's backend or for users later on?

3 REPLIES 3
John_Clark1
Level 10

Re: Best Practices: mktEditable on non-div elements for emails?

Hi Courtney,

We have seen issues in the editor when mkteditable is used outside <div> tags.  It's not a constant thing, but sometimes elements will be duplicated or out of place in the editor.  I can't say how using that class will affect things in the future, so I would recommend only using it in <div> tags for now.

John

Stijn_Heijthuij
Level 7

Re: Best Practices: mktEditable on non-div elements for emails?

Hi Courtney,

After building quite a number of MKTO templates using the mktEditable class pretty much everywhere I have found the following:

It's best to use mktEditable on your framework tags (<td>, <div>)

You can use mktEditable in your links and headers (<a>, <h1>)

Try to avoid using mktEditable in your span and paragraph (<span>, <p>, <img>, <font>)

Don't use multiple mktEditable class inside each other

Personally I try to use the mktEditable class on the lowest possible level. If I have a title or an image that I want to be editable and point to the same URL, I do the following:

<a href="http://{{my.link}}" target="_blank" id="Image" class="mktEditable"><img src="" /></a>

<a href="http://{{my.link}}?utm_source=marketo" target="_blank" id="Title" class="mktEditable">My Title</a>

This way marketers define the URL in a token (single place) and can only edit the image and the text. Any added tracking codes won't need to be added by the marketers, but will be embedded in the template (which could also be a token).

If you have any questions, let me know.

Grégoire_Miche2
Level 10

Re: Best Practices: mktEditable on non-div elements for emails?

Hi Stijn,

Thanks a lot for the details, it gives me a lot of ideas. I fully concur with you rule "use the mktEditable class on the lowest possible level". It reduces significantly the risk for errors.

The only issue with putting mktEditable in a <a> tag is that you have to set the href with a token, and then you have the risk that the tokens are not defined.

If we were working on landing pages, I would suggest that you use variables. On email this is not possible yet, which is why I have suggested this idea :

With variables and elements, your examples would read :

<a href="http://${ctalink}" target="_blank"><img class="mktoImg" id="Image" mktoName="Example Image"></a>

<a href="http://​${ctalink}?utm_source=marketo" target="_blank" id="Title" class="mktEditable">${Titletext}</a>

The user could insert tokens in the variables and the whole thing would be extremely error proof.

-Greg