We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When querying an entry using the "uri" filter localized URLs return null instead of the entry.
This does return a result
entry(uri: "/careers") { id site { name } }
This returns null (I verified that the entry exists, is translated and published)
entry(uri: "/gb/careers") { id site { name } }
sites.php
'sites' => [ 'default' => [ 'name' => 'English US', 'locale' => 'en_US', 'url' => env('APP_URL'), ], 'gb' => [ 'name' => 'English GB', 'locale' => 'en_GB', 'url' => env('APP_URL').'gb/', ], ],
Since there can be multiple pages with the same slug it is impossible to query a translated pages via the entry endpoint.
This is the workaround I'm currently using
entries(collection: "pages", limit: 1, filter: {uri: {is: "/careers"}, site: {is: "gb"}}) { current_page data { id title site { url locale name handle short_locale } uri url } }
Statamic version: 3.1.30
PHP version: 7.4.19
Install method (choose one): Fresh install from statamic/statamic
statamic/statamic
The text was updated successfully, but these errors were encountered:
The uri of the entry on the gb site would still be /careers. The /gb is not included in the uri. (The url has it.)
uri
gb
/careers
/gb
url
I'd suggest adding a site argument to your query, but it looks like we haven't added that yet. I've done this in #4055.
site
You'll be able to do:
entry(uri: "/careers", site: "gb") { # ... }
Sorry, something went wrong.
awesome, thank you!
Successfully merging a pull request may close this issue.
Bug Description
When querying an entry using the "uri" filter localized URLs return null instead of the entry.
How to Reproduce
This does return a result
This returns null (I verified that the entry exists, is translated and published)
sites.php
Since there can be multiple pages with the same slug it is impossible to query a translated pages via the entry endpoint.
This is the workaround I'm currently using
Extra Detail
Environment
Statamic version: 3.1.30
PHP version: 7.4.19
Install method (choose one):
Fresh install from
statamic/statamic
The text was updated successfully, but these errors were encountered: