Default module versioning
Using versioning, HubSpot can release new versions of its default modules without impacting existing HubSpot content. For example, if HubSpot releases a new version of a default module, any templates that use the previous version of the module will continue to work as expected. HubSpot will only release a new version of a default module if the changes impact the editor experience or involve significant changes to the UI.
If multiple accounts are using your theme, each account may have different versions of a module. For example, the divider module can be either v0
or v1
. Therefore, you'll need to develop your theme to be compatible with all module versions. Below, learn more about how to develop your theme with versioning in mind, and which modules have multiple versions.
HubSpot automatically maps v0
fields to v1
fields, so referencing v0
fields will enable the theme to work with both v0
and v1
modules. Field references are not backwards compatible, meaning that HubSpot will not automatically map v1
field references to v0
fields.
To account for changes in an module's HTML, CSS, and JavaScript, you can use conditional statements to configure it depending on the account's available versions.
To add add a conditional statement, use get_asset_version("@hubspot/module-name")
within an HTML, CSS, or JavaScript file. The module's version will be returned as a string, enabling you to configure module options based on the returned version.
Below, learn more about the modules that currently support versioning.
A new version of the default divider module has been released to accounts created after August 25th, 2022 (changelog announcement). This version update impacts the following module files:
fields.json
module.html
Below, learn more about the new v1
version updates in each file, along with the original v0
version for comparison.
- All fields that were previously in the Content tab have been moved to the Styles tab.
- The following fields have moved, but HubSpot automatically links the previous references to the new field names, so you don't need to make any manual updates:
- The
height
field has been moved tostyles.line.thickness
. - The
width
field has been moved tostyles.size.width
. - The
color
field has been moved tostyles.line.color
. - The
line
type field has been moved tostyles.line.style
.
- The
- The
alignment
field, which was previously a choice field, has been replaced by a new field type of Alignment, and can be accessed understyles.alignment.alignment
. - The
padding
field, which was previously a number field, has been replaced by a new field type of Spacing, and can be accessed understyles.spacing.spacing
. - The
show_padding
field has been removed.
In v1
, styles applied to a horizontal rule are set via <style>
tags in the head of the page. In v0
, these are set via inline styles.
A new version of the language switcher module has been released.
This version update impacts the following module files:
meta.json
fields.json
module.html
module.css
module.js
Below, learn more about the new v1
version updates in each file, along with the original v0
version for comparison.
A placeholder
field has been added with the following options:
show_module_icon
(boolean): when set tofalse
, no icon will appear.title
(string): the placeholder title.description
(string): the placeholder descriptive text.
- Added a checkbox field for displaying an arrow in the language switcher to indicate a dropdown menu.
- Added options for content creators to select from several icon options:
icon
: select from a set of standard icons (default).none
: no icon.custom_icon
: select from previously uploaded images or upload a new image.
- Added an array of style fields for customization in the Styles tab.
The module no longer uses the language switcher HubL tag.
A new version of the default search input module has been released. This version update impacts the following module files:
fields.json
module.html
module.css
module.js
Below, learn more about the new v1
version updates in each file, along with the original v0
version for comparison.
Existing fields
- The
field_label
andplaceholder
text fields have been moved into thesearch
group. - The
include_search_button
toggle has been removed. - The
content_types
group has been moved into theresults
group.
New fields
- A
button
group has been added, which enables controls for:icon
: the search button's icon.button_label
: the search button's text label.
- A
results
group has been added, which enables controls for:use_custom_search_results_template
: toggle to choose which template is used for the search results page.path_id
: the ID of the page that will be used for search results. The referenced page must contain the search results module.
- A
default_text
group has been added, which allows for the translation of default content.
Style fields
The following style field groups have been added:
container
: fields for styling the module container's background color, border radius, and spacing.field_label
: fields for styling the module's label font and spacing.input
: fields for styling the search input's font, spacing, background color, border, and corner radius.button
: fields for styling the button's font, background color, border, corner radius, and spacing. Also includes options for hover styling and button positioning.autosuggest_results
: fields for styling the auto-suggested results box's background color, border, border radius, spacing, header font, suggestion link font, hover font, and hover background color.
v1
, the module's HTML contains:- More configuration options for the submit button, search input form action URL, and accessibility elements.
- In-editor markup to accurately depict what the module will look like in the content editor.
v1
, the module's CSS includes styling adjustments to better handle display options, responsive elements and accessibility.
v1
, the module's JavaScript contains:- Configurable search results template.
- Translation and accessibility support.
A new version of the default search results module module has been released. This version update impacts the following module files:
fields.json
module.html
module.css
module.js
Below, learn more about the new v1
version updates in each file, along with the original v0
version for comparison.
Existing fields
- The
display_featured_images
field has been moved to theresults
group and renamed todisplay_for_each_result
.
New fields
- A
title
group has been added, which enables controls for:show_title
: a toggle for whether the title displays.heading_tag
: the search results heading level (h1
by default).
- A
pagination
group has been added, which enables controls for pagination, such as showing the number of pages and the previous/next arrows and labels. - A
default_text
group has been added, which allows for the translation of default content.
Style fields
The following style field groups have been added:
container
: a field for styling the module container's spacing.title
: fields for styling the page's title font and capitalization options.results_count_message
: fields for styling the page's result count font and capitalization.featured_image
: fields for styling the featured image's size, aspect ratio, border, radius, and spacing.results
: fields for styling the returned result title and description fonts, as well as spacing between results.pagination
: fields for styling the pagination fonts, icon size, background colors, spacing, border, and corner radius. Includes options for hover styling.
In v1
, the module's HTML contains:
<style>
tags which enable styling adjustments.- No HTML template tag for markup.
- In-editor markup placeholders to show search results and reflect style adjustments in the content editor.
v1
, the module's CSS contains all new CSS to better handle responsive display and accessibility.v1
, the module's JavaScript contains:- Rebuilt code that uses the latest search API.
- Translation and accessibility support.
- Code for rendering search results and pagination.
Thank you for your feedback, it means a lot to us.