Last modified: August 22, 2025
HubSpot templates can use a host of predefined variables that can be used to render useful website and email elements. This page is a reference listing of those variables. Learn more about creating your own variables in a HubL template or module. While most of the variables listed on this page are optional, there are a few variables that are required for creating emails and pages from your templates.
The variables listed below can be used individually by wrapping them in the }} delimiter as noted on our Variables and Macros page. You can optionally use these variables with other parts of the HubL templating language such as loops, filters, functions, tags, and more.

Variables available in all templates

The HubL variables below can be used in email, page, or blog templates. To see additional information about what these variables output, you can use the pprint filter, as shown below.
{% set variable = content %}
{{variable|pprint}}
VariableTypeDescription
accountDictA dictionary that stores company property values from a known contact’s primary associated company. You can access specific company properties (both custom and default) via this variable by adding a period followed by the internal property name. For example, account.name would print the name of the primary company associated with the contact.

Using this variable will disable page caching. Learn more about page prerendering and JavaScript alternatives.
company_domainStringPrints the company domain set in Website > Pages > Branding > Logo link.
contactDictA dictionary that stores contact property values for a known contact. You can access specific contact properties (both custom and default) via this variable by adding a period followed by the internal property name. For example, contact.firstname would print the contact’s first name.

Using this variable will disable page caching. Learn more about page prerendering and JavaScript alternatives.
contentDictA dictionary that stores various properties pertaining to a specific piece of content such as an email, a page, or a post.
content.absolute_urlStringPrints the full URL of a page, post, or web page version of an email.
content.archivedBooleanEvaluates to true if the page or email was marked as archived by the user.
content.author_emailStringThe email address of the content creator.
content.author_nameStringThe first and last name of the content creator.
content.author_usernameStringThe HubSpot username of the content creator.
content.campaignStringThe GUID for the marketing campaign that this page or email is associated with. This unique ID can be found in the URL of a particular campaign in the Campaign’s tool.
content.campaign_nameStringThe name of the marketing campaign that this page, this post, or this email is associated with.
content.createdDatetimeA datetime object for when the content was originally created, in UTC time. This variable can be formatted with the datetime filter.
content.meta_descriptionStringWhen pulling the meta description of a page, it is better to use the variable page_meta.meta_description.
content.nameStringThe name of a post, email, or page. For pages and emails this will print the internal content name, while for posts this will print the post title. For blog posts, this is the post title that displays. For other types of content, this is generally an internal name. This variable includes a wrapper so that it is editable via the UI, when included in blog posts. If you want to print the content name without a wrapper, use page_meta.name.
content.publish_dateDatetimeA datetime object representing when the content was published, in UTC time. This variable can be formatted with the format_datetime filter.
content.publish_date_localizedStringA string representing the datetime when the content was published using the time zone defined in the account’s default settings. This variable is also subject to the language and date format settings.
content.template_pathStringThe Design Manager file path to your template (ie custom/page/web_page_basic/my_template.html).
content.slugStringThe URL slug of a page, post, or web page version of an email. This is the value that follows the domain. For example, in https://example.com/about-us, the slug is about-us. For the full URL, use content.absolute_url instead.
content.updatedDatetimeA datetime object for when the user last updated the content, in UTC time. This variable can be formatted with the datetime filter. Does not equal content.publish_date on initial publish. Use the |between_times filter to test if a post has been updated after publishing.
content_idStringPrints the unique ID for a page, post, or email. This ID can be found in the URL of the editor. You can use this variable as an alias for content.id.
favicon_linkStringPrints the source URL of the favicon. Learn more about setting favicons in HubSpot.
hub_idStringThe ID of your HubSpot account.
hubspot_analytics_tracking_codeStringIncludes the analytics tracking code. This tag is not necessary, because standard_footer_includes, already renders the tracking code.
local_dtDatetimeA datetime object of the current time in the time zone defined in your Report Settings. Usage of this variable will disable page caching in order to return the current time. Learn more about page prerendering and JavaScript alternatives.
local_time_zoneStringThe time zone, as configured in your HubSpot Report Settings.
page_meta.canonical_urlStringThe official URL that this page should be accessed at. Usually does not include any query string parameters. Use this for the rel="canonical" tag. HubSpot automatically canonicalizes URLs.
page_meta.html_titleStringThe title of the page. This variable should be used in the <title> tag of HTML templates.
page_meta.meta_descriptionStringThe meta description of a page. This variable should be used in the “description” <meta> tag of HTML templates.
page_meta.nameStringAn alias for content.name.
portal_idStringAn alias for the hub_id variable.
request_contactDictA dictionary containing data about the requested contact. Not available in email templates. Using this variable will disable page caching. Learn more about page prerendering and JavaScript alternatives.
site_settingsDictA dictionary containing various page, blog, and email settings, including colors and fonts and email footer details.
yearStringPrints the current year.

