Boilerplate v2.0.0
Project board: https://github.com/HubSpot/cms-theme-boilerplate/projects/7
New Features
- 🚀 #245 Updated blog templates to use the new template types of
blog_postandblog_listing(documentation on these template types can be found here). - 🚀 #291 Added drag and drop support to global content (documentation on using drag and drop and global content can be found here).
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
- 📘 Added an update to the upgrade guide on the Wiki
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:
- 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.
- Add a label of "Enable drag and drop" to the HubL tag or module.
- Leverage
export_to_template_contextso that you are able to use the value for this tag or module in your global partial. - 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.