RandomEtc / ejs-locals

Express 3.x layout, partial and block template functions for the EJS template engine.
298 stars 63 forks source link

best way to toggle pieces of UI #15

Closed ralyodio closed 11 years ago

ralyodio commented 11 years ago

I want to toggle a block of html in layout.ejs when called from page.ejs

something like setting hide_title = true; and having layout.ejs look for that variable.

RandomEtc commented 11 years ago

Right now I would just set the block to an empty string:

<% block('title', '') %>

And then in the layout do:

<% if (title) { %>
  <h1><%=title%></h1>
<% } %>

Hope that helps / sorry for the delay.