SOLVED

Email syntax -- optional image element

Go to solution
Matt_Stone2
Level 9

Email syntax -- optional image element

Looking through the Marketo email syntax documentation, I was wondering if it's possible to code an image element, but make it removable at the same time?

Here's my example:

<tr class="mktoModule" id="section2" mktoName="Section 2">

   <td>

      <div class="mktoImg" id="section2_img" mktoName="Section 2 Image" mktoImgLink="https://www.google.com/" mktoImgWidth="540" mktoImgHeight="189" mktoLockImgSize="false">

         <a><img style="display: block; border-width: 0;"></a>

      </div>

   </td>

</tr>

The element shows great, but if the user opts to not use an image, they're stuck.

1 ACCEPTED SOLUTION

Accepted Solutions
Grégoire_Miche2
Level 10

Re: Email syntax -- optional image element

Hi again Matt,

That's clear now I just did not understand this because the code sample you provided does not contain the mktoText element.

and indeed, the answer is to break your module in 2.

-Greg

View solution in original post

6 REPLIES 6
Grégoire_Miche2
Level 10

Re: Email syntax -- optional image element

Hi Matt,

The whole <tr class="mktoModule"> is removable, not the element. And to be removable, the module has to be in a container.

-Greg

Matt_Stone2
Level 9

Re: Email syntax -- optional image element

That's what I figured. So I'd either have to break the image out into a separate module, or ditch the image element and let people directly code it.

Grégoire_Miche2
Level 10

Re: Email syntax -- optional image element

Hi again Matt,

at the moment, the image is already in a seperate module. In other term, the only thing the modiule with ID section2 contains is the image. If you remove the module, you remove the image and its placeholder.

so I am not sure I am following you.

-Greg

Matt_Stone2
Level 9

Re: Email syntax -- optional image element

Essentially I'm wanting to be able to create a second container, which isn't possible. I have a module that is a block of text with an image, and I want that image to be an optional image element so it can be removed easily if it's not desired. But based on what you're saying about modules, it won't work and I'll need to break it into a second module entirely. Sorry if I can't articulate it properly, but I think I have my answer.

Grégoire_Miche2
Level 10

Re: Email syntax -- optional image element

Hi again Matt,

That's clear now I just did not understand this because the code sample you provided does not contain the mktoText element.

and indeed, the answer is to break your module in 2.

-Greg

Grégoire_Miche2
Level 10

Re: Email syntax -- optional image element

PS: you could also provide 2 modules: one with image and text, another one with the text only. This is usually what we do, because it means that on the module with Image + text, you can better control how the 2 interact in responsive mode.

-Greg