I’m trying to create a CTA button on the hero banner on the home page. Does anyone have ideas how to go about it?
Hi @stephenong,
you’ll need to modify the module by adding either a “real” CTA function to it or a styled link. Could you please post the source code of the hero module here?
best,
Anton
Hey Anton,
This is the module.html
<div class=“bg-video home-bannerArea-module”>
{% if module.video.videos or module.video.poster_image.src %}
<video autoplay=“” loop=“” style=“background-image: url({{ module.video.poster_image.src }});” muted=“” playsinline=“” data-wf-ignore=“true”>
{% for item in module.video.videos %}
<source src=“{{ item.video }}” data-wf-ignore=“true”>
{% endfor %}
</video>
{% endif %}
<div class=“page-center”>
{% if module.title %}<h1>{{ module.title }}</h1>{% endif %}
<!--<a href=“#” id=“BtnPlayVideo” class=“play-video-icon content-hidden w-inline-block”></a>-->
</div>
</div>
I’m trying to add a simple CTA button within this section
<div class="bg-video home-bannerArea-module">
{% if module.video.videos or module.video.poster_image.src %}
<video autoplay="" loop="" style="background-image: url({{ module.video.poster_image.src }});" muted="" playsinline="" data-wf-ignore="true">
{% for item in module.video.videos %}
<source src="{{ item.video }}" data-wf-ignore="true">
{% endfor %}
</video>
{% endif %}
<div class="page-center">
{% if module.title %}<h1>{{ module.title }}</h1>{% endif %}
{% unless module.cta == "" %} {# checks if a CTA is selected #}
<div class="cta-wrapper"> {# just a wrapping div to have the option to apply CSS styling #}
{% cta guid="{{ module.cta }}" %} {# CTA function renamed to "CTA" #}
</div> {# closing wrapping div #}
{% endunless %} {# closing checker #}
<!--<a href="#" id="BtnPlayVideo" class="play-video-icon content-hidden w-inline-block"></a>-->
</div>
</div>
just add a “CTA” function in the fields
and copy/paste the snippet between the div.
Optional: add the unless statement wrapper to it. Note: the name in the unless statement has to be the same as in the snippet but without the double curly-braces.
best,
Anton
Hi @stephenong ,
You have to create Custom Module and add CTA field like:
then your problem solved.
Hope this helps!
If we were able to answer your query, kindly help the community by marking it as a solution.
Thanks and Regards.

