Templates are reusable page or email wrappers that generally place modules and partials into a layout. Content creators select a template to use before when creating a page or email.
hs create template
CLI command.
Parameter | Description |
---|---|
name | The template’s name |
dest | The path of the local directory that you want to create the template in. If not included, the template will be created in the directory you’re currently in. |
dnd_area
tags.dnd_area
tags.dnd_area
tags can only be swapped for other coded templates without dnd_area
tags.templateType
are only visible for template selection when creating an email.
In order to stay CAN-SPAM compliant, email templates have a set of required variables that must be included.
Email templates also have a built-in functionality to inline-css added to <style>
elements with a special class name or data attribute. Inlining CSS in emails is a method used to get better support across email clients. Fortunately, most of the popular email clients now support embedded css, that however is not representative of your specific recipients. Use good judgment to do what is right by your recipients.
Learn more about building email templates.
blog_listing
, blog_post
, or blog
, templateType
do not appear when a user is creating a web page, in the template selection screen. Blog templates actually have two forms, blog listing pages and blog post detail pages.
blog_post
, or blog_listing
, instead.
blog_post
, and blog_listing
templateTypes
instead of combined templates.{% email_subscriptions "email_subscriptions" %}
HubL Tag. See the subscription preferences template in the cms-theme-boilerplate.
{% email_simple_subscription "email_simple_subscription" %}
HubL tag. See the email backup unsubscribe template in the cms-theme-boilerplate.
{{ unsubscribe_link_all }}
variable. See the subscription confirmation template in the cms-theme-boilerplate.
{% member_login "member_login" %}
module. See the example membership login template in the boilerplate.
{% member_register "member_register" %}
HubL Tag. See the example membership registration template in the boilerplate.
{% password_reset "password_reset" %}
HubL Tag. See the example membership password reset template in the boilerplate.
{% password_reset_request "password_reset_request" %}
HubL Tag. See the example membership password reset request template in the boilerplate.
standard_header_includes
HubL variable.
In Settings > Website > Pages, you can change the jQuery version to 1.11.x, version 1.7.1, or disable it completely. You can also choose to include a jQuery migrate script for backward compatibility with older browsers. You can move jQuery to the footer to improve page performance, but moving jQuery can break JavaScript relying on it. It’s recommended to test this out before moving it by adding ?hsMoveJQueryToFooter=True
to the end of your website page URLs.
While jQuery was historically included by default, currently CMS Hub does not require jQuery. Most of jQuery’s functionality now has modern vanilla javascript equivalents, and it’s recommended to use them instead. If you need to use jQuery, we encourage disabling the default version in settings and using the latest version loaded above the </body>
tag.
To test if removing jQuery on your site will break anything, add ?hsNoJQuery=true
to the end of the URL while viewing your site, especially pages with heavy interactivity.
required_base.css
, this file is responsible for styling HubSpot’s responsive grid. This file is automatically included in any drag and drop template, but is not included by default in custom coded templates. When using dnd_area tags in coded HTML + HubL templates, you don’t need to load the layout.css
file, but a version of it is included in the CMS boilerplate to make it easier to get up and running quickly.
In addition to the responsive grid CSS, the file includes some classes that can be used to show and hide elements at different viewports. To learn more, view the file directly.
your_HubID.js
(example: 158015.js
). This tracking code is directly integrated with HubSpot’s GDPR functionality.