HubSpot CMS HubL Macros [code snippets]

A collection of HubSpot CMS Macros

 

Continue Reading

Category: Code Snippets

How to Redirect WWW to non WWW WordPress [htaccess snippet]

Below are two code recipes for your htaccess file to redirect different versions of your domain. Once you have things added you can use this redirect testing tool to verify all the versions of your domain are redirecting properly. If you don’t want the WWW Redirect everything to naked domain https://yourdomain.com

  If you… Read more »

Continue Reading

Category: Code Snippets

HubSpot CMS Site Search Input Module Override

HubSpot provides a default module to perform a site search. By default it searches website pages and blog posts. But what if you want to override this and only search blog posts? Below is an embed snippet to help you do just that. Usage Snippet Verbose Example

Continue Reading

Category: Code Snippets

How Do You Change the Primary Domain in HubSpot CMS?

If you are looking to rebrand your website and change its domain there are a few steps you can take. You will most likely land on this HubSpot knowledge base article which outlines the steps but if you read it quickly you might miss a critical piece of information. At the very bottom there is… Read more »

Continue Reading

Category: Common Questions

How to Fix HubSpot Website Your Connection is Not Private Error in Chrome & Safari

HubSpot requires using CNAME to point a domain to their server using a subdomain. This means you still have an A record to worry about. The www in your www.yourdomain.com is a subdomain and not root domain that does not have the www. It is the same as blog.yourdomain.com or mail.yourdomain.com. In order to fix this,… Read more »

Continue Reading

Category: Common Questions

How to Link to Module Fields to Theme Images in HubSpot Themes

When building HubSpot themes you often want to have default images referenced from inside your theme folder. You would think adding a relative link would work but you actually need to add it inside this hubl function to get it to work get_asset_url() Learn more about building custom modules in HubSpot.

 

Continue Reading

Category: Code Snippets

How to Update Navigation Menu in HubSpot Content Staging

When using content staging in HubSpot you can easily test and preview design changes but the menu does not update to use the new staging domain. So you have to preview each page individually. This can be an issue when you are working on a HubSpot website rebrand and the client needs to click through… Read more »

Continue Reading

Category: Code Snippets

How to Have a HubSpot Menu Load the Default Menu When Transferring to Another Account

Problem: When transferring a HubSpot theme or template file to another portal global module’s menu disappears. The code snippet below sets the default menu tag to pull a default if it is not selected.

 

Continue Reading

Category: Common Questions

HubSpot Themes vs Templates – What is the Difference?

Previously it was possible to download HubSpot template packs from the HubSpot marketplace. These were a collection of landing page, website page, blog, and email templates. The downside of these packs is they did not share any unified settings and they were not very portable between accounts. Now a group of templates, custom modules, and… Read more »

Continue Reading

Category: Common Questions