How to add a link to a promo image in a "Classic Promo"

Hello,

Im trying to add a link to a promo image in a “Classic Promo”, so the user press the image and get to somewhere else.

So as you can see in the picture, i would the user to press in the picture that says “Cachorros” and in the one that says “Adultos” and take the other to another webisite. Please help, im very noob on this, so i would a step by step help please!!!

pd: sorry for my bad english is not my main language

Hi there,

Unfortunately, the Classic Promo Element does not have such a functionality.

There is a workaround for this but you will lose the ability to use the ALT of the image as the workaround uses that option to add the link. Here is how you would implement the option.

1 . Add the withlink class to the Class input box of the Promo.
2 . Add your website link which the image will be linked to the ALT input box of the Promo

3 . Add the code below to X > Launch > Options > JS:

jQuery('.x-promo.withlink').each(function() {
	var theImg = jQuery(this).find('img');
	var theLink = theImg.attr('alt');
	theImg.on('click', function() {
		window.location.href = theLink;
	});
});

4 . Add the code below to X > Launch > Options > CSS:

.x-promo.withlink img {
	cursor: pointer;
}

Hope it helps.

Thank you, that works!!! But how is the correct way to doing what i want to do, what would you recommend me?

Hi There,

The basic way of doing what you need is an Image element and Text element, Image element has a LINK option.
But if that Promo element works great for you, that’s just fine too.

Thanks,

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.