Using the Help Center templating language (Guide Professional and Enterprise) Follow

Comments

17 comments

  • Avatar
    Will Strohl

    Where can I find a list of the various handlebar tokens that Zendesk provides in each view?  I've looked and looked and can't find any.  All I get are very specific, beginner examples of editing themes.

  • Avatar
    Jessie - Community Manager

    Hi Will!

    You can find our complete Curlybars documentation here:

    Please let us know if you have any other questions!

  • Avatar
    Will Strohl

    Thanks, Jessie.  I found that on multiple occasions, but I don't see where it defines which properties are available to which views, and which properties those properties have.

  • Avatar
    Charles Nadeau

    Hi Will,

    Click any object links in the "Available properties" tables in the template-specific docs. For example, in the Section page doc, clicking the article object link for the promoted_article property will take you to the object's reference doc.

    Is this what you're looking for?

     

  • Avatar
    Will Strohl

    Thanks, Charles.  This is exactly what I'm looking for.

  • Avatar
    Netrebenko

    Hi, people!

    Please tell, is it possible to use a helper which is not available in some particular template? For example, I'd like to display the user name in the Header: 'Hello, {{user.name}}, nice to meet you!"

  • Avatar
    Mario Landa

    Is there a developer mode that would allow me to modify the raw HTML? Or do I have to use the templating engine no matter what?

  • Avatar
    Nicole - Community Manager

    Hey Mario - 

    The templating engine should give you access to the HTML code; there's not a separate mode. 

  • Avatar
    product

    quick question... is it possible to use multiple #is statements with an else statement? I tried the following, but it throws a syntax error. 

    {{#is name 'Get Verified'}}<span class="section-name"><i class="fa fa-shield" aria-hidden="true"></i>{{name}}</span>
    {{#is name 'Member Login'}}<span class="section-name"><i class="fa fa-sign-in" aria-hidden="true"></i>{{name}}</span>
    {{#is name 'Orders & Shipping'}}<span class="section-name"><i class="fa fa-truck" aria-hidden="true"></i>{{name}}</span>
    {{#is name 'Returns & Exchanges'}}<span class="section-name"><i class="fa fa-reply-all" aria-hidden="true"></i>{{name}}</span>
    {{#is name 'Tickets & Travel'}}<span class="section-name"><i class="fa fa-ticket" aria-hidden="true"></i>{{name}}</span>
    {{#is name 'General Help'}}<span class="section-name"><i class="fa fa-handshake-o" aria-hidden="true"></i>{{name}}</span>
    {{#is name 'Customer Support'}}<span class="section-name"><i class="fa fa-info-circle" aria-hidden="true"></i>{{name}}</span>
    {{else}}<span class="section-name">{{name}}</span>{{/is}}

    Is there a better way to tackle this?

  • Avatar
    Charles Nadeau

    You'll need to set up some kind of  #if condition:

    {{#if condition}}
      This is rendered if the condition is true.
    {{else}}
      This is rendered if the condition is false.
    {{/if}}
  • Avatar
    Jehan

    Can I search for a specific string inside a an Article title OR attachment name Or any string? Let suppose I have two type of attachments with an article. One is a PDF and other is an Image. I want to know if there is any Helpers that can differentiate between the two. 

    {{#contains article.title "pdf"}}

    This is PDF document 

    {{/contains}}

  • Avatar
    Jessie - Community Manager

    Hi Jehan! Let me see if I can find someone to answer this for you!

  • Avatar
    Zach Schrock (Edited )

    Hi there, I'm trying to see if it is possible to pull Category Titles into Section Pages and other similar functions.

    I also need some sort of way to show different images depending on the Category one is in.

    {{#if CATEGORY 1}}
      CATEGORY 1 ICON
      CATEGORY 1 TITLE
    {{else}}
      CATEGORY 2 ICON
      CATEGORY 2 TITLE
    {{/if}}

    Is this possible at all?

    Or even something like

    {{#if CATEGORY 1}}
      CATEGORY 1 ICON
      CATEGORY 1 TITLE
    {{/if}}

    {{#if CATEGORY 2}}
      CATEGORY 2 ICON
      CATEGORY 2 TITLE
    {{/if}}

  • Avatar
    Rebecca

    Hey Jehan - 

    At this time, Curlybars does not offer a helper that provides the behavior you describe. As a result, you would likely need to implement Javascript and maybe a regular expression depending how granular you are looking to get to accomplish your goal. The attachment file type is apart of the attachment title so you could likely key off of the attachment title. 

  • Avatar
    Jehan

    Thanks Rebecca. I already did it through JavaScript.

  • Avatar
    Dan Ross

    Now that Zendesk has open sourced CurlyBars, is it now possible for Guide users to define their own helpers and use them in their templates?

    If so, is there any documentation around that, as it relates to the Guide platform?

     

    Thanks!

  • Avatar
    Jennifer Rowe

    Hi Dan,

    Good question, but unfortunately no. It's not possible for you to define your own helpers, because we can't allow customers to run their Ruby code on our servers.

    Sorry about that!

     

Please sign in to leave a comment.

Powered by Zendesk