Skip to content

Add documention note about variable scope of override blocks in {% embed ... only %}#4845

Merged
fabpot merged 1 commit into
twigphp:3.xfrom
andy-blum:docs/embed-with-only
Jun 19, 2026
Merged

Add documention note about variable scope of override blocks in {% embed ... only %}#4845
fabpot merged 1 commit into
twigphp:3.xfrom
andy-blum:docs/embed-with-only

Conversation

@andy-blum

Copy link
Copy Markdown
Contributor

Closes #4844

Comment thread doc/tags/embed.rst
Comment on lines +181 to +182
{# "name" is undefined inside the block #}
{% embed "base" only %}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{# "name" is undefined inside the block #}
{% embed "base" only %}
{% embed "base" only %}
{# "name" is undefined inside the block #}

Comment thread doc/tags/embed.rst
Comment on lines +186 to +187
{# "name" is passed explicitly and is available #}
{% embed "base" with {'name': name} only %}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{# "name" is passed explicitly and is available #}
{% embed "base" with {'name': name} only %}
{% embed "base" with {'name': name} only %}
{# "name" is passed explicitly and is available #}

@e0ipso e0ipso left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good clarifications. I suggested an über-nit pick.

@fabpot fabpot force-pushed the docs/embed-with-only branch from 1ffd1cc to 068a2e6 Compare June 19, 2026 06:03
@fabpot

fabpot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Thank you @andy-blum.

@fabpot fabpot merged commit 4007231 into twigphp:3.x Jun 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Document (and possibly improve) variable scope of override blocks in {% embed ... only %}

3 participants