HubSpot HubL Code Snippet Collection – Filters, Functions, and Macros

  • read
HubSpot HubL Code Snippet Collection – Filters, Functions, and Macros

Below is a list of my commonly used HubSpot CMS HubL filters, functions, and Macros. Email me if you have one you would like to add to this list.

Create a slug from a text string

I used this when I wanted to add a CSS class name to the li of a menu using the text label. This allowed me to target that unique li to style it different from the others.

Bulk replace a dev domain with a production domain on site launch

I recently worked on a HubSpot site migration and had a lot of links pointing to the development domain. A quick way to update these links is to use this HubL filter |replace(“”,””)

 



Related posts

Written by: Jacob Lett, a website designer & developer who creates HubSpot CMS themes and writes web design & marketing books to help marketers, designers, and web developers grow their businesses. This blog is my own personal journal and source to help others through some challenges I have faced.
Connect on LinkedIn


Category: Code Snippets
Tags: ,