Using the help center templating language

Return to top
Have more questions? Submit a request


  • Joakim Eide

    I've been looking all over this place for a way to extract the first or nth- element from an array in this Curlybars langauge, can anyone help me with that? EVERY example in this place uses the #each, as if it's impossible to get the first article when you have the data available?

  • Trapta
    Community Moderator

    Hi @Joakim Eide,

    You can use {{@index}} to get nth-element from an array. Please look at the below code to get an idea:

    {{#each categories}}
    {{#is @index 1}}
      // Your code goes here

    Let me know if this is what you are looking for.

    Team Diziana

  • Joakim Eide

    Thanks a lot Trapta! I feel like I somewhere read that Curlybars is based on Handlebars and does not have all the functionality. So I felt it natural to assume that the functionality describe on Zendesks template language pages reflects all available functions.

    I'll check handlebars documentation from now on before I ask questions! :)

  • intakhab ali

    hi, i am trying to create customize the community page I want a list of topic and list of post in the same page, is it possible

  • Devan - Community Manager
    Zendesk Community Team

    Hello Intakhab,

    This is possible through the use of custom code. I've gone ahead and linked an article below that describes how to begin this process in further detail.

    Customizing your Help Center

    Best regards!

  • Chris Cardone

    Would it be possible to hide/show content on the basis of user tags or user segment?


    {{#if user.tag 'agency'}}

    <div>Agency Specific Content</div>


  • Erika Camille Sundian
    Zendesk Community Team

    Hello Chris Cardone,

    You can specify tags in user segments. User segment is the way to hide/show content in your Help Center.
    Let me know if you have any questions! :)
  • Hugo Baeta

    Where can I find a list of conditionals?

    I was hoping to be able to do something like:


    {{#if template.homepage}}


  • Brett Bowser
    Zendesk Community Team

    Hey Hugo,

    Great question!

    You'll want take a look at our developer docs for a list of conditional helpers available.

    I hope this helps!

  • Hugo Baeta

    Hey Brett Bowser

    I should have clarified, I have been to that page and I'm aware of the conditionals, but there no list of Conditions...

    {{#if condition}}

    The only one listed in the article you linked in is the example

    {{#if article.internal}}

    article.internal is a condition. What other conditions can I use?


  • Charles Nadeau
    Zendesk Documentation Team

    Just to step in here quickly. A condition is anything that resolves to true or false. You basically create the condition you want to meet. Example:

    {{#if name == 'Foo'}}
  • Hugo Baeta

    Thanks Charles Nadeau

    That's great, but I'm not sure you understood my original question: I want to ask if I'm on the homepage... comething like:

    {{#if template.home}}

    Or something like that. A good example, for me, is the WordPress conditionals documentation, that lists the conditions, like `is_home()`

    On Zendesk themes, I've seen in Copenhagen or in many forum entries some conditionals like `if id xxx` or `if article.internal`. For example, I'm using the if ID to give me some classes to add specific styles to certain categories. But all of this has been a frustrating wackamole game, if I don't know what conditions I can ask for. :(

    I appreciate the help, I hope I'm making my issue clearer here :)

  • Augusto Silva
    Zendesk team member

    Hi Hugo Baeta,

    All the properties that are available in each page can be used together with an if statement.

    You'll probably be more interested in looking at the ones that return a boolean value.

    For example, if you look at the docs for the home page, you can see there's a help_center object available. If you follow the link to its properties, you'll see this object has the boolean property community_enabled. So, you can do this:

    {{#if help_center.community_enabled}}...{{/if}}


    Regarding your specific question about a template object that is currently not available. If you need to have a different header/footer for some of the pages, we recommend you leave those templates empty and add the code to the main template files.


    Hope this helps

  • Steve Graham

    Is there a way to create a custom boolean?  For example, we'd like to create a boolean called "legacyproduct" to use in an #if loop in order to attach a class to an element.

  • Kay
    Community Moderator

    Hi Steve,

    At the moment this doesn't appear to be possible with the Templating Language.
    I would recommend doing it with Javascript. And then map this there.

  • Ellis Simpson

    On category and section pages, I want to display the text from each article which is between each article's h1 tags (rather than what is in each title tag). 

    I assume the relevant code will go in category-page.hbs and section_page.hbs.

    This is, I think, what currently displays the title.

    <a class="article-list-item__link" href="{{url}}">{{title}}</a>

    Is such an action possible? If so, how in rough outline can you do that?


Please sign in to leave a comment.

Powered by Zendesk