CMS Development

jmarcello
Participant

How To Check If CTA Guid is known In A Custom Module

Trying to set up a sidebar CTA module for our blog, which wikk display only if the CTA has been set. Assuming that means checknig if the CTA Guid is known. Code would be something like this:

{% if WHAT GOES HERE? %}
{% cta guid='{{ module.guid }}' %}
{% endif; %}

I am not sure what to put in the if statement. Any help is greatly aprpeciated.

0 Upvotes
2 Replies 2
jmarcello
Participant

How To Check If CTA Guid is known In A Custom Module

Any help here?

0 Upvotes
dennisedson
HubSpot Product Team
HubSpot Product Team

How To Check If CTA Guid is known In A Custom Module

@jmarcello if the name of the cta field is "cta_field", it would look like this:

{% if module.cta_field %}
     {% cta guid="{{ module.cta_field }}" %}
{% endif %}