RandomEtc / ejs-locals

Express 3.x layout, partial and block template functions for the EJS template engine.
298 stars 63 forks source link

Override methods/helpers - Search for partials in a custom dir #42

Closed Vadorequest closed 9 years ago

Vadorequest commented 10 years ago

I want to override the function partial used as the following: <%- partial('icon', {icon: box_title_icon}) %>

basically, I want to always search for my partials in a specific directory instead of writing the path each time. (Because I share them across app and client/server and the path is quite long)

How can I specify a default path? (Is there an option?) if not then how can I override the helper? What's the best way? i would prefer to not have to mess up with native ejs-locals code.

Thanks!

Vadorequest commented 10 years ago

Actually, what would be the best is to have a kind of fallback, if the partial isn't found then look into another directory (or look into this dir in the first place, I don't know) and if it is still not found then raise the usual exception (partial not found).