Comments (10)
This is not a support form. Please ask on stackoverflow.
from hbs.
Never mind I see you can specify the layout in locals.
from hbs.
Is it possibly to have multiple view directories?
from hbs.
I reopened this because I first found the question asked on StackOverflow and the solution breaks with hbs.
http://stackoverflow.com/questions/11315351/multiple-view-paths-on-node-js-express (second one with require)
TypeError: Arguments to path.join must be strings
at path.js:360:15
at Array.filter (native)
at Object.exports.join (path.js:358:36)
at middleware (/Users/Adminstrator/Desktop/node-startup/node_modules/hbs/lib/hbs.js:105:30)
at View.render (/Users/Adminstrator/Desktop/node-startup/node_modules/express/lib/view.js:76:8)
at Function.app.render (/Users/Adminstrator/Desktop/node-startup/node_modules/express/lib/application.js:504:10)
at ServerResponse.res.render (/Users/Adminstrator/Desktop/node-startup/node_modules/express/lib/response.js:798:7)
from hbs.
I think specifying multiple view directories is a win. If you can do that with hbs great I think that there's an issue in the documentation on how to do this. If not it's a feature I think is needed. I'm sorry if this came off as a support issue, please consider reopening this.
from hbs.
Express supports only one view directory, we will not support specifying multiple.
from hbs.
Also I don't know if you remember but we had a beer together in Houston Hall a couple months ago, you recommended taters.
from hbs.
I remember :) (now that you mention it, otherwise wouldn't have recognized the name)
from hbs.
So I did some research on this issue: expressjs/express#533
For a large project I'm working on I'd like to organize my (page) templates in different folders, but spinning up a new app to make this happen is not worth it. For now it's fine that all my page templates are in one folder, but I really would like to break out the test templates. Before I started working with Express and Node I worked with Django and really liked how we had this ability to organize our templates.
from hbs.
you can put them in multiple folders and just res.render('folder/file')
it will work just fine.
from hbs.
Related Issues (20)
- Update handlebars dependency to 4.1.0 HOT 1
- [Security Alert] Upgrade handlebars to 4.1.0 or later HOT 1
- high severity vulnerability HOT 1
- Partial's passing value don't rendering after a space, in express hbs HOT 2
- Access hbs variable in external js file HOT 1
- npm audit security issue with handlebars 4.0.x HOT 8
- Error: Failed to lookup view "index" in views directory - Where is problem? HOT 4
- NPM Audit Security Issue with handlebars HOT 2
- Handlebars: Access has been denied to resolve the property "statements" because it is not an "own property" of its parent. HOT 3
- Handlebars 4.7.3 HOT 1
- Low security on minimist HOT 3
- Outdated dependency 'minimist' HOT 3
- Using registePartials twice disables app.locals HOT 3
- Can i use multiple videv engines with this framework? HOT 1
- Is it possible to pass an object(or JSON) from express to a specific partial(for use by another contained js app)? HOT 1
- Security Contact Needed HOT 2
- css file problem. HOT 1
- CSS not loaded when more than one '/' in the path HOT 1
- Error trying to use hbs on express
- How can I clear the cache? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hbs.