Hi, I’m using Zendesk Help Center to build my help center and customizing the UI by editing the theme code. I’m wondering if it’s possible to create reusable files/components with common code (HBS/HTML elements) that can be included and reused in other components.
For example, I’d like to create a card.hbs file containing the code for a card component and reuse this code across multiple templates like home_page.hbs, category_page.hbs, and so on.
In Handlebars, this concept corresponds to partials. However, the Zendesk Help Center doesn’t support the use of the partials helper.
This feature would be extremely useful (or essential) for customizing themes. Themes have size limits in terms of MB, so reusable components would help avoid duplicating code, keeping the theme size smaller, and improving code readability. Without reusable components, code repetition makes maintenance harder, increases the risk of errors, and bloats the theme unnecessarily.
Upon reviewing our resources, the help center templating language is Curlybars, which is our serverside implementation of (a subset of) Handlebars, and you can't unfortunately register new helpers. We don't have any official documentation about this level of customization as Zendesk does not support or guarantee custom code as this fails outside of our support scope.
I was able to find a Community post where a member shared his insight into reusable components that you may find helpful for your use case: https://support.zendesk.com/hc/en-us/community/posts/4409515138970-Zendesk-s-Help-Center-theme-customization-part-2-How-we-use-open-source-tools
They have documented some information about how the Handlebars partials are used in this GitHub gist: Modular HC Handlebars Theming (https://gist.github.com/erikzen/636bd0861259dee433363f8082160029)
In case of any questions, please send them as well in this community post. Thank you!