Email variables

Below are the HubL variables that can be used in email templates. Some variables, such as the color and font settings variables, can be used in other content types if you want to reference your email color and font settings elsewhere.

Required email template variables

To be CAN-SPAM compliant, all emails sent through HubSpot require certain company and opt-out information. This information is set by the following variables, which must be included. Values for these tokens are pulled from the account’s marketing email settings. There are additional email variables that are optional which are listed further down this page.
VariableTypeDescription
site_settings.company_cityStringPrints the company city.
site_settings.company_nameStringPrints the company name.
site_settings.company_stateStringPrints the company state.
site_settings.company_street_address_1StringPrints the company address.
unsubscribe_linkStringPrints the URL of the page that allows recipients to manage subscription preferences or unsubscribe from email communications. This variable should be used in the href attribute of an <a> anchor tag.

Color and font settings

There are several basic color and font controls in your marketing email settings that can be printed to emails. Where noted, you can use some of these variables on page and blog templates by adding site_settings. before the variable.
VariableTypeDescription
background_colorStringBackground color setting as a hex value. To print this value in page or blog templates, use site_settings.background_color.
body_border_colorStringBody border color setting as a hex value. This option becomes available when you select Manually set email border color under the Border color options dropdown menu in settings. To print this value in page or blog templates, use site_settings.body_border_color.
body_border_color_choiceStringThe value for this variable is controlled by the Border color options dropdown menu in settings. Values are: BORDER_AUTOMATIC, BORDER_MANUAL, BORDER_NONE. To print this value in page or blog templates, use site_settings.body_border_color_choice.
body_colorStringBody color setting as a hex value. To print this value in page or blog templates, use site_settings.body_color.
primary_accent_colorStringPrimary accent color setting as a hex value. To print this value in page or blog templates, use site_settings.primary_accent_color.
primary_fontEnumerationPrimary font setting as a string. To print this value in page or blog templates, use site_settings.primary_font.
primary_font_colorStringPrimary font color setting as a hex value. To print this value in page or blog templates, use site_settings.primary_font_color.
primary_font_sizeStringPrimary font size setting as a px value. For blog templates, use site_settings.primary_font_size.
primary_font_size_numNumberPrimary font size number, excluding px.
secondary_accent_colorStringSecondary accent color setting as a hex value. To print this value in page or blog templates, use site_settings.secondary_accent_color.
secondary_fontEnumerationSecondary font setting as a string. To print this value in page or blog templates, use site_settings.secondary_font.
secondary_font_colorStringSecondary font color setting as a hex value. To print this value in page or blog templates, use site_settings.secondary_font_color.
secondary_font_size_numStringSecondary font size number, excluding px.

Email content

VariableTypeDescription
content.create_pageBooleanWill be True if there is a web page version of the email.
content.email_bodyRichtextThe main body of the email. This variable renders a rich text module.
content.emailbody_plaintextStringThe optional override of the plain text email body.
content.from_nameStringThe from name of the email sender.
content.reply_toStringThe reply-to address for the email.
content.subjectStringThe subject of the email.
email_body_paddingstringThe email body padding setting.
email_body_widthStringThe email body width setting.
site_settings.company_street_address_2StringPrints the address line 2 from the account’s CAN-SPAM footer settings.
site_settings.office_location_nameStringPrints the office location name from the account’s CAN-SPAM footer settings.
subscription_confirmation_urlStringPrints the URL of the subscription preferences confirmation page. This URL is dynamically generated on send.
subscription_nameStringPrints the name of the email type specified for that email.
unsubscribe_anchorStringGenerates an anchor tag with the word “unsubscribe” linked to your unsubscribe page.
unsubscribe_link_allStringRenders a link to unsubscribe from all email communications, as opposed to a link to manage subscription preferences.
unsubscribe_sectionStringRenders an unsubscribe section that includes an unsubscribe link, as well as help text.
view_as_page_sectionStringGenerates a link with help text that leads to a webpage version of an email.
view_as_page_urlStringGenerates a link that leads to a webpage version of an email.

Private content email variables

The following list of variables are only available inside of email templates that are used for private content email templates.
VariableTypeDescription
membership_company_nameStringThe company name, as set in the account’s private content settings.
membership_domainStringThe domain of the private content website.
membership_logo_srcStringThe URL of the logo to display, as set in the account’s brand kit settings.
membership_logo_altStringThe logo’s alt attribute, as set in the account’s brand kit settings.
membership_registration_linkURLLink to the registration page for the private content website.
membership_password_saved_linkURLLink to the password saved page. The link will redirect the visitor to a random restricted page that they have access to.
membership_password_reset_linkURLLink to the reset password page for the private content website.
membership_passwordless_auth_linkURLLink to the password-less member login page.
membership_verify_registration_linkURLLink for the registration verification page.
membership_website_adminStringThe name of the website admin, as set in the account’s private content settings.

Website page variables

The following variables are available for site pages, landing pages, system pages, and blogs.

Required page template variables

To publish a coded file as an editable page or blog template, the following variables must be included. To publish an HTML file without these variables, to use within another template, include isAvailableForNewContent: false in the template annotations.
VariableTypeDescription
standard_footer_includesStringRenders the HubSpot tracking code and any other code included in your Footer HTML in Content Settings or the options of a particular page. This tag should be inserted directly before the closing body tag.
standard_header_includesStringAdds jQuery, layout.css, any attached stylesheets, a meta viewport tag, Google Analytics tracking code, other page meta information, and code added to the head tag at the domain/template/page level. This variable should be added to the <head> of HTML templates.

Content and contact variables

VariableTypeDescription
builtin_body_classesStringDynamically prints helpful classes that differentiate the markup of content created with that template (i.e., type of content and content name). This makes styling different types of content or particular pages easier. This variable should be used in the class attribute of the body tag on coded templates.
request_contact.is_logged_inStringWhether or not the requesting contact is logged in to a website’s private content. The value of this variable will return true if the requesting contact is logged in, and false if the requesting contact has logged out. A contact can be logged out by directing them to https://<www.yourdomain.com>/_hcms/mem/logout using one of your connected domains.

Using this variable will disable page caching. Learn more about page prerendering and JavaScript alternatives.
request_contact.list_membershipsStringA dictionary of IDs that represents the lists of which the contact is a member. Using this variable will disable page caching. Learn more about page prerendering and JavaScript alternatives
content.languageDictA dictionary of information about the language settings of a page.
  • content.language.languageTag returns the language identifier of a page (e.g., "en" or "es").
  • content.language.textDirection.value returns the text direction of the language of the page (e.g., "rtl" or "ltr").

HTTP request variables

The following variables print information about the HTTP page request. Some of these variables will prevent page caching due to needing to dynamically populate data at page load. Learn more about page prerendering and JavaScript alternatives.
VariableTypeDescription
request.cookiesDictA dictionary of cookie names mapped to cookie values. Using this variable will disable page caching.
request.domainStringThe domain used to access this page.
request.full_urlStringThe URL used to access this page.
request.pathStringThe path component of the URL.
request.path_and_queryStringThe path and query component of the URL.
request.queryStringThe query string component of the URL. request.query_dict automatically splits the query strings into key value pairs, and is recommended over the raw query for most use-cases.
request.query_dictDictThe query string converted into a name->value dictionary.
request.referrerStringThe HTTP referrer, the url of the page that linked to the current page. Using this variable will disable page caching.
request.remote_ipStringThe IP address of the visitor. Using this variable will disable page caching.
request.schemeStringThe protocol of the request (either http or https).
request.search_engineStringThe search engine used to find this page, if applicable (e.g., google, aol, live, yahoo, images.google).
request.search_keywordStringThe keyword phrase used to find this page, if applicable.
request.headersStringA dictionary of available request headers. Usage of this variable will disable page caching in order to interpret individualized headers for each request.

Blog variables

The following variables are available for blog templates. Some variables are only available for post listings, while others may only be available for blog posts.
VariableTypeDescription
blog_authorStringThis variable contains blog author information for blog author listing pages. It can be used to create conditional logic to render markup for blog author listings. It also contains the following properties:
  • blog_author.avatar
  • blog_author.bio
  • blog_author.display_name
  • blog_author.email
  • blog_author.facebook
  • blog_author.google_plus
  • blog_author.has_social_profiles
  • blog_author.linkedin
  • blog_author.twitter
  • blog_author.website
content.blog_post_authorStringThis variable contains individual blog post author information for a given post. It contains the following properties:
  • content.blog_post_author.avatar
  • content.blog_post_author.bio
  • content.blog_post_author.display_name
  • content.blog_post_author.email
  • content.blog_post_author.facebook
  • content.blog_post_author.google_plus
  • content.blog_post_author.has_social_profiles
  • content.blog_post_author.linkedin
  • content.blog_post_author.slug
  • content.blog_post_author.twitter
  • content.blog_post_author.website
blogStringAn alias for group. For example, you can use either blog.absolute_url or group.absolute_url.
content.comment_countIntegerThe number of comments for the current blog post.
content.comment_listStringA list of the comments for the current blog post.
current_page_numIntegerThe integer index of the current page of blog posts in the view.
content.featured_imageStringThe source URL of the featured image, selected when the blog was published.
content.featured_image_alt_textStringThe alt text of the featured image.
last_page_numIntegerThe integer index of the last page of blog posts in the view.
next_page_numIntegerThe integer index of the next page of blog posts in the view.
content.next_post_featured_imageStringThe URL of the featured image of the next blog post, if one exists.
content.next_post_featured_image_alt_textStringAlt text for the next post’s featured image if alt text exists.
content.next_post_nameStringThe name of the next blog post, if one exists.
content.next_post_slugStringThe URL slug of the next blog post, if one exists.
content.post_bodyStringThe body of the blog post.
content.post_list_contentStringThe body blog post content, modified for the listing page. The final output is affected by the blog’s summary settings. If featured images are enabled in settings, this variable will remove any images above the read more separator automatically.
content.post_list_summary_featured_imageStringThe featured image of post summaries to be used in the blog listing template, as set in blog settings.
content.post_summaryStringThe blog post summary. This content is determined by the read more separator in the blog editor.
content.previous_post_featured_imageStringThe URL of the featured image of the previous blog post, if one exists.
content.previous_post_featured_image_alt_textStringAlt text for the previous post’s featured image if alt text exists.
content.previous_post_nameStringThe name of the previous blog post, if one exists.
content.previous_post_slugStringThe URL slug of the previous blog post, if one exists.
content.publish_date_localizedStringA string representing the date/time when the blog post was published, formatted according to the blog’s language and date formatting settings.
simple_list_pageBooleanWhether the requested page is the ‘all posts’ page containing links to all blog posts.
content.topic_listDictCan be used to render markup for a topic listing by looping through it. {% for topic in content.topic_list %} The items within contain the properties: name and slug.
contentsStringA sequence of your blog posts that are iterated through using a for loop, available on blog listing pages.
contents.total_countIntegerTotal number of posts in a listing (regular, topics, authors, etc.).
contents.total_page_countIntegerTotal number of pages of posts based on your number of posts per page.
contents_topicsStringGet a list of all blog topics in the contents sequence of posts.
groupDictA dictionary containing variables that pertain to an entire blog.
group.absolute_urlStringThe base URL of a blog.
group.allow_commentsBooleanEvaluates to true if comments are allowed.
group.descriptionStringThe meta description of the blog, as set in blog settings. Used for the meta description on certain listing pages.
group.headerStringThe header of the blog.
group.html_titleStringThe title of this blog as it should appear in the <title> tag.
group.idStringThe unique ID of a blog. This ID can be found in the URL of the Blog Dashboard for a particular blog.
group.languageDictA dictionary containing information about a blog’s language. group.language.languageTag can be used in conditionals to render different content on the different language variations of a multi-language blog.
group.public_titleStringThe title of this blog as it should appear at the top of rendered pages.
group.show_summary_in_listingBooleanWhether post summaries are displayed on the blog listing page, as set in blog settings.
group.slugStringThe path to this blog.
group.use_featured_image_in_summaryBooleanWhether featured images are shown in post summaries, as set in blog settings.
archive_list_pageBooleanEvaluates to true if page is a blog archived page. Ex: https://www.example.com/blog/archive/2020/02 would return true.

