HubL Supported Tags

Last updated:

This page is a comprehensive reference guide of the syntax and the available parameters for all HubL tags.  Each tag type below contains a sample of the basic syntax, as well as an example with parameters and code output.

Most of the tags in this page have default module equivalents, as a result those modules can be used within dnd_area and flexible columns.

Blog comments

A blog comments tag renders the comments embed code on a blog template. This Javascript embed code loads the comments form and comments, based upon your configuration in Content Settings.

Blog Comment Form module:
{% blog_comments "blog_comments" overrideable=False, label='Blog Comments' %}

Blog Comment Count module:
{% blog_comments "blog_comments" %}

Blog Comment listing for specific blog:
{% blog_comments "default_blog_comments" select_blog='359485112' %}
Parameter Type Description Default
limit
Integer

Sets maximum number of comments.

5000
select_blog
'default' or blog ID

Specifies which blog is connected to the comments embed. This parameter accepts arguments of either 'default' or a blog ID (available in the URL of the Blog dashboard). If want to use your default blog, this parameter is unnecessary.

default
skip_css
Boolean

Setting this option to True will stop the blog comments CSS from loading. 

false

Blog content

While drag and drop layouts include a blog content module, these modules are not created with a single tag. They instead use conditional logic to define how a blog post and a blog listing should render. You can learn more about coding blog templates here.

Adds a listing of blog posts based off of a set of parameters shared by posts across blogs. Posts are selected based off of their relevancy to the set parameters. For an example usage of the optional post_formatter parameter, see creating a related blog post listing with the blog related posts HubL tag.

Please note this tag does not generate a page/post level editable module, it is entirely configured with HubL.

{% related_blog_posts %}
{% related_blog_posts limit=2, blog_ids="1,2", tags="Sales enablement,Marketing", blog_authors="John Smith,Frank Smith", path_prefixes="/business-blog", start_date="2018-04-10", end_date="2018-04-10", blog_post_override="2783035366" %}
Parameter Type Description Default
blog_ids
Integer

The ID(s) of blog(s) to include posts from. Omit this parameter to use the default blog.

blog_post_ids
String

The ID(s) of a blog posts to use when finding relevant blog posts to list (comma separated). This parameter should only be used when the widget is appearing on pages, as on blog posts, it will default to the post the widget is appearing on.

blog_post_override
String

The ID(s) of a blog posts which should always show up in the returned listing, despite all other parameter values and filters (comma separated).

limit
Integer

 The max number of blog posts to list.

3
tags
String

The tag(s) that should be used to determine if a post is relevant (comma separated). If a blog post has one of these tags or a similar tag, the post’s relevancy is increased, improving its ranking in the listing.

start_date
datetime

Earliest published date.

end_date
datetime

Latest published date.

blog_authors
String

 The name(s) of authors to include posts from (comma separated).

path_prefixes
String

URL paths or subdirectories to include posts from (comma separated). If a blog post has a similar prefix in its path, the post’s relevancy is increased, improving its ranking in the listing.

post_formatter
String

The name of a custom macro to render returned blog posts. The macro is passed three parameters which are the blogs blog post object to format, the count in the iteration of blog posts, and the total count of blog posts in the results. If not specified or set to “default”, the built-in formatter will be used to format each post.

default

Blog social sharing

Blog social sharing renders share counters on your blog posts (if enabled in Content Settings).

{% blog_social_sharing "blog_social_sharing" %}
{% blog_social_sharing "blog_social_sharing" select_blog='359485112' %}
Parameter Type Description Default
select_blog
'default' or blog ID

Species which blog is connected to the share counters. This parameter accepts arguments of either 'default' or a blog ID (available in the URL of the Blog dashboard). If you want to use your default blog, this parameter is unnecessary.

default
downgrade_shared_url
Boolean

Use HTTP in the url sent to the social media networks. Used to preserve counts when upgrading domains to HTTPS only.

false

Blog subscription

A blog subscription tag renders the blog subscriber form for a particular blog. This form is automatically created whenever a blog is created in Content Settings, and there is always one subscription form per blog. Please note that the subscribe form's fields are configured within the Forms editor UI.

{% blog_subscribe "blog_subscribe" %}
{% blog_subscribe "subscribe_designers_blog" select_blog='default', title='Subscribe to the Designers Blog', response_message='Thanks for Subscribing!', label='Blog Email Subscription', overrideable=False %}
Parameter Type Description Default
select_blog
'default' or blog ID

Selects which blog subscription form to render. This parameter accepts arguments of either 'default' or a blog ID (available in the URL of the Blog dashboard). If want to use your default blog, this parameter is unnecessary.

default
title
String

Defines text in an h3 tag title above the subscribe form.

"Subscribe Here!"
no_title
Boolean

If True, the h3 tag above the title is removed.

false
response_message
String

Defines the inline thank-you message that is rendered when a user submits a form. Supports HTML.

"Thanks for Subscribing!"
edit_form_link
String

This parameter generates a link that allows users to click through to the corresponding Form editor screen. This option will only show in the editor UI if the modules has the parameter overrideable=True. Here is an example where HubID and form ID would be replaced with the information from the URL of your default blog subscriber form: edit_form_link=' <ul>\n <li><a href="/forms/HubID/FormID/edit/" target="_blank">Default Blog</a></li> \n</ul> '. \n drops the code onto a new line.

Boolean

A boolean tag creates a checkbox in the UI that prints "true" or "false." In addition to printing the value, this module is useful for defining conditional template logic, when combined with the parameter export_to_template_context

{% boolean "boolean" %}
{% boolean "nav_toggle" label='Hide navigation', value=False, no_wrapper=True %}
Parameter Type Description Default
value
Boolean

Determines whether the checkbox is checked or unchecked.

False

Choice

A choice tag creates a dropdown in the content editor UI that prints the value selected by the user. Choice tags are great for giving your users a preset set of options, such as printing the type of page as a page header.

In addition to printing the choice value, this tag is useful for defining conditional template logic, when combined with the parameter export_to_template_context

{% choice "choice" %}
{% choice "type_of_page" label='Choose the type of page', value='About', choices='About, Careers, Contact, Store' %}
Parameter Type Description
value
Boolean

The default field value for the dropdown

choices
Sequence

A comma-separated list of values, or list of value-label pairs. The syntax for value label pairs is as follows: choices='[[\"value1\", \"Label 1\"], [\"value2\", \"Label 2\"]]'. The editor will display the label, while it will print the value to the page.

Color

The color tag generates a color picker in the page editor UI that prints a HEX color value to a template. Please note that this module can only be used in templates, not CSS files. If using this tag in a <style> or inline CSS, you will want to use the no_wrapper=True parameter to remove the wrapper <span> wrapper.

{% color "color" %}
{% color "my_color_picker" label='Choose a color', color='#000000', no_wrapper=True %}
Parameter Type Description
color
String

A default HEX color value for the color picker

CTA

A Call to Action or CTA tag allows users to add a HubSpot Call to Action button to a predefined area of a page.

{% cta "cta" %}
{% cta "my_cta" label='Select a CTA', guid='ccd39b7c-ae18-4c4e-98ee-547069bfbc5b', image_src='https://no-cache.hubspot.com/cta/default/53/c7335b66-a0d4-4d19-82eb-75e1626d02d0.png' %}
Parameter Type Description
embed_code
String

The embed code for the CTA. \n differentiates line breaks.

full_html
String

The embed code for the CTA (Same as embed_code). \n differentiates line breaks.

image_src
String

Image src url that defines the preview image in the content editor.

image_editor
String

Markup for the image editor preview

guid
String

The unique ID number of the CTA. This ID number is available in the URL of the Details screen of a particular CTA. This parameter is used to choose which CTA to display by default.

image_html
String

CTA image HTML without the CTA script.*

image_email
String

Email-friendly version of the CTA code.*

*While these parameters are included here for the sake of being comprehensive, the code generated by HubSpot to populate them is very specific. If you need a default CTA selected, rather than trying to develop the CTA parameters from scratch, it is recommended that set up the CTA on a template layout, and then clone to file. You can then copy the HubL CTA module of the CTA with all parameters set correctly for you.

There is also a CTA function that generates a CTA from the ID.

Custom HTML

A custom HTML module allows users to enter raw HTML into the content editor. If you need to add extensive default HTML to the tag, you may want to use block syntax.

{% raw_html "raw_html" %}
{% raw_html "my_custom_html_module" label="Enter HTML here" value='<div>My HTML Block</div>' %}


Block Syntax Example:

{% widget_block raw_html "my_custom_html_module" overrideable=True, label='My custom HTML module'  %}
        {% widget_attribute "value" %}
            <div>Default HTML block</div>
        {% end_widget_attribute %}
{% end_widget_block %}
Parameter Type Description
value
String

Sets the default content HTML of the module.

Custom modules

Custom Modules allow HubSpot designers to create a custom group of editable content objects to be used across templates and pages on HubSpot’s CMS, while still allowing marketers to control the specific content appearing within those modules on a page-by-page basis. You can learn more about custom modules and their simplified HubL syntax, here.

Custom modules must be built in the Custom Module editor, but they can be included into coded templates and HubL modules. You will see a 'Usage Snippet' in the right sidebar of the Custom Module editor under 'Template Usage'.

Custom modules require the ID of the module as a string as well as a path parameter in order to specify which module to load. The usage snippet will also include a label parameter. See the syntax below:

{% module "module_15677217712485" path="/Custom/Test custom module"  %}
{% module "module_25642219712432" path="/Assets/Custom calendar module" label="Custom calendar module" %}
Parameter Type Description
module_id
String

The id of the module to render.

path
String

The path of the module to render. Include leading slash for absolute path, otherwise path is relative to template. Reference HubSpot default modules with paths corresponding to their HubL tags such as @hubspot/rich_text, @hubspot/linked_image, etc.

Email backup unsubscribe

The backup unsubscribe tag renders for email recipients, if HubSpot is unable to determine their email address, when that recipient tries to unsubscribe. This tag renders a form for the contact to enter his or her email address to unsubscribe from email communications. It should be used on an Unsubscribe Backup system template.

{% email_simple_subscription "email_simple_subscription" %}
{% email_simple_subscription "email_simple_subscription" header='Email Unsubscribe', input_help_text='Your email address:', input_placeholder='email@example.com', button_text='Unsubscribe', label='Backup Unsubscribe' %}
Parameter Type Description Default
header
String

