Pulling Article Snippets

@Emma817 -

first, go to your blog post template (not blog listing) in the design manager. When you click on the blog post module, you will see on the right, a button to edit the module code. Paste in the following code at the top of the page.

{% text "excerpt" label="Excerpt", value="" export_to_template_context="true" %}

Next, you will go into each blog post that you would like to add an excerpt to, and you will see a new module appear called excerpt, when you click on the “box icon” in the left sidebar.

Add some text there for your excerpt and save.

Now, in your custom module that is looping through the blog posts, add a variation of this code which will find the excerpt and display it.

(I don’t have your actual module code, so here is an example):

{% set pop_posts = blog_popular_posts('default', 5) %}
 {% for pop_post in pop_posts %}
	{% for w in pop_post.allWidgets %}
 {% if w.name == 'excerpt' %}
 {{w.body.value}}
 {% endif %}
 {% endfor %}
 {% endfor %}

If this answer helped, please, mark as solved :grinning_face_with_smiling_eyes:


tim@belch.io | forms.belch.io | Design your own Beautiful HubSpot Forms; No coding necessary.

Drop by and say Hi to me on slack.