express-handlebars icon indicating copy to clipboard operation
express-handlebars copied to clipboard

Inline partials supported in layout?

Open cfjedimaster opened this issue 7 years ago • 3 comments
trafficstars

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?

cfjedimaster avatar Dec 26 '17 20:12 cfjedimaster

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

Reloecc avatar Mar 18 '18 21:03 Reloecc

Nope.

cfjedimaster avatar Mar 19 '18 14:03 cfjedimaster

Is there any way to accomplish the above?

Override layout defined block in a page view?

sstanisic avatar Jan 20 '20 15:01 sstanisic