Renders text in an h1 tag above the unsubscribe form.

"Email Unsubscribe"
input_help_text
String

Renders help text in an h3 tag above your email unsubscribe form field.

"Your email address:"
input_placeholder
String

Adds placeholder text within the email address form field.

"email@example.com"
button_text
String

Changes the text of the unsubscribe form submit button.

"Unsubscribe"

Email subscriptions

This module renders when an email recipient goes to edit his or her subscription preferences. It should be used on a Subscription Preference system template.

{% email_subscriptions "email_subscriptions" %}
{% email_subscriptions "email_subscriptions" resubscribe_button_text='Yes, resubscribe me!', unsubscribe_single_text='Uncheck the types of emails you do not want to receive:', subheader_text='\n    If this is not your email address, please ignore this page since the email associated with this page was most likely forwarded to you.\n', unsubscribe_all_unsubbed_text='You are presently unsubscribed from all of our emails. Would you like to receive our emails again?', button_text='Update email preferences', label='Subscription Preferences', header='Communication Preferences', unsubscribe_all_option='Unsubscribe me from all mailing lists.', unsubscribe_all_text='Or check here to never receive any emails:' %}
Parameter Type Description Default
header
String

Renders text in an h1 tag above the subscription preferences form.

"Communication Preferences"
subheader_text
String

Populates text below the heading above the unsubscribe preferences.

"<p>\n If this is not your email address, please ignore this page since the email associated with this page was most likely forwarded to you.\n</p>"
unsubscribe_single_text
String

Renders text in a <p class="header"> above the subscription options.

"Uncheck the types of emails you do not want to receive:"
unsubscribe_all_text
String

Renders text in a <p class="header"> above the unsubscribe from all emails checkbox input.

"Or check here to never receive any emails:"
unsubscribe_all_unsubbed_text
String

Populates text within a <p> that renders, if a contact is currently unsubscribed from all emails.

"You are presently unsubscribed from all of our emails. Would you like to receive our emails again?"
unsubscribe_all_option
String

Sets the text next to the unsubscribe from all emails checkbox input.

"Unsubscribe me from all mailing lists."
button_text
String

Sets the text of the submit button that updates subscription preferences.

"Update email preferences"
resubscribe_button_text
String

Sets the text of the submit button for when contacts are resubscribing.

"Yes, resubscribe me!"

Email subscriptions confirmation

The email subscriptions update confirmation is a module that can be added to the thank you template for when a recipient updates his or her subscription preferences or unsubscribes. It should be used on a Subscription Preference system template.

{% email_subscriptions_confirmation "email_subscriptions_confirmation" %}
{% email_subscriptions_confirmation "email_subscriptions_confirmation" label='Subscriptions Update Confirmation', unsubscribe_all_success='You have successfully unsubscribed from all email communications.', subscription_update_success='You have successfully updated your email preferences.', subheader_text='\n    If this is not your email address, please ignore this page since the email associated with this page was most likely forwarded to you.\n' %}
Parameter Type Description Default
header
String

Renders text in an h1 tag above the unsubscribe form.

"Communication Preferences"
subheader_text
String

Populates text above the confirmation message.

"<p>\n If this is not your email address, please ignore this page since the email associated with this page was most likely forwarded to you.\n</p>"
unsubscribe_all_success
String

Sets the text that will display when someone unsubscribes from all email communications.

"You have successfully unsubscribed from all email communications."
subscription_update_success
String

Sets the text when a recipient updates his or her subscription preferences.

"You have successfully updated your email preferences."

Flexible column

Flexible columns are vertical columns in a template that allow the end user to insert and remove a variety of modules of their choosing into the template, while editing in the content editor. When coding a flexible column with HubL, you can choose to wrap other HubL modules to make them appear in the flexible column by default. The sample code below shows the basic syntax and a sample flexible column with a rich-text and form module contained as default content. Please note that flexible columns can only be added to page templates, not blog or email templates.

{% widget_container "my_flexible_column" %}
    {% rich_text "my_rich_text" %}
    {% rich_text "second_rich_text" %}
{% end_widget_container %}

Modules cannot contain flexible columns, but they can contain repeatable fields and groups. This way you can create modules like carousels which contain slides that can be re-arranged, added, removed etc.

Form

Allows users to select a HubSpot form to add to their page.

{% form "form" %}
{% form "my_form" form_to_use='08bd9f0d-3be9-41c2-93b6-231a3a71b143', title='Free Trial' %}


Block Syntax Example:
{% widget_block form "my_form" form_follow_ups_follow_up_type='', response_redirect_id=306590405, form_to_use='08bd9f0d-3be9-41c2-93b6-231a3a71b143', title='Free Trial', notifications_are_overridden=True, sfdc_campaign='', response_message='Thanks for submitting the form.', response_response_type='redirect', response_redirect_url='', overrideable=True, gotowebinar_webinar_key='', response_redirect_name='Homepage (http://www.hubspot.com/)', label='Form', response={message='Thank you for submitting the form.', redirect_url=''}  %}
        {% widget_attribute "notifications_override_email_addresses" is_json=True %}["noreply@hubspot.com"]{% end_widget_attribute %}
{% end_widget_block %}
Parameter Type Description Default
form_key
String

