When using date based sorting for blog articles num: date will use the date field's value as sorting number prefix on publishing (and the current date if the date field is empty or not present)
This works as expected in a single language setup and when saving/updating the primary language in a multi-language setup.
But whenever I edit a page in a secondary language and save it, the sorting number prefix of that page/folder also changes in one of the following ways:
with tranlsate: true (default),
the prefix changes to the (possibly differing!) translated "date" field's value (if present or set) or to the current date (if not present or set)
with translate: false (desired),
the prefix changes to the current date (if the "date" field is present and num: date)
or to 0_/alphabetically (when not using the default "date" field or date format (e.g. num: "{{ page.mydate.toDate('Ymd') }}")
Since in most cases you wouldn't want the date field translated, translate: false is the desired behavior here.
To Reproduce
Steps to reproduce the behavior:
Download + install a fresh Starterkit
Activate languages + add at least one secondary language
Open a "note" in the Panel
Switch to the secondary language
Edit the date field
See the folder sorting prefix changed according to the secondary language's date
Additionally:
Add translate: false to the date field in note.yml
Edit any field in the secondary language of a note and hit save
See the folder sorting prefix changed to alphabetically 0_
Expected behavior
The folder name with sorting prefix represents the primary language's sorting and slug!
A translated slug is stored in the content file already and not renaming the folder.
The sorting number should follow the same rules and NEVER change based on secondary language changes!
If different sortings between languages is necessary or desired, it should only be stored in the content file, too.
Describe the bug
When using date based sorting for blog articles
num: date
will use the date field's value as sorting number prefix on publishing (and the current date if the date field is empty or not present)This works as expected in a single language setup and when saving/updating the primary language in a multi-language setup.
But whenever I edit a page in a secondary language and save it, the sorting number prefix of that page/folder also changes in one of the following ways:
with
tranlsate: true
(default), the prefix changes to the (possibly differing!) translated "date" field's value (if present or set) or to the current date (if not present or set)with
translate: false
(desired), the prefix changes to the current date (if the "date" field is present andnum: date
) or to0_
/alphabetically (when not using the default "date" field or date format (e.g.num: "{{ page.mydate.toDate('Ymd') }}"
)Since in most cases you wouldn't want the date field translated,
translate: false
is the desired behavior here.To Reproduce
Steps to reproduce the behavior:
Additionally:
translate: false
to the date field innote.yml
0_
Expected behavior
The folder name with sorting prefix represents the primary language's sorting and slug! A translated slug is stored in the content file already and not renaming the folder.
The sorting number should follow the same rules and NEVER change based on secondary language changes!
If different sortings between languages is necessary or desired, it should only be stored in the content file, too.
Kirby Version
3.2.0