Skip to content

Boilerplate v2.0.0

Choose a tag to compare

@jasonnrosa jasonnrosa released this 02 Feb 15:13
0e30368

Project board: https://github.com/HubSpot/cms-theme-boilerplate/projects/7

New Features

Feature Enhancements

  • 🚀 #323 Added styles to system templates to make them more visually appealing.
  • 🚀 #324 Added styles to account for alt text on a page.

Bug Fixes

  • 🐛 #321 Changed JavaScript used on the subscription preferences template to use a for each loop to account for multiple different subscription preferences.
  • 🐛 #327 Added conditionals to the button module to handle various href scenarios.

Documentation Updates

Upgrade Guide

To update your theme to use the new features in this release please follow the instructions below:

Drag and Drop in Global Partials

Drag and drop is now available within global partials. This can be added to your theme's global partials by adding dnd_area tags into your code similar to page templates. For more information on the drag and drop HubL syntax please check out our documentation here.

If you are creating a new theme or website, adding drag and drop areas to your global partials shouldn't result in a breaking change. If you would like to convert a global partial on an existing theme or website to use drag and drop this could result in a breaking change. To convert a global partial on an existing theme or website to use drag and drop without introducing a breaking change you can:

  1. Add a boolean HubL tag to the global partial that you'd like to convert to drag and drop. Alternatively, you can create a new module with a boolean field instead of using a HubL tag.
  2. Add a label of "Enable drag and drop" to the HubL tag or module.
  3. Leverage export_to_template_context so that you are able to use the value for this tag or module in your global partial.
  4. Create a conditional using the exported tag or module value. For example:
{% if enable_dnd %}
  {# DND area code #}
{% else %}
  {# Existing static HTML #}
{% endif %}

Please note that when editing the global partial in the editor, changing the value of the boolean HubL tag or module will not automatically refresh the editor. You'd have to update the value of that tag or module, save, and refresh.

Blog Template Types

There are two new template types for the blog including blog_listing and blog_post. Documentation for these template types can be found here. If you are using one template for both the blog listing and blog post, please continue to use the template type of blog. Otherwise, you can update your blog listing template to use the blog_listing template type and your blog post template to use the blog_post template type.