0

I'm building HTML template in Content Builder, I paste in my HTML with predefined placeholder attribute values, e.g.

<div data-type="slot" data-key="contentarea" data-max-blocks="5" data-allowed-blocks="freeformblock; textblock" data-label="Drop content blocks here"></div>

Every time I change from Code View to Layout and go to content area properties, the value of data-max-blocks was deleted. How to keep that value in the HTML code?

1

I could reproduce, looks like an Editor bug. The easiest way to work around this is to paste your HTML, then go to any slot placeholder and rename (change data-key) to trigger some editor parsing process that aligns the real template JSON with your markup. For instance if you have 12 slots in your template, going to the first one and renaming it from, say, contentarea to contentarea1 (and then back if you want) would align all the slots to their rightful values (including data-max-blocks). Do this right after pasting, before you go to any slot properties.

This doesn't fix the bug, but it's the quickest/lightest workaround I could find.

  • Thanks Asinus for your answer. The thing is that I would like to use one placeholder on email template instead of bunch of them. But at the same time I want to ban editors to use more than 5 content blocks on email. – Neryus Nov 30 '16 at 16:16
  • I think this fix works for it. It's only until the editor processes that data-max-blocks property once that this bug applies. So when you create your template and paste your html in it, if you just rename that data-key attribute to whatever you like (that rename action makes the editor process the values in the markup and works around the bug), then you can switch between code view and the slot properties without losing your markup (including the data-max-blocks), and save the template, and make an email from it with the right restrictions etc. This would work with 1 or 12 slots. – AsinusAsinumFricat Nov 30 '16 at 22:53
1

The suggested workaround will do the trick. I've logged a defect for this and we'll get it fixed ASAP.

  • 1
    Thanks for letting us know Don. We appreciate having the support of Salesforce here on SF.SE. – crmprogdev Dec 1 '16 at 14:18
  • Thanks Don! May I book in few more Content Editor bugs? – Neryus Dec 5 '16 at 12:33

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.