CMS Development

gil1001
Top Contributor

Help with blog template

Hi,

I have a resource library on our website that was designed using the blog structre in Hubspot: https://www.syslink-xandria.com/resource-center

Each post is basically just a picture, description and CTA. I've lately posted two new items, in both the CTA doesn't show up. 

In order to create them I've basically just cloned an existing post and just changed what's needed.

Any idea how to make the CTA to show up?

0 Upvotes
1 Reply 1
lscanlan
HubSpot Alumni
HubSpot Alumni

Help with blog template

Hi @gil1001,

 

I took a look at your template for you. To be honest I'm not certain why, but it looks like what's being exported on those 2 posts is actually a little different than the data that's being exported on all the "working" posts. You can see what I mean by using the Developer Info: https://designers.hubspot.com/docs/hubl/how-to-use-developer-info-on-cos-pages.

 

If you locate the contents object, look at the array of objects inside it. Each object here represents a post. In the first post, if you locate the widgets object, you'll notice that the path content.widgets.resource_cta.body.token doesn't actually exist. This is what you're trying to pull in inside the "List" custom HTML module on the listing template.

 

But if you look at the 2nd post, that path of content.widgets.resource_cta.body.token does exist. It's the full HubL token for displaying a CTA.

 

So it looks like the structure of the data that's being exported to the template context has changed. I'd actually suggest creating a new custom module for this. We've upgraded them to version 2. You can find documentation on them here: https://designers.hubspot.com/docs/modules/getting-started. You could include both of your fields (the CTA and background color) within the same module. The data structure will be a little different from how it is currently. But the CTA and background color information will be accessible on the listing page.

 

Let me know if you have questions about any of this or any trouble getting this set up.

 

 - Leland

Leland Scanlan

HubSpot Developer Support
0 Upvotes