Help Center - Reusable Components? | Community
Skip to main content

Help Center - Reusable Components?

  • November 26, 2024
  • 3 replies
  • 0 views

Enrico11

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.

3 replies

David198
  • November 27, 2024

@enrico11 I recommend you reach out to the Zenplates team (https://www.zenplates.co/patterns). They are doing some really interesting work along these lines that might be helpful for you.


Enrico11
  • Author
  • November 28, 2024

Hi David,

Thank you so much for your response!

 

If I understand, I need to purchase a theme from the Zenplates Partner, and their themes provide additional features such as Utils, Patterns (reusable components), and Microtemplates. Unfortunately, we have already purchased a bundle of themes from another Zendesk Partner.

 

Isn’t there a way to achieve this independently of the theme? Specifically, to define a component with shared code in the assets or templates folder and include it in a Zendesk template page to display that component?


Jupete
  • May 27, 2025
Hello Enrico, thanks for writing in! 
 
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!