Specifies a unique id for the form at the page level.

form_to_use
String

Specifies which form to load by default, based on the Form ID. This ID is available in the form editor URL of a each form.

title
String

Populates an h3 header tag above the form.

no_title
Boolean

 If True, the h3 tag above the title is removed.

False
form_follow_ups_follow_up_type
Enumeration

Specifies follow up actions such as enrolling a contact into a workflow or sending a simple follow up email. Possible values include: no_action, simple, and automation.

simple_email_for_live_id
Number

Specifies the ID of the simple follow-up email for the live page.

simple_email_for_buffer_id
Number

Specifies the ID of the simple follow-up email for the auto-save version of a page.

follow_up_type_simple
Boolean

If true, enables a simple follow-up email. Alternative to form_follow_ups_follow_up_type.

follow_up_type_automation
Boolean

If true, enrolls submissions in a workflow. Alternative to form_follow_ups_follow_up_type.

simple_email_campaign_id
Number

Specifies the ID of the simple follow-up email. Alternative to simple_email_for_live_id.

form_follow_ups_workflow_id
Number

Specifies the ID of the workflow in which to enroll submissions.

response_redirect_url
String

If redirecting to an external page, this parameter specifies the URL to redirect to.

response_redirect_id
Number

If redirecting to HubSpot hosted page, this parameter specifies the page ID of that page. The page ID is available in the page editor URL of each page.

response_response_type
Enumeration

Determines whether to redirect to another page or to display an inline thank you message on submission. The value of this parameter should either be 'redirect' or 'inline'.

inline
response_message
String

Sets an inline thank you message. This parameter supports HTML.

notifications_are_overridden
Boolean

If True, the form will send form notifications to specified email addresses selected in the notifications_override_email_addresses
parameter, instead of the form defaults

False
notifications_override_guid_buffer
String

ID of override settings in auto-save version of page.

notifications_override_guid
String

ID of override settings in live version of page.

notifications_override_email_addresses
JSON

Block syntax supports a JSON list of email recipients that will be notified upon form submission. These email addresses will override the email notification settings set in the form.

gotowebinar_webinar_key
String

Specifies the GoToWebinar webinar to enroll contacts who submit the form into. Only available for portals using the GoToWebinar integration.

sfdc_campaign
String

Specifies the Salesforce campaign to enroll contacts who submit the form into. This parameter's value should be the SFDC campaign ID and is only available for portals that are integrated with Salesforce.

Renders copyright information with the year and company name specified in Content Settings (Email > Footer Information).

{% page_footer "page_footer" %}

Generates a HubSpot gallery tag. This gallery tag is based on Slick. While you can create a gallery module with standard module HubL syntax, If you want to predefine default slides using HubL, you must use block syntax. Both methods are shown below.

{% gallery "crm_gallery" %}

<-- Block syntax -->
{% widget_block gallery "Gallery" display_mode='standard' sizing='static', transition='slide', caption_position='below', auto_advance=True, overrideable=True, description_text='', show_pagination=True, label='Gallery', loop_slides=True, num_seconds=5  %}
    {% widget_attribute "slides" is_json=True %}
        [{
            "caption": "CRM Contacts App", 
            "show_caption": true, 
            "link_url": "http://www.hubspot.com/crm", 
            "alt_text": "Screenshot of CRM Contacts", 
            "img_src": "http://go.hubspot.com/hubfs/Contacts-View-1.png?t=1430860504240", 
            "open_in_new_tab": true
        }, 
        {
            "caption": "HubSpot CRM Contact Profile", 
            "show_caption": true, 
            "link_url": "http://www.hubspot.com/", 
            "alt_text": "HubSpot CRM Contact Profile", 
            "img_src": "http://cdn2.hubspot.net/hubfs/53/Contact-Profile.png?t=1430860504240", 
            "open_in_new_tab": true
        }]
    {% end_widget_attribute %}
{% end_widget_block %}
Parameter Type Description Default
slides
JSON

A JSON list of the default caption, the link url, the alt text, the image src, and whether to open in a new tab. See block syntax above.

loop_slides
Boolean

When True, continuously loop through slides.

True
num_seconds
Number

Time in seconds to pause between slides.

5
show_pagination
Boolean

Provide buttons below slider to navigate among slides.

True
sizing
Enumeration

Determines whether the slider changes sizes, based on the height of the slides. Possible values include: "static" or "resize".

"static"
auto_advance
Boolean

Automatically advance slides after the time set in num_seconds.

False
transition
Enumeration

Sets the type of slide transition. Possible values include: "fade" or "slide".

"slide"
caption_position
Enumeration

Affects positioning of caption on or below the slide. Possible values include "below" or "superimpose".

"below"
display_mode
Enumeration

Determines how the image gallery will be displayed. Possible values include: "standard", "lightbox", "thumbnail".

"standard"
lightboxRows
Number

If "display_mode" is set to "lightbox", this parameter will control the number of rows displayed within the lightbox.

3

Generates a header module that will render text as an h1-h6 tag.

{% header "header"  %}
{% header "my_header" header_tag='h1', overrideable=True, value='A clear and bold header', label='Header' %}
Parameter Type Description Default
header_tag
String

