I’ve encountered an issue that I think might be a bug. I’ve already submitted an issue over on Github, but haven’t been able to find a solution yet:
In a multilanguage setup running the latest Kirby 4 RC, I’m facing an issue with some multilang content inside a structure field. Currently, there are two languages enabled: English (default) and German.
In my blueprint I set up a structure field that is translatable:
intro_popup_slides:
label:
en: Popup Slides
de: Popup Slides
min: 1
max: 10
type: structure
translate: true
required: true
fields:
slide_headline:
label:
en: Headline
de: Überschrift
type: text
maxlength: 60
slide_mainttext:
label:
en: Main Text
de: Haupttext
type: textarea
required: true
maxlength: 450
While the field works as expected when I enter english Content, there is an issue when entering german content: The field value gets saved and appears inside the content files (contentfile.en.txt and contentfile.de.txt) as expected. As soon as I refresh the panel though, the English content of the field is shown despite the panels language toggle being set to German.
This issue only concerns the panel: As the contentfiles are updated properly, the right content is also being shown in my templates – not seeing the right content just makes it very hard for my client to edit the page.
I believe you understood my problem correctly. For me it looks like this:
I have already disabled all plugins but that didn’t help. One thing that comes to my mind is that I recently migrated some content from an older Version of the site I’m working on. But that happened on a different level in the file system, so I don’t think it should be causing any issues here.
Thanks for your replies, @GB_DESIGN! I have now actually found the source of the issue. As it turns out, the migrated content wasn’t the problem and there also weren’t any duplicate fields.
Inside my config.php, I set up some modifications of the panel sidebar: The page I’m referring to should show up in the sidebar for admin users to be easily accessible:
This seemed to work, but apparently caused the translation issue. Not sure why, but when I removed the code, the translations start to show up properly again. If this is not the proper way to add items to the sidebar, is there a recommended way to do it @texnixe?
Hi Sonja, not sure if that’s actually the case: The problems happens regardless of wether I navigated to that page using my modified sidebar or if I navigated to the page using the regular path through Site > Pages > Challenge Content.
If the problem is in fact the missing language context, is there a suggested way to make it available here?