Register Handlebars customizations¶
By default, builtin helpers and open-source Handlebars helpers are available. If these don't fit your requirements, you can still create your own custom helper or partial that you can use in your HTML templates or layout fields (ex: 'Cards' or 'Details List' layouts).
To avoid any conflict, each Web Part instance gets its own Handlebars isolated namespace (i.e. using
Handlebars.create()) meaning registering customizations in the global Handlebars namespace won't work (ex: using
To register a new Handlebars customization for the targeted Web Part (i.e. the Web Part instances where the extensibility library is registered and enabled):
In the library main entry point (i.e. the class implementing the
IExtensibilityLibraryin interface), register your customization using the
namespaceparameter corresponds to the targeted Web Part Handlebars isolated namespace:
From here, use the Handlebars API to add your customizations to this specific namespace. They will be availabe in templates for registered Web Part instances:
- To reference the deployed manifest id of your extension in the search web part see the Introduction.