New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does Hapi support multiple view templates? #1322
Comments
Sorry to clarify. I meant does hapi support multiple layouts for a single template engine (im using handlebars). I see that to enable a layout I create a layout.hbs but what if I have 2 layouts. layout1.hbs and layout2.hbs. How can I tell the view render which layout to use. |
You will need to override the layout when you call view(). It's one of the options. You can setup one as the default. |
How can I overwrite. The layout parameter is a boolean. I cannot pass a layout. The layout parameter should take a layout file not a boolean. |
Eran, !תודה רבה 2.0.0 works like a charm but 1 small bug. Line 1783 in response.js. If you explicitly change true to 'otherLayout' it wont work. The fix allows alternative layouts when you use reply.view but not in the server config. You get an error: [1] the value of layout must be a boolean. I and most people also usually have layouts in a separate folder than most of my views. Would be great to add a layoutsPath to the server config like you have for partialsPath. Below is the test that fails
|
Do you have an example with this new code where I can use 2 templates. 2.1.x solved most of my issues but I cant seem to specify my layout when I create a new route. It keeps using my default. It might be because my syntax is wrong but Im not getting an error |
never mind...got it. 2.1.x working great with multiple layouts. |
This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions. |
Is there an example out there if it does?
The text was updated successfully, but these errors were encountered: