We use cookies to make HubSpot's community a better place. Cookies help to provide a more personalized experience and relevant advertising for you, and web analytics for us. To learn more, and to see a full list of cookies we use, check out our Cookie Policy (baked goods not included).
Nov 6, 2019 1:00 PM
Hi,
I'm trying to add a link field to a custom module like this: https://designers.hubspot.com/blog/url-and-link-fields-now-available-in-custom-modules
When I do this and click the "read more" link it just takes me back to the same page the module is on.
I have made a link field HubL variable called "link_field"
<div class="uilink" {{module.link_field.href}} > {% set href = module.link_field.url.href %} {% if module.link_field.url.type is equalto "EMAIL_ADDRESS" %} {% set href = "mailto:" + href %} {% endif %} <a href="{{ href }}" {% if module.link_field.open_in_new_tab %}target="_blank"{% endif %} {% if module.link_field.no_follow %}rel="nofollow"{% endif %}> Read more</a> </div>
Not sure what I'm doing wrong here?
Thanks!
Solved! Go to Solution.
Nov 6, 2019 11:43 PM - edited Nov 6, 2019 11:44 PM
Hi @BenMIN,
Are you linking to an external site? If so, did you indicate the correct external link?
On my end, I set up a custom module to add link field like this:
Add the module on my page: https://info.wendyggx.com/landing-page/fuji-yoga > When I click on the 'Read More' link > I was directed to google.com just fine.
Do our set up match? Let me know if I'm missing anything here.
Nov 6, 2019 11:43 PM - edited Nov 6, 2019 11:44 PM
Hi @BenMIN,
Are you linking to an external site? If so, did you indicate the correct external link?
On my end, I set up a custom module to add link field like this:
Add the module on my page: https://info.wendyggx.com/landing-page/fuji-yoga > When I click on the 'Read More' link > I was directed to google.com just fine.
Do our set up match? Let me know if I'm missing anything here.
Nov 7, 2019 4:33 AM
Hi Wendy,
Thanks for your help! I realised I had a typo in the field. I've got it working now.
Thanks!