Skip to content
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

[TwigHooks] Allow discarding hookable's context #7

Merged
merged 1 commit into from
Apr 23, 2024

Conversation

jakubtobiasz
Copy link
Contributor

@jakubtobiasz jakubtobiasz commented Apr 23, 2024

Currently, automatically we merge the hookable-level context with the hook-level context. So data provided in the entry template is automatically passed down to the most bottom hookable.

In order to prevent this behavior, while declaring a new hook, we are able to add the only keyword, which will disable this mechanism. In such case, only the data from the with keyword will be passed down.

Example:

{% hook 'content' with {
	title: 'some title',
} only %}

@jakubtobiasz jakubtobiasz added twig hooks Issues and Pull Requests related to Twig Hooks feature labels Apr 23, 2024
@jakubtobiasz jakubtobiasz merged commit 4503fe8 into main Apr 23, 2024
13 checks passed
@jakubtobiasz jakubtobiasz deleted the feature/context-scoping branch April 23, 2024 07:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature twig hooks Issues and Pull Requests related to Twig Hooks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant