Jan 30, 2023 5:44 AM
Hello devs.
I have a module on my website where i highlight a page from my website. i'm trying to automatically fetch the featured image, title and url attached to that page. Is there a way to do this in HubL or Hubspot?
All suggestions are welcome!
Solved! Go to Solution.
Jan 30, 2023 8:45 AM
You can use the content_by_id function to get a specific page's content. If you're doing this in a custom module you can use the page field to easily get the ID of the page.
{% set page = content_by_id(module.page_field) %}
Title: {{ page.name }}
URL: {{ page.absolute_url }}
Featured Image: <img src="{{ page.featured_image }}" />
If this answer solved your question, please mark it as the solution!
Need custom website/integration development or help optimizing HubSpot for your organization?
Schedule a consultation with us, an award-winning HubSpot Elite Partner.
Or check out our blog to get the latest in marketing, design, integration, and HubSpot knowledge.
Jan 30, 2023 8:45 AM
You can use the content_by_id function to get a specific page's content. If you're doing this in a custom module you can use the page field to easily get the ID of the page.
{% set page = content_by_id(module.page_field) %}
Title: {{ page.name }}
URL: {{ page.absolute_url }}
Featured Image: <img src="{{ page.featured_image }}" />
If this answer solved your question, please mark it as the solution!
Need custom website/integration development or help optimizing HubSpot for your organization?
Schedule a consultation with us, an award-winning HubSpot Elite Partner.
Or check out our blog to get the latest in marketing, design, integration, and HubSpot knowledge.