0

I have made a custom content block inside Content Builder using the Block SDK and I need to figure out the width of the space inside of the email (when editing) so I can set the width of the images created while using my custom block.

For example, if there is a 2 column layout in the email and each column is 300px, I need that data passed through so I can set image widths to 300px.

Here is the documentations: https://github.com/salesforce-marketingcloud/blocksdk

I've tried getData() ect to no avail.

1

This functionality does not exist and it would be tricky to build and use, as width of a block can change based on media queries and the size of the client. Returning a width that is contextual and not guaranteed could lead to poor end user experience.

Based on your example, it seems you can achieve the same result using relative styles (like a 100% width on your image) and it would be more robust.

| improve this answer | |
  • That makes sense, and I agree with you on a high level. The problem is that images can't use relative styles in older outlook versions so I need a fallback at the very least with a hard-coded width. Do you know a way around this Outlook bug worth exploring? – DigitalMC Jun 4 '19 at 16:36

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.