Select which heading tag to render. Possible values include: h1, h2, h3, h4, h5, h6.

h1
value
String

Renders default text within the heading module.

"A clear bold header"

Image

Creates a image tag that allows users to select an image from the content editor. If you want the image to be linked to a destination URL, you should use linked_image below.

{% image "image" %}
{% image "executive_image" label='Executive photo', alt='Photo of Brian Halligan', src='//cdn2.hubspot.net/hub/53/file-733888619-jpg/assets/hubspot.com/about/management/brian-home.jpg', width='300' %}
Parameter Type Description Default
alt
String

Sets the default alt text for the image.

src
String

Populates the src attribute of the img tag.

width
Number

Sets the width attribute of the img tag.

The width of the image
height
Number

Sets a min-height in a style attribute of the img tag for email templates only.

The height of the image
hspace
Number

Sets the hspace attribute of the img tag.

align
String

Sets the align attribute of the img tag. Possible values include: left, right, & center.

style
String

Adds inline CSS declarations to the img tag. For example style="border:1px solid blue; margin:10px"

Image src

An image src module creates a image selector in the content editor, but rather than printing a img tag, it renders the URL of the image. This tag is generally used with no_wrapper=True parameter, so that the image src can be added to inline CSS or other markup. An alternative to using this tag is to use the export_to_template_context parameter.

{% image_src "image_src" %}
{% image_src "executve_image_src" src='//cdn2.hubspot.net/hub/53/file-733888614-jpg/assets/hubspot.com/about/management/dharmesh-home.jpg', no_wrapper=True %}
Parameter Type Description Default
src
String

 Specifies the default URL image src.

Language switcher

Adds a Globe Icon with links to the translated versions of a given CMS page. Learn more about multi-language content here.

{% language_switcher "language_switcher" overrideable=false, display_mode='localized', label='Language Switcher' %}
Parameter Type Description Default
display_mode
Enumeration

The language of the text in the language switcher. Values are:

  • Pagelang means the names of languages will display in the language of the page the switcher is on.
  • Localized means the name of each language will display in that language.
  • Hybrid is a combination of the two.
Localized

Linked image

Creates a user-selectable image that is wrapped in a link. This module has all of the parameters of an image module with two additional parameters that specify the link destination URL and whether the link opens in a new window.

{% linked_image "linked_image" %}
{% linked_image "executive_image" label='Executive photo', link="https://twitter.com/bhalligan", open_in_new_tab=True, alt='Photo of Brian Halligan', src='//cdn2.hubspot.net/hub/53/file-733888619-jpg/assets/hubspot.com/about/management/brian-home.jpg', width='300' %}
Parameter Type Description Default
alt
String

Sets the default alt text for the image.

src
String

Populates the src attribute of the img tag.

width
Number

Sets the width attribute of the img tag.

The width of the image
height
Number

Sets a min-height in a style attribute of the img tag for email templates only.

The height of the image
hspace
Number

Sets the hspace attribute of the img tag.

align
String

Sets the align attribute of the img tag. Possible values include: left, right, & center.

style
String

Adds inline CSS declarations to the img tag. For example style="border:1px solid blue; margin:10px"

open_in_new_tab
Boolean

Selects whether or not to open the destination URL in another tab.

False
link
String

Sets the destination URL of the link that wraps the img tag.

target
String

Sets the target attribute of the link tag.

A logo module renders your company's logo image from Content Settings.

{% logo "logo" %}
{% logo "my_logo" width='200' %}
Parameter Type Description Default
suppress_company_name
Boolean

Hides company name if an image logo isn't set.

False
alt
String

Sets the default alt text for the image.

Value in Content Settings
src
String

Populates the src attribute of the img tag.

Value in Content Settings
width
Number

Sets the width attribute of the img tag.

The width of the image
height
Number

Sets a min-height in a style attribute of the img tag for email templates only.

The height of the image
hspace
Number

Sets the hspace attribute of the img tag.

align
String

Sets the align attribute of the img tag. Possible values include: left, right, & center.

style
String

Adds inline CSS declarations to the img tag. For example style="border:1px solid blue; margin:10px"

open_in_new_tab
Boolean

Selects whether or not to open the destination URL in another tab.

False
link
String

Sets the destination URL of the link that wraps the img tag.

override_inherited_src
Boolean

If true, use src from logo widget rather than src inherited from settings or template.

True

Generates an advanced menu based on a menu tree in Content Settings > Advanced Menus.  See menus and navigation for more information on using menus in templates and modules. If id is set to null the menu tag will render the default menu for the HubSpot account.

{% menu "menu" %}
{% menu "my_menu" id=456, site_map_name='Default', overrideable=False, root_type='site_root', flyouts='true', max_levels='2', flow='horizontal', label='Advanced Menu' %}
Parameter Type Description Default
id
Integer

ID of Menu Tree from Advanced Menus in Content Settings.

site_map_name
String

Name of Menu Tree from Advanced Menus in Content Settings.

'default'
root_type
Enumeration

Specifies the type of advanced menus. Options include: "site_root", "top_parent", "parent", "page_name", "page_id", and "breadcrumb". These values correspond to static, dynamic by section, dynamic by page, and breadcrumb.

