Dynamic Button on guided landing page | Community
Skip to main content
Franky_Ruyssch2
Level 4
October 4, 2018
Solved

Dynamic Button on guided landing page

  • October 4, 2018
  • 1 reply
  • 7300 views

On my guided landing page, I have created an element which has an image and a button (CTA).

I would like to have the button dynamic, so I should be able to define the button text as dynamic content, and the button URL as dynamic content.

The button (CTA) links to a whitepaper download pdf, but the URL is different for every language version ( Dutch - English - French - German )

Both button label and button URL do not appear in the dynamic content section.

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

Ok,

I changed :

<button class="btn btn-lg btn-blue mt">${showCentralTextImageButtonLabel}</button>

in the following :

<button class="btn btn-lg btn-blue mt"><div id="cta1" class="mktoText" mktoName="CTA1">BUTTON</div></button></a>

By doing that the text on the button will be modifiable within a segment.

But, the url also needs to be different for the items in my segment. ( the cta is linking to a whitepaper, but depending on the language in my segment, it needs to link to another url, because the whitepaper has been translated.

So the code is structured like this :


<
a href="mylink">

     <button class="btn btn-lg btn-blue mt">

          <div id="cta1" class="mktoText" mktoName="CTA1">BUTTON</div>

     </button>

</a>

What should I do to have the url 'mylink' also dynamic?

Regards


I would suggest you change the code to this:

<div id="cta1" class="mktoText" mktoName="CTA1"><a href="mylink"><button class="btn btn-lg btn-blue mt"> BUTTON </button></a></div>

That way the whole button and link could be dynamic.

1 reply

Frank_Breen2
Level 8
October 5, 2018

Is your CTA editable in the elements section?

Have you can example url?

Franky_Ruyssch1
Level 1
October 15, 2018

No it isn't. What do I need to do?

Frank_Breen2
Level 8
October 15, 2018

So it looks like your button is controlled in the variable section, you can't make that bit dynamic. To fix this you need to wrap an editable region around the CTA:

<div id="cta1" class="mktoText" mktoName="CTA1">BUTTON</div>

This is done at the template level, please note, if you wrap this div around the CTA, it may brake the variable from working, so it might be worth adding this as a new feature.