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

Is it possible to pass extra handlebar props to error_template.html? #19

Closed
naazy opened this issue Aug 25, 2016 · 5 comments
Closed

Is it possible to pass extra handlebar props to error_template.html? #19

naazy opened this issue Aug 25, 2016 · 5 comments

Comments

@naazy
Copy link
Member

naazy commented Aug 25, 2016

Or are we currently limited by errorTitle, statusCode and errorMessage? If not, am I okay to make a PR?

@nelsonic
Copy link
Member

@naazy good question! which other properties/values would you like to be able to define / pass in?

@naazy
Copy link
Member Author

naazy commented Aug 25, 2016

@nelsonic Ideally we want the flexibility to add any props to the default handlebar props. We would mainly be using it to pass the user's email address and name to our header partial and also relevant menu items.

@nelsonic
Copy link
Member

@naazy ok, cool. sounds like we can evolve the plugin and make it more general-purpose (and thus more useful to other people in the process)
so the question is: how are we going to pass the additional properties into the plugin?

My reading of the Hoek.assert() API https://github.com/hapijs/hoek/blob/master/API.md#assertcondition-message suggests we can pass an Object in as the message, let's try that.

Please review/merge: #16 so we have a fresh place to start from. (thanks!)

@nelsonic
Copy link
Member

@naazy sweet! if we try to JSON.parse and find that the message is a stringified Object then we can Object.assign it to the Object that gets passed to the reply.view

@naazy
Copy link
Member Author

naazy commented Aug 25, 2016

I believe I have now got this to work but have somehow managed to break the redirect tests (should probably not have actually put a fix in the commit message - sorry!). Can't figure out how I've managed to do this but will have a look again tomorrow with a fresh pair of eyes ❄️ 👀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants