tj / consolidate.js

Template engine consolidation library for node.js
3.48k stars 357 forks source link

How can I set a default layout for handlebars in sails js? #312

Closed Ghusar closed 6 years ago

Ghusar commented 6 years ago

I am using sails 1.0 in my project. Since sails has dropped support for layout in sails 1.0. I am using consolidate to render my views. I cannot find a documentation for setting up a default layout for entire application using consolidate?

doowb commented 6 years ago

Handlebars does not handle layouts directly, which is probably why sails used to support it. consolidate also doesn't handle layouts so you'll probably have to find another solution.

You can try the layouts module to pre-apply layouts to your views, then pass those to consolidate. I'm not sure what sails exposes to allow this or if it's possible, but it might be worth looking into.

Ghusar commented 6 years ago

Thanks you for quick response. I appreciate your help.