CRM object dynamic pages

The following variables are used to build dynamic pages with CRM objects. These variables are only available for CRM object dynamic pages.
VariableTypeDescription
dynamic_page_crm_objectDictThe CRM object of the dynamic page that matches with the page request path. If the request is to the listing page, this value will be null.
dynamic_page_crm_object_type_fqnStringThe fully qualified name (FQN) of the crm object. The FQN is an assigned unique ID for the object, including the ID of your HubSpot account and the object name. The FQN can be used in the crm_objects function.

HubDB variables

The following variables are used to build dynamic pages with HubDB. These variables are only available for HubDB dynamic pages.
VariableTypeDescription
dynamic_page_hubdb_table_idLongThe ID of the table selected in the Advanced settings tab of the page editor.
dynamic_page_hubdb_rowDictThe HubDB row of the dynamic page that matches with the page request path. If the request is to the listing page, this value will be null.
row.hs_idLongThe internal ID of a HubDB row.
row.hs_nameStringThe name of the HubDB row.
row.hs_pathStringThe path of the HubDB row. Used to resolve a request to one row in the table specified by dynamic_page_hubdb_table_id.
row.hs_child_table_idLongThe child table ID of the HubDB row. Can be used to build nested templates.
row.hs_parent_rowDictThe parent row of the HubDB row. Can only be used when using child tables for nested templates.
dynamic_page_route_levelIntegerCurrent depth of a page in a multi-level dynamic template. The value starts at 0 and increments with each additional table layer.
The following variables are available to use on the object returned by the HubL menu function.
VariableTypeDescription
node.labelStringThe menu label of the page.
node.urlStringURL of the page.
node.pageIdNumberID of the page if within HubSpot.
node.contentGroupIdNumberBlog ID of the page if it is a HubSpot blog post.
node.parentNodeObjectThe parent node of the current node. The parent node will have the current node in its children property.
node.childrenListThe list of child nodes for the current node.
node.activeBranchBooleanEvaluates to true if the node is in the top-level branch that the current page is in.
node.activeNodeBooleanEvaluates to true if the node is the current page.
node.levelNumberThe number of levels deep the current node is from the top-level nodes.
node.pageTitleStringName of the content page if within HubSpot.
node.slugStringPath slug of the page.
node.linkTargetStringLink target of the page.

In-app editor and preview variables

You can use the following variables to check if the content is being rendered in the content editor or previewer. For example, you may want to use these to prevent running code in the editor while still running the code on live pages.
{% if is_in_page_editor %}
Display something different within the page editor.
{% endif %}
VariableTypeDescription
is_in_hs_appStringReturns true if content is being rendered within the HubSpot app.
is_in_editorStringReturns true if content is being rendered within any content editor.
is_in_global_content_editorStringReturns true if content is being rendered within the global content editor.
is_in_theme_editorNumberReturns true if content is being rendered within the theme editor.
is_in_page_editorStringReturns true if content is being rendered within the page editor.
is_in_blog_post_editorStringReturns true if content is being rendered within the blog post editor.
is_in_email_editorStringReturns true if content is being rendered within the email editor.
is_in_previewerNumberReturns true if content is being rendered within any preview context.
is_in_theme_previewerObjectReturns true if content is being rendered within the theme previewer.
is_in_template_previewerStringReturns true if content is being rendered within the template previewer.
is_in_page_previewerStringReturns true if content is being rendered within the page previewer.
is_in_blog_post_previewerStringReturns true if content is being rendered within the blog post previewer.
is_in_email_previewerStringReturns true if content is being rendered within the email previewer.
is_in_module_previewerStringReturns true if content is being rendered within the module previewer.