ericf / express-handlebars

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

Inline partials supported in layout? #221

Open cfjedimaster opened 6 years ago

cfjedimaster commented 6 years ago

Please forgive me if this is just a mistake on my part - it is the first time I've used this feature of Handlebars. I need to build a layout that takes both the regular output of the page (to be used in {{{body}}}), and an optional value as well. So for ex, my layout is a bit like this:

<html>
<head></head>
<body>
header stuff
{{{body}}}
{{> sideNav }}
</body>
</html>

And in my template, I'm doing:

random html and stuff I expect to go into body
{{#*inline "sideNav"}}
 stuff for sideNav
{{/inline}}

When run, I get: Error: The partial sideNav could not be found. Any ideas?

Reloecc commented 6 years ago

Hi, did you found an answer? I am just trying to learn express + handlebars and solution of this would be very helpful for me.

cfjedimaster commented 6 years ago

Nope.

sstanisic commented 4 years ago

Is there any way to accomplish the above?

Override layout defined block in a page view?