You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The ability to specify a collection item's filename via a "slug" field, described in the docs here, does not work as expected with i18n enabled: the filename will always be the default locale's slug field value.
For example, if the following page is saved:
The filename of both locales will be en-lorem.md:
This bug particularly affects projects using web frameworks which employ file-based routing (e.g. Astro, Next.js), as there may not be any viable workarounds without resorting to hardcoding the desired paths via server redirects, etc.
To Reproduce
(See example config added below)
Add a folder collection with i18n option enabled.
Add a slug field to the collection and reference the field in the collection's slug option: slug: {{fields.slug}}.
Add top-level config for i18n with 2 locales, e.g. en & pt.
Open the control panel, create a new page with distinct slug field values for each locale, e.g. en-lorem, pt-lorem.
Publish the page.
Check the saved filenames for the page.
Expected behavior
The values specified in the slug fields should be used as the filenames for their respective locales. E.g. for en, the filename should be en-lorem (working as expected), for pt, the filename should be pt-lorem (not working as expected).
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Describe the bug
The ability to specify a collection item's filename via a "slug" field, described in the docs here, does not work as expected with i18n enabled: the filename will always be the default locale's slug field value.
For example, if the following page is saved:
The filename of both locales will be
en-lorem.md
:This bug particularly affects projects using web frameworks which employ file-based routing (e.g. Astro, Next.js), as there may not be any viable workarounds without resorting to hardcoding the desired paths via server redirects, etc.
To Reproduce
(See example config added below)
i18n
option enabled.slug
field to the collection and reference the field in the collection'sslug
option:slug: {{fields.slug}}
.en
&pt
.en-lorem
,pt-lorem
.Expected behavior
The values specified in the
slug
fields should be used as the filenames for their respective locales. E.g. foren
, the filename should been-lorem
(working as expected), forpt
, the filename should bept-lorem
(not working as expected).Applicable Versions:
CMS configuration
The text was updated successfully, but these errors were encountered: