-
Notifications
You must be signed in to change notification settings - Fork 18
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
Pre/Post hooks #85
Comments
@svetozarstojkovic I think plugins shouldn't override existing routes but add variables into the response so that they can be used in the view. I've created specific issue re WP here #86 |
@svetozarstojkovic here we implemented some changes that can resolve this issue #87 |
@anuveyatsu @sagargg can this ticket be closed then? Also should we update README.md with new instructions, so anyone new would know how exactly to write new plugins? |
Agree re docs @svetozarstojkovic |
Last week @starsinmypockets and I came across a weird behaviour while implementing 'ckan_pages' plugin.
The problem was that the theme endpoint was executed before the plugin and there res.render function was called and we get an html page before variable from the plugin was set.
The proposal is to create prehooks and posthooks in .env file that will tell which plugins will be executed before and which will be executed after the theme.
By adding that we will have more control when opening some page.
Prehooks will be used for plugins that set variables that need to be used in nunjucks template.
Posthooks will be used for plugins that override some endpoints.
@anuveyatsu what do you think about this idea?
The text was updated successfully, but these errors were encountered: