ericf / express-handlebars

A Handlebars view engine for Express which doesn't suck.
BSD 3-Clause "New" or "Revised" License
2.31k stars 382 forks source link

Nesting layouts #115

Closed itsgoofer closed 8 years ago

itsgoofer commented 9 years ago

Is there a way to nest a layout inside of another? For example:

default.hsb
-- postLayoout.hbs
---- {{{body}}}

Thanks in advance.

ericf commented 9 years ago

Not that's built into this package. You'd have to do this manually using partials and/or block helpers.

What's different between your default.hbs and postLayout.hbs layouts?

itsgoofer commented 9 years ago

The postLayout.hbs has some specific UI elements just for a page that has a post. So, the article would be yield in that postLayout. The postLayout then would be yield in the default layout (the actual page with the doctype, header and footer

ghosh commented 8 years ago

@omarfouad Hey, did you mange to nest the layouts like you desired? I am trying the same, any tips on how this can be done? Thanks!

itsgoofer commented 8 years ago

@Ghosh No, I used an alternative called here: https://github.com/barc/express-hbs

robertwbradford commented 8 years ago

+1. Nesting is a good thing.