Is it possible to get the URL or link from a CTA? something like this:
{{ cta(‘9ef5c543-11d6-453e-860d-50699c2a581e’).link }}
or
{{ cta(‘9ef5c543-11d6-453e-860d-50699c2a581e’).url }}
I want it in a blog post. Or custom module.
Thanks in advance
Is it possible to get the URL or link from a CTA? something like this:
{{ cta(‘9ef5c543-11d6-453e-860d-50699c2a581e’).link }}
or
{{ cta(‘9ef5c543-11d6-453e-860d-50699c2a581e’).url }}
I want it in a blog post. Or custom module.
Thanks in advance
I don’t believe that’s possible, the HubL documentation shows that it only takes two parameters:
The first parameter is the GUID of the CTA. This unique ID can be found in the URL of the Details screen of a particular CTA. The second parameter accept the following enumeration values:
I also can’t spot any filters that would help either.
What’s the use case for just getting the URL for the CTA?
If this helped, please mark it as the solution to your question, thanks!
Hi, thanks for the response.
I want to do it because I am making a parallax CTA. You can see it here: Lenguaje para la web: tuteo, ustedeo o voseo
The HTML code is:
<a href="https://wvw.dinterweb.com/ebook-el-tiempo-la-mejor-analogia-para-entender-la-evolucion-del-marketing?hsCtaTracking=9ef5c543-11d6-453e-860d-50699c2a581e%7C0598f485-7009-4e92-a00a-0e14f4913c42">
<div class="dinter_cta col-xs-12 col-sm-12 col-md-12" data-paroller-factor="0.4" data-paroller-factor-xs="0.2">
<div class="col-xs-12 col-sm-6 col-md-6 img" style="background-image: url('https://wvw.dinterweb.com/hubfs/ebooks/ctas/analogia.png');"> </div>
<div class="col-xs-12 col-sm-6 col-md-6 info">
<p>Descubrí cómo utilizar el marketing para dar un paso hacia el <span>desarrollo empresarial</span>.</p>
{{cta('9ef5c543-11d6-453e-860d-50699c2a581e')}}</div>
</div>
</a>
In the first <a> element; I want to make something like: {{ cta(‘9ef5c543-11d6-453e-860d-50699c2a581e’).link }} in the href attribute, not to copy all the url of the CTA redirect.
I do not know if I am explaining myself correctly.
Thanks. ![]()
The cta creator uses a richtext editor and the richtext editor has a source code editor. From looking at code I can see that you shouldn’t have any issues inserting it into the source code editor of the richtext editor of a cta. This means you can create your parallax cta, very cool btw, and let the cta manager wrap it inside the cta. This way you don’t have to try to tear the cta apart. If you do this make sure you set the cta style to ‘no style’ to clear any default styling. You can keep your css in your style sheet.
Need help? Hire Us Here
@egonzalez - You could probably do something like this to get the URL of the CTA;
replace the XXXXX with your CTA ID
{% set splitArray = cta('XXXXXXX-XXXX-XXX-XXXX')|split('href="', 2) %}
{% set CTAUrlArray = splitArray[1]|split('"', 2) %}
{% set CTAUrl = CTAUrlArray[0] %}
{{CTAUrl}}
Although, CTA links have pretty standard prefixes and you could probably just do:
https://cta-redirect.hubspot.com/cta/redirect/{PORTALID}/XXXXXXX-XXXX-XXX-XXXX
If this answer helped, please, mark as solved ![]()
tim@belch.io | forms.belch.io | Design your own Beautiful HubSpot Forms; No coding necessary.
Drop by and say Hi to me on slack.
Thanks. Solved. Have a nice day, and you too reader.