'site_root'
flyouts
String

When true, a class is added to the menu tree that can be styled to allow child menu items will appear when you hover over the parent. When false, child menu items will always appear.

'true'
max_levels
Integer

Determines how many levels of nested menus render in the markup. This parameter dictates number of menu tree children that can be expanded in the menu.

2
flow
Enumeration

Sets orientation of menu items. This adds classes to menu tree, so that they can be styled accordingly. Possible values include "horizontal", "vertical" or "vertical_flyouts". Horizontal menus display items side-by-side, and vertical menus are top-to-bottom.

'horizontal'
root_key
String

Used to find the menu root. When root_type is set to page_id or page_name, this param should be the page ID or the label of the page, respectively.

'horizontal'

Password prompt

Adds a password prompt to password-protected pages.

{% password_prompt "password_prompt" %}
{% password_prompt "my_password_prompt" submit_button_text='Submit', bad_password_message='Sorry, please try again.\n', label='Password Prompt' %}
Parameter Type Description Default
submit_button_text
String

 Label for button below password entry field.

'Submit'
bad_password_message
String

 Message displayed if incorrect password entered.

'<p>Sorry, please try again.</p>'
password_placeholder
String

 Defines placeholder text within the password field.

'Password'

Post filter

Creates a linked listing of posts by topic, posts by month, or posts by author.

This module can only be used in templates for Blog Post.

{% post_filter "post_filter" %}
{% post_filter "posts_by_topic" select_blog='default', expand_link_text='see all', overrideable=False, list_title='Posts by Topic', max_links=5, filter_type='topic', label='Posts by Topic' %}
Parameter Type Description Default
select_blog
'default' or blog ID

Selects the HubSpot blog to use. This parameter uses either an blog ID or 'default' value.

'default'
expand_link_text
String

 Text link to display if more posts than max_links number available. Exclude parameter to omit link.

'see all'
list_title
String

List title to display.

''
list_tag
String

Sets the tag used for the list. Value should generally be 'ul' or 'ol'.

'ul'
title_tag
String

Sets the tag used for the list title.

'h3'
max_links
Number

Maximum number of filter values to display. Excude parameter to show all.

5
filter_type
Enumeration

Selects the type of filter. Possible values include 'topic', 'month', and 'author'.

'topic'

Post Listing

Adds a listing of most popular or top posts.

This tag can only be used in templates for Blog Post. This tag's content is loaded asynchronously on the client-side. As a result, if you want to manipulate the feed after its loaded, you'll need to define a global JS function to handle that manipulation. Use the function hsPostListingComplete(feeds), where feeds is the jQuery selector on all feeds that have been completed. You will want to directly manipulate the DOM object in that function.

{% post_listing "post_listing" %}
{% post_listing "top_posts" select_blog='default', label='Recent Posts', overrideable=False, list_title='Recent Posts', listing_type='recent', max_links=5 %}
Parameter Type Description Default
select_blog
'default' or blog ID

 Selects the HubSpot blog to use for the listing. This parameter uses either an blog ID or 'default' value.

'default'
list_title
String

List title to display.

''
list_tag
String

Sets the tag used for the list. Value should generally be 'ul' or 'ol'.

'ul'
title_tag
String

Sets the tag used for the list title.

'h3'
listing_type
String

List the blog posts by most recent or most popular in a time range. Possible values include recent, popular_all_time, popular_past_year, popular_past_six_months, and popular_past_month.

'recent'
max_links
Number

 Maximum number of blog posts to list.

5
include_featured_image
Boolean

 Display featured image along with post link.

False

Require_css

A HubL tag that enqueues a style element to be rendered in the <head>. To enqueue a stylesheet from a different file to render in the <head /> via a <link /> tag (as opposed to inline as shown here), use the HubL function require_css(absolute_url) instead.

{{ standard_header_includes }}
<!-- more html -->

{% require_css %}
    <style>
        body {
            color: red;
        }
    </style>
{% end_require_css %}

{{ standard_footer_includes }}

Require_js

A HubL tag that enqueues a script element to be rendered. To enqueue a script to render in the <head />from a different file via a <script /> element (as opposed to inline as shown here), use the HubL function require_js(absolute_url) instead.

{{ standard_header_includes }}
<!-- more html -->

{% require_js position="footer" %}
    <script>
        console.log("The CMS is awesome!");
    </script>
{% end_require_js %}

{{ standard_footer_includes }}
Parameter Type Description Default
position
String

Set the position where the inline script will be rendered. Options include: "head" and "footer".

'footer'

Rich text

Creates a WYSIWYG content editor.

{% rich_text "rich_text" %}
{% rich_text "left_column" label="Enter HTML here" html='<div>My rich text default content</div>' %}


Block Syntax Example:


{% widget_block rich_text "right_column" overrideable=True, label='Right Column'  %}
    {% widget_attribute "html" %}
            <h2>Something Powerful</h2>
            <h3>Tell The Reader More</h3>
            <p>The headline and subheader tells us what you're offering, and the form header closes the deal. Over here you can explain why your offer is so great it's worth filling out a form for.</p>
            <p>Remember:</p>
            <ul>
                <li>Bullets are great</li>
                <li>For spelling out <a href="#">benefits</a> and</li>
                <li>Turning visitors into leads.</li>
            </ul>
    {% end_widget_attribute %}
{% end_widget_block %}
Parameter Type Description Default
html
String

