Closed bigorangemachine closed 9 years ago
That feature is currently not supported. Right now you must configure the dirs where your partials are up front.
Stepping back, what are you trying to accomplish with having a dynamic partial? There might be a different way of accomplishing what you're trying to do. And in the meantime, I'll think through how I could add support for passing in partials to res.render()
.
I want to figure out how Handlebars behaves when you use registerPartial()
, but also render a template passing {partials: {...}}
as the options
argument.
Eric, Thanks for your reply.
I am experimenting. I am trying to figure out which features overlap or if I could hack it :p
I am new to handlebars to so there was confusion around other issues I resolved. This was the only problem I couldn't resolve because changing the core handlebars code didn't give me debugging info I was trying to get.
I went through the express-handlebars code and I saw everything was populating correctly. In a weird way I am happy that it wasn't me.
Thanks again Eric
Hi, Thanks for the great work on express-handlebars.
I'm a little new to Node/Express/Handlebars but I have lots of javascript experience.
I'm trying to experiment and see if I can change a partial when you do a res.render()
My 'Main()' node script
My Router Rule (hello.world):
Is this:
setup to work or am I doing it wrong? It finds the partial 'header' or 'footer' correctly. It seems you can't switch the partial when you flip the 'render'. Maybe its my n00bness to handlebars but I thought you could do pass the partials as an argument or option.