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

Comments

24 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
    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?

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

     

  • Avatar
    Chris (Edited )

     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!

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

  • Avatar
    Dan Ross (Edited )

    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!

     

  • Avatar
    Chris (Edited )

    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}}
  • Avatar
    Zach Schrock

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

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

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

Please sign in to leave a comment.

Powered by Zendesk