Load new helpers from helpers.js.#110
Conversation
|
If a page has a preprocessor, this conflicts with it since they both define |
|
I'm not sure I understand. Preprocessors are defined in /views/index.hbs /preprocessors/index.js /helpers.js |
|
Oh and helpers are shared by all views, if that's what you meant? i.e. they are not defined in preprocessors. But that might be a good idea, can you, or @pushred, think of a use case for this? |
|
I think it's useful to be shared. I'm writing helpers for use in widget templates, which appear all over the site. As for the conflict, if you update the Then the test fails This is the same error I'm getting. When I remove the preprocessor from the page header, then the helper works again. I'm restarting the server, but that doesn't help. |
|
@jameslovejoy I found the problem, it's fixed. |
|
Works now 👍 |
Load new helpers from helpers.js.
Custom Handlebars helpers can be defined in
/helpers.js. This file needs to export an object defining new helpers, or existing helpers to replace.