Handlebars for Sitecore
I just finished extracting the Handlebar features from Sitecore Foundation into it's own stand alone Project on github. Handlebars for Sitecore is now a stand alone feature that can be installed without any dependencies on the rest of the Sitecore Foundation.
I've refactored the code to support both the regular Sitecore Renderings and SXA components as well as the SXA Rendering Variant type. After installing the Core Handlebars for Sitecore Package, you can opt to install the SXA addition to enable those features.
Here is a list of capabilities built into this module:
Container, Collection and Query Components allow you to bind Handlebar Templates to single, multiple or even Content Search Results.
Templates are only bound Server Side and support Personalization, AB Testing and Caching settings.
Includes Shared Source Code Editor field type, which supports auto complete, making editing templates a breeze.
Templates bind to custom Dynamic Item Model, which renders fields through the field renderer automatically to support editable content. Includes Navigation properties to navigate through children, parents, multi list and tree list fields automatically. Extendable through helper functions that can be defined in a Sitecore Pipeline.
OOB Helper Functions support conditionals, formatting, even Edit Frames and Placeholders.
Containers support custom JSON endpoints, binding to xDB Facets and even define Forms and Form processors.
SXA add on module adds ready to drop Toolbox components and Rendering Variant type that can replace all the other rendering variant types.
There's a lot of depth to this, and although some of the basic documentation is good, there are a lot of features that have not been written much about.
While I plan on submitting this is as a Marketplace module, I currently have a pre-release available to download and install on github itself. I've targeted Sitecore 9.1 for the core module and SXA 1.8 for the SXA extension if you're looking to leverage it.
Related Blog Posts: