Skip to content
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

Multiple paths for views #1753

Closed
imjoshholloway opened this issue Jul 3, 2014 · 10 comments
Closed

Multiple paths for views #1753

imjoshholloway opened this issue Jul 3, 2014 · 10 comments
Assignees
Labels

Comments

@imjoshholloway
Copy link

@imjoshholloway imjoshholloway commented Jul 3, 2014

Is there anyway to have multiple paths setup for views?

E.g;

plugin.views({
    path: [__dirname + "/templates, __dirname + "/../templates"]
});
@hueniverse hueniverse added the request label Jul 9, 2014
@hueniverse

This comment has been minimized.

Copy link
Member

@hueniverse hueniverse commented Jul 9, 2014

Not right now. I'll take a PR adding support.

@arb

This comment has been minimized.

Copy link
Contributor

@arb arb commented Jul 15, 2014

Would the expectation be that those directories are checked in order? So the first check would be to __dirname + "/templates and if not there, check __dirname + "/../templates" and if not there, 404?

@hueniverse

This comment has been minimized.

Copy link
Member

@hueniverse hueniverse commented Jul 15, 2014

Yep. Same way multiple directories work. But this needs to be applied consistently to helpers, partials, and templates paths.

@hueniverse

This comment has been minimized.

Copy link
Member

@hueniverse hueniverse commented Nov 5, 2014

Moved to vision.

@hueniverse hueniverse closed this Nov 5, 2014
@hueniverse hueniverse self-assigned this Nov 5, 2014
@hueniverse hueniverse removed the help wanted label Nov 5, 2014
@sonisaurabh19

This comment has been minimized.

Copy link

@sonisaurabh19 sonisaurabh19 commented Jun 24, 2015

Hi, can anyone kindly tell how the usage shall be?
I tried like mentioned above with fail - path: [__dirname + "/templates", __dirname + "/../templates"]
Thanks.

@mtharrison

This comment has been minimized.

Copy link
Member

@mtharrison mtharrison commented Jun 24, 2015

@sonisaurabh19 that works for me:

server.views({
    engines: { hbs: require('handlebars') },
    path: [__dirname + "/templates", __dirname + "/../templates"]
});

What's the error you're seeing?

@sonisaurabh19

This comment has been minimized.

Copy link

@sonisaurabh19 sonisaurabh19 commented Jun 30, 2015

I have a server/views/ directory wherein all the jade files are present. Since my case is now beginning to have more jade files, I thought of structuring server/views/ based on actors. Something like:
Ex - server/views/admin/task1.jade
Ex - server/views/superadmin/task2.jade

My index.js looks like:
server.views({
engines:
{
jade: require('jade')
},
path: [ __dirname + "/app/server/views/admin", __dirname + "/app/server/views/superadmin" ]
});

With the above configuration, my jade files for task1& task2 don't load. However, if they are both under /server/views/, they work.

Thanks.

@sonisaurabh19

This comment has been minimized.

Copy link

@sonisaurabh19 sonisaurabh19 commented Jul 13, 2015

Any help guys...

@Marsup

This comment has been minimized.

Copy link
Member

@Marsup Marsup commented Jul 13, 2015

Hijacking an issue is not the best way to get help, especially in the wrong project.
Check your paths they seem wrong.

@Marsup Marsup added feature and removed request labels Sep 20, 2019
@lock

This comment has been minimized.

Copy link

@lock lock bot commented Jan 9, 2020

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.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
6 participants
You can’t perform that action at this time.