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
An obvious solution was nowhere to be found. But thanks to some help from @pdehaan and @Ryuno-Ki, I was about to figure out that a page can access all global data in 2 steps.
Use the debug filter like this: {{ collections.all[0].template.templateData.globalData | debug }}
This works…but it was tedious to pull off. And I would not have figured it out if it weren’t for the help I received in #1526.
Being able to “just look at” data is an important part of discovery, learning, and adoption of new tools. For example, now that I know I can do this, I plan to stick with Eleventy a little longer to see what I can do.
Describe the solution you’d like
I guess I would just like an easy-access variable available to do this.
perhaps called globalData
perhaps defaulting to globalData, but allowing the user to configure a different name
perhaps something else?
Describe alternatives you've considered
N/A
----
EDIT: Put my writing under the correct questions 👅
EDIT: Clarify that I mean global data, rather than front matter
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
This feature request was born out of #1526.
My original post:
(To be clear, I am referring to global data.)
An obvious solution was nowhere to be found. But thanks to some help from @pdehaan and @Ryuno-Ki, I was about to figure out that a page can access all global data in 2 steps.
debug
filter in Eleventy’s config (@pdehaan’s example is here)debug
filter like this:{{ collections.all[0].template.templateData.globalData | debug }}
This works…but it was tedious to pull off. And I would not have figured it out if it weren’t for the help I received in #1526.
Being able to “just look at” data is an important part of discovery, learning, and adoption of new tools. For example, now that I know I can do this, I plan to stick with Eleventy a little longer to see what I can do.
Describe the solution you’d like
I guess I would just like an easy-access variable available to do this.
globalData
globalData
, but allowing the user to configure a different nameDescribe alternatives you've considered
N/A
----
EDIT: Put my writing under the correct questions 👅
EDIT: Clarify that I mean global data, rather than front matter
The text was updated successfully, but these errors were encountered: