Forums/Community/Zendesk Apps

Handlebar values and conditions allowed within parent layout.hdbs template?

Jeff Tanner
posted this on September 06, 2012 13:00

Hi

The app.js provides switching between page templates and loads values and conditionals that can be used within that template, but they are not available to the parent layout template "layout.hdbs".

For example, I tried adding to "layout.hdbs" the following Handlebar conditional {{#if}} within <header> and this app failed to present within Lotus Beta.

<header>
  <span class="logo"/>
  <h3>{{t "app.name"}} {{t "app.version"}}</h3>
  {{#if !app_is_production_mode}}
    <i>{{t "app.testMode"}}</i>
  {{/if}}
</header>

Thanks

Jeff in Seattle

 

Comments

User photo
James Rosen
Zendesk

Handlebars doesn't support logic inside {{#if }} statements. You want the {{#unless }} helper.

September 06, 2012 13:30