• ¿Estás listo para crear tu comunidad local de HubSpot?

    Los líderes de HUG organizan eventos, fomentan las conexiones y crean espacios donde las personas aprenden y crecen juntas.

    Conviértete en líder de HUG

Blog section in landing page

SaraE11
Participante

Is it possible to have a section on a landing page that shows the latest blog post as shown in the image?Captura de pantalla 2020-11-17 a la(s) 9.12.19 a. m..png

0 Me gusta
1 Soluciones aceptada
ernestina
Solución
HubSpot Employee
HubSpot Employee

Hi @SaraE11!

 

It is possible to create such functionality via the blog_recent_posts HubL function. This returns a sequence of blog post objects for the specified blog, sorted by most recent first - see this resource on HubL functions here for reference. You would add the below snippet to your template, configured to your needs with the help of a developer:

{{ blog_recent_posts('default', 5) }}
{% set rec_posts = blog_recent_posts('default', 5) %}
{% for rec_post in rec_posts %}
    <div class="post-title">{{ rec_post.name }}</div>
{% endfor %}

 

Please note this function has a limit of 200 posts.

 

Hope this helps guide in the right direction!

Tina

Ver la solución en mensaje original publicado

1 Respuesta 1
ernestina
Solución
HubSpot Employee
HubSpot Employee

Hi @SaraE11!

 

It is possible to create such functionality via the blog_recent_posts HubL function. This returns a sequence of blog post objects for the specified blog, sorted by most recent first - see this resource on HubL functions here for reference. You would add the below snippet to your template, configured to your needs with the help of a developer:

{{ blog_recent_posts('default', 5) }}
{% set rec_posts = blog_recent_posts('default', 5) %}
{% for rec_post in rec_posts %}
    <div class="post-title">{{ rec_post.name }}</div>
{% endfor %}

 

Please note this function has a limit of 200 posts.

 

Hope this helps guide in the right direction!

Tina