Skip to main content
Grégoire_Miche2
Level 10
November 22, 2015
Question

Setting the Alt attribute for images elements in Guided LPs

  • November 22, 2015
  • 1 reply
  • 2414 views

It is currently impossible of the standard user to set the ALT attribute on mktoImg elements in landing pages. You will have to use workarounds that need to be anticipated in the Guided Landing Page template you are using.

To create a mktoImg element in an LP template, you can use either a <div> or an <img> tag in the template (see the doc here Create a Guided Landing Page Template - Marketo Docs - Product Docs )

  • in the <div> case, the final <img> tag will be entirely generated by Marketo. You could set the alt attribute in another hidden <div> with a variable and have some JS using this <div> value to set the tag.
  • in the img case, you have a little more control. You can use the img tag with a variable to set the alt <img class="mktoImg" id="exampleImg" mktoName="Example Image" alt="${MyImgAltVariable}">

All of this is not very usable, though, so I also have added the idea of an easy alt setting here :

Anything I have missed? Any other idea to workaround this limitation?

-Greg

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

Grégoire_Miche2
Level 10
February 21, 2016

Hi @Justin Cooperman​,

Any chance to have this fixed in the future ?

-Greg

Homero_Cavazos1
Level 2
September 14, 2018

Greg,

Have you tried the following?

<div id="header-image" class="mktoImg" mktoName="Header Image" alt="${heroAltText}">

         <img src="../image.jpg" >

</div>

This works fine when Marketo generates the image tag with it's attributes. Just make sure you include the declaration in the head of the HTML like:

<meta class="mktoString" id="heroAltText" mktoName="Hero Alt Text" default="Header Image" allowHtml="false">