Understanding how to debug and look into errors when developing websites on the HubSpot CMS.
standard_header_includes
. This will cause errors when developing in the Design Manager or when uploading files through the CMS CLI. The VS Code Extension supports HubL linting, and can display the fatal errors in-context ahead of uploading the file.
?hsDebug=true
query string in the URL.
?hsDebug=true
, debugging information will be added to the bottom of the page source code, including:
?developerMode=true
|pprint
HubL filter|pprint
HubL filter can be used on HubL variables to print valuable debugging information. It will print the type of HubL variable, which can be useful in understanding what expressions, filters, operators or functions it can be used with.
For example, {{ local_dt }}
will print 2020-02-21 12:52:20
. If we pretty print this variable, we can see the value is a date (PyishDate: 2020-02-21 12:52:20)
. This means we can use HubL filters that operate or format date objects, such as the |datetimeformat
HubL filter.