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

[4.x] Fix locales tag inside replicator, bard, and grid #9566

Merged
merged 5 commits into from
Feb 22, 2024

Conversation

aerni
Copy link
Contributor

@aerni aerni commented Feb 21, 2024

This PR fixes the locales tag inside a replicator, bard, or grid loop.

Since Statamic v3.4 the {{ id }} inside a loop reflects the ID of the item rather than the entry.

You could work around this issue by manually passing the id to the locales tag. But this is super cumbersome.

{{ locales id="{page:id}" }}
    {{ permalink }}
{{ /locales }}

So this PR gets the ID from the context's page instead.

@aerni aerni changed the title Fix locales tag inside replicator, bard, and grid [4.x] Fix locales tag inside replicator, bard, and grid Feb 21, 2024
Copy link
Member

@jasonvarga jasonvarga left a comment

Choose a reason for hiding this comment

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

Can you make it fall back to id? In some cases page might be missing, like when using it in Blade.

@jasonvarga jasonvarga merged commit 108b9e5 into statamic:4.x Feb 22, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants