Learn how to a configure a custom module.
meta.json
file, which can include the following properties:
Parameter | Type | Description | Default |
---|---|---|---|
icon | String | URL to an image to use as the icon for a module. | |
label | String | Label used when modules are shown in the content editors | |
module_id | Number | Unique id for the module that is independent from the path. | |
is_available_for_new_content | Boolean | The value for the toggle in the top right corner of the module editor in HubSpot. Determines if the module can be used in content. | true |
global | Boolean | Indicates whether the module is global or not | false |
content_types | Array | An array of content types that the module can be used within. One or more of:
[] instead of ["NONE"] .Note that this field was previously named host_template_types . Modules using the previous field name will continue to function, but it’s recommended to use content_types moving forward. | |
css_assets | Array | An array of CSS files that the module depends on. Supports relative paths.e.g. "css_assets": [{ "path": "../path/to/file.css" }] | [] |
css_render_options | Object | Set whether the module CSS renders asynchronously with async : true , false | {"async": false} |
js_assets | Array | An array of JavaScript files that the module depends on. Supports relative paths.e.g. "js_assets": [{ "path": "../path/to/file.js" }] | [] |
js_render_options | Object | Modifies the module JavaScript tag added to the rendered page. Options include:
| {"position":"footer"} |
inline_help_text | String | Help text that will be shown at the top of the module in a blue info box (limit 400 characters).Provides information necessary to use the module. If you have field-specific help text information to convey, refer to the help text field documentation. | null |
master_language | String | With translations enabled, the language code of the language the module’s fields were originally written in.e.g. en | |
placeholder | Object | Sets placeholder content for the module. Includes the following properties:
| |
categories | Array | An array containing up to three module categories.For example: "categories":["FORMS_AND_BUTTONS"] | |
content_tags | Array | An array of module tag objects containing the tag name and source of "USER" .For example: "content_tags": [{ "name" : "BUTTONS", "source" : "USER"``}] |
.svg
file and no larger in size than 10kb. For best results your icon should be simple and use only one color. Icons that use more than one color will be automatically converted for you. The default module icon that displays is a wrench and paint brush icon.
To add an icon using the design manager:
To add an icon when developing locally, open the module’s meta.json
file and add or edit the icon
parameter’s value to be an SVG from the file manager.
global
to true
.
You can also convert modules in a drag-and-drop template to global using the design manager.
hostTemplateTypes
property. Learn more about the available template types. Modules also can be hidden so that they can’t be added directly to pages through setting is_available_for_new_content
to false
. For example, this can be helpful for modules built for navigation menus and search.
You can update this in the design manager by clicking the Template type option in the right sidebar.
module.css
and module.js
to add CSS and JavaScript that will be added to all pages that include a module instance, dependencies that are shared between modules can be attached using css_assets
and js_assets
. Paths can be absolute or relative to the meta.json
file.
hs fetch --overwrite
to update the module for local development will overwrite the relative paths with absolute paths.meta.json
file as follows:
categories
array can contain up to three of the following categories (case-insensitive):
Category | Description |
---|---|
blog | Blog-specific modules, such as a recent post listing. |
body_content | Modules that are formatted to graphically showcase content, such as an image gallery. |
commerce | Commerce-specific modules, such as pricing cards. |
design | Modules that affect content structure and layout, such as accordions. |
functionality | Modules that include dynamic responses or behavior on the page, such as menus. |
forms_and_buttons | Modules that allow site visitors to input and submit data. |
media | Modules that contain elements such as images, icons, video, and banners. |
social | Social media-specific modules, such as social sharing. |
text | Modules that contain only text. |
content_tags
array can contain any of the following module tag objects (case sensitive):
Content types:
ACCORDION
ANIMATION
BLOG_POST
BUTTONS
CODE
CTA
FEED
FORM
ICON
IMAGE
LISTS
LOGO
MENU
RICH_TEXT
SLIDER
TEXT
VIDEO
BANNER
BLOG
BRANDING
CALCULATOR
CONVERSION
EMAIL
GALLERY
HEADERS
INTERACTION
LAYOUT
MAP
MULTIMEDIA
NAVIGATION
PROGRESS_BAR
SEARCH
SETTINGS
SOCIAL
TRANSLATION