Hide modules and sections from the editor
When developing a theme, you can set which modules and sections appear in the editor. This enables you to curate the list of modules and sections available to content creators when building pages, blogs, and global content, rather than having all modules and sections appear for all content types. Using this feature, you can also hide HubSpot default modules in favor of your own versions.
You can hide modules and sections in the following ways:
- Within themes: you can hide default modules, but not custom modules. Similarly, you cannot hide custom sections in a theme. To exclude a custom module or section from a theme, you should instead delete the module or section from the theme.
- Within templates: you can hide default modules, custom modules, and sections.
When hiding modules and sections, keep the following in mind:
- When hiding HubSpot default modules in a template, ensure that the module is wrapped in single quotes (
'). For example,
'@hubSpot/follow_me'. This complies with YAML, which template annotations are based on.
- You must use the relative path when specifying a hidden module. Using an absolute path will result in the module not being hidden.
To hide default modules in a theme, you'll need to add a list of hidden modules to a
hidden_modules array in the
theme.json file. For example, if you wanted to hide HubSpot's default button and form modules from a theme, your code would look like the following:
To hide modules and sections in a specific template, you'll need to add a list of
hiddenSections in the template annotations. For example:
Thank you for your feedback, it means a lot to us.