-
Notifications
You must be signed in to change notification settings - Fork 104
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
{{root}} helper doesn't work as intended in all situations #138
Comments
Could you see if writing |
Doesn't that defeat the purpose of {{root}} helper? What if I put that code in a partial that could be used in files that reside in different directory levels? It seems that path is not passed along properly with |
The Handlebars has scopes, and some helpers create a new scope. This means you can't access variables in the parent scope just by writing them normally. Adding the Does that make sense? |
Yes, thank you gakimball, this makes sense. I will try it out. |
@Vlasterx did you ever find a fix for this? Having the same issue myself |
@daaanpace yes, I had to reorganize my markup and abandon the use of Data -
|
It seems that Panini specific helper {{root}} doesn't always work as intended.
Take this folder structure for example:
Data galery.yml is just a list of image URL's
If I use {{root}} from withing an article located in /pages/en/test-page.com and if I don't wrap it in some other Panini helpers - it will work as intended, but if I use it like this
{{#each galery.team }} <p>Image root: {{root}}</p> {{/each}}
It will not work at all.
The text was updated successfully, but these errors were encountered: