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

Have more questions? Submit a request

30 Comments

  • 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.

    0
  • Jessie - Community Manager

    Hi Will!

    You can find our complete Curlybars documentation here:

    Please let us know if you have any other questions!

    0
  • 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.

    0
  • 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?

     

    0
  • Will Strohl

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

    0
  • 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!"

    0
  • 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?

    0
  • Nicole - Community Manager

    Hey Mario - 

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

    0
  • Chris

    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?

    0
  • 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}}
    0
  • 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}}

    0
  • Jessie - Community Manager

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

    0
  • Zach Schrock

    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}}

    1
  • 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. 

    0
  • Jehan

    Thanks Rebecca. I already did it through JavaScript.

    0
  • 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!

    0
  • 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!

     

    0
  • Chris

     How do I combine multiple {{#is}} statements with an {{#else}} statement?

    For example, I have 3 Section pages that all have a custom layout, but all the other Section pages should have a standard layout. So, I'd like to wrap the html for each page in an {{#is}} statement, like this:

    {{#is section.name 'Section 1'}}

    HTML for Section 1

    {{#is section.name 'Section 2'}}

    HTML for Section 2

    {{#is section.name 'Section 3'}}

    HTML for Section 3

    {{else}}

    HTML for all other Sections

    {{/is}}

    This is giving me a syntax error. 

    However, I can't combine Sections 1-3 into a single HTML block because they are all distinct. 

    Thanks for the help!

    0
  • Jessie - Community Manager

    Hi Chris! Sorry for the delayed response!

    I'm checking with our Community Moderators to see if they can help you troubleshoot this. Stand by!

    0
  • Dan Ross

    Hey Chris,

     

    Maybe with chained else conditionals? I'm not in a position to test this right now, but I think it could work. Let me know!

     

    {{#is section.name 'Section 1'}}

    HTML 1

    {{/is}}

    {{else}}

    {{#is section.name 'Section 2'}}

    HTML 2

    {{/is}}

    {{else}}

    {{#is section.name 'Section 3'}}

    HTML 3

    {{/is}}

    {{else}}

    Fallback HTML

    Good luck!

     

    0
  • Chris

    Hi Dan, 

    I got it to work! The final formatting looks like this:

    {{#is section.name 'Section 1'}}

    HTML 1

    {{else}}

    {{#is section.name 'Section 2'}}

    HTML 2

    {{else}}

    {{#is section.name 'Section 3'}}

    HTML 3

    {{else}}

    Fallback HTML

    {{/is}}

    {{/is}}

    {/is}}
    0
  • Zach Schrock

    So..... no one cares to help with my question above?

    0
  • Jessie - Community Manager

    Hey Zach! I'm so sorry this fell through the cracks. I've pinged our Community Moderators to see if one them can help you with this.

    0
  • Trapta

    Hi @Zach,

    The cases you have mentioned is not possible in Zendesk currently. You can use JS to extract category from breadcrumbs and then add a function to show and hide banner.

    Thanks

    Team Diziana

    0
  • David Sanchez

    How can I custom a helper?, for example I want to get some elements from an array, if I have 10 in total just get 3 for example, I want to do that with each helper

    0
  • Nicole - Community Manager

    Hi David,

    Can you tell us more about what it is you're trying to accomplish so that we can better assist you? 

    0
  • Kris Scuteri

    Is it possible to use this to hide attachments that are less than a certain size, so they do not display on an end users 'my activities' page?  I have tons of 'attachments' that show right now due to each part of a signature being a picture file.  If I could code my help center to hide these small files, it would help tidy up the look.

     

    Here is an example where if I could say if attachments < 5 KB, hide, that would be great.

     

    0
  • Jehan

    @Kris Scuteri I don't think there will be any help in Guide templating language. You will need to do it through JavaScript.

    0
  • Giacomo Paita

    Hi, 

    i cant' find in the documentation the list of all avalaible value for the "t" keyword, that are used for example in this snippet for the ERROR page :

    {{t 'oops'}}

    Thanks in advance!

    Giacomo

     

    0

Please sign in to leave a comment.

Powered by Zendesk