You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As #748 demonstrated, Handlebars doesn't distinguish between invoking a helper, versus referencing a variable parameter, in its syntax:
// Reference a helper called 'slug'
<code>{{slug}}</code>
// Reference a parameter called 'slug'
<code>{{slug}}</code>
There are basically two ways that we can avoid this issue:
Use {{this.slug}} to explicitly reference the variable, not the helper;
Come up with a special naming convention for our custom helpers.
I think (1) would be a better choice in terms of compatibility, not only with our current helpers but with other helper libraries that people might choose to load. I'm not sure if there any drawbacks, other than having to make a lot of changes in the existing templates. Thoughts?
The text was updated successfully, but these errors were encountered:
As #748 demonstrated, Handlebars doesn't distinguish between invoking a helper, versus referencing a variable parameter, in its syntax:
There are basically two ways that we can avoid this issue:
{{this.slug}}
to explicitly reference the variable, not the helper;I think (1) would be a better choice in terms of compatibility, not only with our current helpers but with other helper libraries that people might choose to load. I'm not sure if there any drawbacks, other than having to make a lot of changes in the existing templates. Thoughts?
The text was updated successfully, but these errors were encountered: