Direct access to global data within partial template (Liquid) #3186
Unanswered
SchraderMa
asked this question in
Q&A
Replies: 2 comments
-
Did you ever figure this out? I am having the same problem. |
Beta Was this translation helpful? Give feedback.
0 replies
-
How are you including given <p>passed = {{ passed }}</p>
<p>datafile.direct = {{ datafile.direct }}</p> And <h1>Using Render</h1>
{% render 'partial.html' %}
<h1>Using Render with passed</h1>
{% render 'partial.html', passed: datafile.passed %}
<h1>Using Include</h1>
{% include 'partial.html' %}
<h1>Using Include with passed</h1>
{% include 'partial.html' , passed: datafile.passed %}
<h1>Direct</h1>
<p>datafile.direct= {{ datafile.direct }}</p> You should get:Using Renderpassed = Using Render with passedpassed = Passed value Using Includepassed = Using Include with passedpassed = Passed value Directdatafile.direct= Direct value It may be worth noting that |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello everyone.
Is there a way to access global data (data file, process.env, etc.) within a partial template (Liquid) without passing the data over in render tag?
/_data/datafile.json
/page-file.html
/_includes/partial.html
It would be very helpful to access global data directly in partials, otherwise you have to pass all the data through all render calls.
Thx for your help!
Best regards,
Marc
Beta Was this translation helpful? Give feedback.
All reactions