Blog Listing Offset with Blog Listing Module

I’ve setup a blog template using the Drag and Drop options and have used the Blog Listing Module with grid options and selected the correct properties to be added to the listing.

Only issue is I need to exclude the first 6 blog posts since they are in a separate custom module.

Is there source code where I can find that module and create my own grid version with the offset?

Hi @ZADev
Yeah this is a pretty common frustration when you have a hero section or featured posts module pulling from the same blog and then the listing repeats them. The default Blog Listing module doesnt have a native offset parameter exposed in the UI which is annoying.
What you can do is clone the module and modify the HubL directly. You’d want to use the blog_recent_posts function which actually does support an offset parameter (https://developers.hubspot.com/docs/reference/cms/hubl/functions#blog-recent-posts).

So instead of relying on the default module’s loop, you can call something like blog_recent_posts(‘default’, 10, 6) where that last number is your offset. Then you build your own grid markup around those results. If you want to grab the default modules source code as a starting point, easiest way is using the HubSpot CLI with hs fetch to pull down the default theme assets, the blog modules are usually in there.

One thing to keep in mind is pagination can get tricky when you offset like this, so you might need to adjust your paging logic too. At Stacksync we work more on the data sync side of things but I’ve built enough HubSpot templates to know this particular issue well. Hope that helps point you in the right direction Note: This response was written based on my own experience and lightly reformatted with AI for clarity.

Okay, I didn’t know you could set it to that might of a number.

I think I know what I need to do to solve for offset and pagination using some extra logic.

Can you filter the recent_blog_posts() by the tag blog listing page being shown as well?

Hello @ZADev,

You can build a custom module or template and use blog_recent_posts, which, as I know, does support an offset.

Hope this helps!

Best Regards,

I’ve updated my custom module to use an offset and set a valid range within the for loop to support pagination and hiding / showing only the correct posts per page.