Here's how it breaks down:
✅ What’s working:
You set the variable in the Layout:
twig{% set layout_name = "layout_default" %}
And then access it in the Layout itself:
twig<p>Layout in use: <code>{{ layout_name }}</code></p>
That’s why it renders correctly there.
🧩 What’s going wrong in the Partial:
If you include a Partial
from within a Page
(not the Layout), it
won’t inherit layout variables
like
layout_name
by default.
Why?
Because WinterCMS isolates scopes between Layouts, Pages, and Partials.
Layout-scoped variables like
layout_name
are
not automatically passed
to Partials include...