Default rich text content for module.

<h2>Something Powerful</h2> <h3>Tell The Reader More</h3> <p>The headline and subheader tells us what you're offering, and the form header closes the deal. Over here you can explain why your offer is so great it's worth filling out a form for.</p> <p>Remember:</p> <ul> <li>Bullets are great</li> <li>For spelling out <a href="#">benefits</a> and</li> <li>Turning visitors into leads.</li> </ul>

RSS listing

Loads a list of content from an internal or external RSS feed.

This module is loaded asynchronously on the client-side. As a result, if you want to manipulate the feed after its loaded, you'll need to define a global JS function to handle that manipulation. Use the function hsRssFeedComplete(feeds), where feeds is the jQuery selector on all feeds that have been completed. You will want to directly manipulate the DOM object in that function.
{% rss_listing "rss_listing" %}
{% rss_listing "my_rss_listing" rss_url='', publish_date_text='posted at', feed_source={rss_url='', is_external=False, content_group_id='24732847'}, click_through_text='Read more', show_date=True, include_featured_image=True, overrideable=False, publish_date_format='short', show_detail=True, show_author=True, number_of_items='5', is_external=False, title='', content_group_id='24732847', label='RSS Listing', limit_to_chars='200', attribution_text='by' %}
Parameter Type Description Default
show_title
Boolean

 Shows or hides RSS feed title.

True
show_date
Boolean

Displays post date.

True
show_author
Boolean

Displays author name.

True
show_detail
Boolean

Display post summary up to number of characters set by limit_to_chars parameter.

True
title
String

Populates a heading above the RSS feed listing.

limit_to_chars
Number

Maximum number of characters to display in summary.

200
publish_date_format
String

Format for the publish date. Possible values include 'short', 'medium' and 'long'. Also accepts custom formats including "MMMM d, yyyy 'at' h:mm a".

'short'
attribution_text
String

The text which attributes an author to a post.

'by'
click_through_text
String

The text which will be displayed for the click through link at the end of a post summary.

'Read more'
publish_date_text
String

 The text which indicates when a post was published.

'posted at'
include_featured_image
Boolean

Displays featured image with post link for HubSpot generated RSS feeds.

False
item_title_tag
String

Specifies HTML tag of each post title.

span
is_external
Boolean

RSS feed is from an external blog.

False
number_of_items
Number

Maximum number of posts to display.

5
publish_date_language
String

Specifies the language of the publish date.

en_US
rss_url
String

 The URL where the RSS feed is located.

content_group_id
String

ID for blog when feed source is internal blog.

select_blog
String

Can be used to select an internal HubSpot blog feed.

default
feed_source
String

Set source for RSS feed. When internal, general format is {rss_url='', is_external=False, content_group_id='2502431580'}. When external, general format is {rss_url='http://blog.hubspot.com/marketing/rss.xml', is_external=True}.

tag_id
Number

ID for tag when feed source is internal blog.

Section header

Generates an <h1> header and <p> subheader.

{% section_header "section_header" %}
{% section_header "my_section_header" subheader='A more subdued subheader', header='A clear and bold header', label='Section Header'  %}
Parameter Type Description Default
header
String

Text to display in header.

'A clear and bold header'
subheader
String

Text to display in subheader.

'A more subdued subheader'

Simple menu

Simple menus allow you to create basic navigation menus that can be modified at the page level. Unlike regular menu modules, simple menus are not managed from the Navigation screen in Website Settings, but rather from the template and page editors. You can use block syntax to set up a default menu tree.

{% simple_menu "simple_menu" %}
{% simple_menu "my_simple_menu" orientation='horizontal', label='Simple Menu' %}


Block Syntax Example:


{% widget_block simple_menu "block_simple_menu" overrideable=True, orientation='horizontal', label='Simple Menu'  %}
        {% widget_attribute "menu_tree" is_json=True %}[{"contentType": null, "subCategory": null, "pageLinkName": null, "pageLinkId": null, "isPublished": false, "categoryId": null, "linkParams": null, "linkLabel": "Home", "linkTarget": null, "linkUrl": "http://www.hubspot.com", "children": [], "isDeleted": false}, {"contentType": null, "subCategory": null, "pageLinkName": null, "pageLinkId": null, "isPublished": false, "categoryId": null, "linkParams": null, "linkLabel": "About", "linkTarget": null, "linkUrl": "http://www.hubspot.com/internet-marketing-company", "children": [{"contentType": null, "subCategory": null, "pageLinkName": null, "linkUrl": "http://www.hubspot.com/company/management", "isPublished": false, "children": [], "linkParams": null, "linkLabel": "Our Team", "linkTarget": null, "pageLinkId": null, "categoryId": null, "isDeleted": false}], "isDeleted": false}, {"contentType": null, "subCategory": null, "pageLinkName": null, "pageLinkId": null, "isPublished": false, "categoryId": null, "linkParams": null, "linkLabel": "Pricing", "linkTarget": null, "linkUrl": "http://www.hubspot.com/pricing", "children": [], "isDeleted": false}]{% end_widget_attribute %}
{% end_widget_block %}
Parameter Type Description Default
orientation
Enumeration

Defines classes of menu markup to allow to style the orientation of menu items on the page. Possible values include 'horizontal' and 'vertical'.

'horizontal'
menu_tree
JSON

Menu structure including page link names and target URLs.

[]

Social sharing

Social sharing tags generate social media icons that can be used to share a particular page. This module can be used with block syntax to customize the icon images and more.

{% social_sharing "social_sharing" %}
{% social_sharing "my_social_sharing" use_page_url=True %}

Block Syntax Example:


{% widget_block social_sharing "my_social_sharing" label='Social Sharing', use_page_url=True, overrideable=True  %}
        {% widget_attribute "pinterest" is_json=True %}{"custom_link_format": "", "pinterest_media": "http://cdn1.hubspot.com/hub/158015/305390_10100548508246879_837195_59275782_6882128_n.jpg", "enabled": true, "network": "pinterest", "img_src": "https://static.hubspot.com/final/img/common/icons/social/pinterest-24x24.png"}{% end_widget_attribute %}
        {% widget_attribute "twitter" is_json=True %}{"custom_link_format": "", "enabled": true, "network": "twitter", "img_src": "https://static.hubspot.com/final/img/common/icons/social/twitter-24x24.png"}{% end_widget_attribute %}
        {% widget_attribute "linkedin" is_json=True %}{"custom_link_format": "", "enabled": true, "network": "linkedin", "img_src": "https://static.hubspot.com/final/img/common/icons/social/linkedin-24x24.png"}{% end_widget_attribute %}
        {% widget_attribute "facebook" is_json=True %}{"custom_link_format": "", "enabled": true, "network": "facebook", "img_src": "https://static.hubspot.com/final/img/common/icons/social/facebook-24x24.png"}{% end_widget_attribute %}
        {% widget_attribute "email" is_json=True %}{"custom_link_format": "", "enabled": true, "network": "email", "img_src": "https://static.hubspot.com/final/img/common/icons/social/email-24x24.png"}{% end_widget_attribute %}
{% end_widget_block %}
Parameter Type Description Default
use_page_url
Boolean

If true, the module shares the URL of the page by default.

True
link
String

Specifies a different URL to share, if use_page_url is false.

pinterest
JSON

Parameters for Pinterest link format and icon image source.

See block syntax example, above
twitter
JSON

Parameters for Twitter link format and icon image source.

See block syntax example, above
linked_in
JSON

Parameters for LinkedIn link format and icon image source.

See block syntax example, above
facebook
JSON

Parameters for Facebook link format and icon image source.

See block syntax example, above
email
JSON

Parameters for email sharing link format and icon image source.

See block syntax example, above

Spacer

A spacer tag generates an empty span tag. This tag can be styled to act as a spacer. In drag and drop layouts, the spacer module is wrapped in a container with a class of span1-span12 to determine how much space the module should take up in the twelve column responsive grid.

{% space "space" %}
{% space "spacer" label='Horizontal Spacer' %}

Text

Creates a single line of text. This tag can be useful to be mixed into your markup, when used in conjunction with the no_wrapper=True parameter. For example, if you wanted your end users to be able to define a destination of a predefined anchor, you could populate the href with a text module with no_wrapper=True.

{% text "text" %}
{% text "simple_text_field" label="Enter text here", value="This is the default value for this text field" %}
Parameter Type Description Default
value
String

Sets the default text of the single line text field.

Textarea

A textarea is similar to a text module in that it allows users to enter plain text, but it gives them a larger area to work in the content editor. This module does not support HTML. If you want to use directly within a predefined wrapping tag, add the no_wrapper=true parameter.

{% textarea "my_textarea" %}
{% textarea "my_textarea" label='Enter plain text block', value='Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean a urna quis lacus vehicula rutrum.', no_wrapper=True %}
Parameter Type Description Default
value
String

Sets the default text of the textarea.

Video Player

Render a Vidyard video player for a File Manager video which is selected "Allow embedding, sharing, and tracking".

{% video_player "embed_player" %}
{% video_player "embed_player" overrideable=False, type='scriptV4', hide_playlist=True, viral_sharing=False, embed_button=False, width='600', height='375', player_id='6178121750', style='', conversion_asset='{"type":"FORM","id":"9a77c63f-bee6-4ff8-9202-b0af020ea4b2","position":"POST"}' %}
Parameter Type Description Default
hide_playlist
Boolean

Hide the video playlist.

True
playlist_color
String

A HEX color value for the playlist.

play_button_color
String

A HEX color value for the play and pause buttons.

#2A2A2A
embed_button
Boolean

Display embed button on the player

False
viral_sharing
Boolean

Display the social networks sharing button on the player.

False
width
Number

Width of the embedded video player.

Auto
height
Number

Height of the embedded video player.

Auto
player_id
Number

The player_id of the video to embed. Returned at GET /filemanager/api/v2/files/:file_id in the meta.video_data.hosting_infos dict.

style
String

Additional style for player.

conversion_asset
JSON

Event setting for player. Can render CTA or Form before or after video plays. This parameter takes a JSON object with three parameters: type (FORM or CTA), id (The guid of the type object), position (POST or PRE).

See above example