HTML5 Import Statement



I'm trying to create a new HubSpot site which uses Statamic as the CMS. I've got the majority of it working but the navigation is causing me some headaches.

Our client will be administering all of the website content pages in Statamic which is also responsible for generating the navigation. I've managed to get Statamic to render out a HTML file ready for use in HubSpot but the HTML5 import statement isn;t working. I suspect due to CORS so I can't import the file.

Any ideas other than a JS AJAX approach?



Hi @tmorris,

I'm not sure I'm clear on the setup here; is the site hosted on HubSpot or externally? It sounds like you might be compiling a page's HTML using Satamic and then pulling that HTML into a HubSpot page; does that sound right?


Hi @Derek_Gervais,

That is indeed correct. Ive got the first part working correctly (generating the HTML in Statamic) and I have now added the import statements to HubSpot correctly (it seems my previous issue was due to the way I was importing the files - this is fixed now). The only obstacle now seems to be the CORS on the host server of our website. Its on my ToDo list to get sorted before launch but its been pushed down a few notches recently.

I'll let you know if I get it working successfully. I'm not sure this is the right way to do it but this is the first HubSpot implementation for us.



Hi @tmorris,

Thanks for keeping me in the loop. Let me know how things go; this is the first time I've heard of an implementation like this, and it'd be cool to check out the results (if that's ok with you/your client).


Hi @Derek_Gervais,

Sorry for the delay in my reply, I managed to get this implemented and working as required but have been on annual leave for a couple of weeks.

Our site is still in development but you're welcome to take a look: Pathfinder Site.

The site is built using the Statamic CMS but has a Hubspot blog here: Pathfinder Blog.

The pages in the navigation exist in Statamic but we wanted them to persist on the blog pages as well. To achieve this we built a Statamic plugin to generate a static HTML file from the Antlers template.

We use some JavaScript in the HubSpot templates to load in the Static HTML file and display the navigation consistently across all pages. As the navigation is controlled from within Statamic it will update in-line with any site changes.

Let me know what you think and if you can suggest any improvements on this technique, it would be much appreciated. This is our first HubSpot development so it might not be the best approach possible.