CMS Development

SnS_Nathan
Participante

Fetch metadata url's

resolver

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!

0 Avaliação positiva
1 Solução aceita
alyssamwilie
Solução
Especialista reconhecido(a) | Parceiro Elite
Especialista reconhecido(a) | Parceiro Elite

Fetch metadata url's

resolver

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.

 

page_field.png

 

{% 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.

Alyssa Wilie Profile Image

Alyssa Wilie

Web Developerat Lynton

Learn HubL | Get Marketing Insights

HubSpot Elite Solutions Partner
Lynton's HubSpot theme Rubric now available. Click to download.

Exibir solução no post original

1 Resposta 1
alyssamwilie
Solução
Especialista reconhecido(a) | Parceiro Elite
Especialista reconhecido(a) | Parceiro Elite

Fetch metadata url's

resolver

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.

 

page_field.png

 

{% 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.

Alyssa Wilie Profile Image

Alyssa Wilie

Web Developerat Lynton

Learn HubL | Get Marketing Insights

HubSpot Elite Solutions Partner
Lynton's HubSpot theme Rubric now available. Click to download.