Skip to main content

Modules {% module %}

Refer to: https://developers.hubspot.com/docs/cms/building-blocks/modules/using-modules-in-templates

You must first create a module before you can use this tag. Then, you can use this to reference a module and use it in a template. 


Module tag / Module name / Module Path / Parameters / 

  • Module name = gives the module a unique identity in the context of the template. 
  • Path = always start with @hubspot/ followed by the type of module (unless its custom).
  • Parameters = are comma-separated, key-value pairs
    • Requires double or single quotes
      • Boolean - no quotes needed for True or False values.
{% module "unique_module_name" path="@hubspot/module_type" %}

 

{# Basic syntax #}
{% module "unique_module_name" path="@hubspot/module_type",
  parameterString='String parameter value',
  parameterBoolean=True
%}

{# Sample of a default HubSpot text module #}
{% module "job_title" path="@hubspot/text",
  label="Job Title",
  value="Chief Morale Officer"
%}

{# Sample of a custom module #}
{% module "faqs" path="/myWebsite/modules/faq_module",
  label="Custom FAQ Module"
  faq_group_title="Commonly Asked Questions"
%}