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

Multi-language Kirby site loses it structure entries inside a Block, when translate:flase is applied #7030

Open
AlexanderBoenninger opened this issue Feb 25, 2025 · 4 comments
Labels
needs: information ❓ Requires more information to proceed needs: replication 🔬 Requires a sample to reproduce the issue

Comments

@AlexanderBoenninger
Copy link

AlexanderBoenninger commented Feb 25, 2025

Description

In a multilanguage page, the files in a files field, that is nested in a structure field get lost for the second language, when saving the page. The structure field is set to translate: false.

Expected behavior
I expect the files to stay there, since the translate: false should cause, that the entries are not touched for the sec. language.

To reproduce

  1. I have e.g. 2 languages and a structure field inside a Block with files (not sure if it matters). The structure field is translate: false
  2. I fill it with entries files and other information.
  3. Switch to the next language. Enter content. The structure field is still filled and not editable (as expected).
  4. save the page.
  5. Structure field is empty.

Setup
Kirby Version
"name": "getkirby/cms",
"version": "4.6.1",

Console output
no output

Your system (please complete the following information)
on all devices

Additional context
I use the kirby translator from @johannschopplich and thought i might be a bug in the plugin, but it was not:
kirby-tools/community#29 (comment)

@afbora
Copy link
Member

afbora commented Feb 25, 2025

I can't reproduce the issue with just structure field. Do you mean structure field in blocks field? Could you share you full blueprint file please?

@AlexanderBoenninger
Copy link
Author

AH Yes it seems to be necessary that it is in a block!
Thanks.

@AlexanderBoenninger AlexanderBoenninger changed the title Multi-language Kirby site loses it structure entries, when translate:flase is applied Multi-language Kirby site loses it structure entries inside a Block, when translate:flase is applied Feb 25, 2025
@distantnative
Copy link
Member

distantnative commented Feb 25, 2025

@AlexanderBoenninger Would be really great if you could provide us your blueprint - really helps us in replicating the issue instead of guessing around. Thank you.

@distantnative distantnative added needs: information ❓ Requires more information to proceed needs: replication 🔬 Requires a sample to reproduce the issue labels Feb 25, 2025
@AlexanderBoenninger
Copy link
Author

Sure!

Block:

name: Bilder Slider
icon: images
preview: fields
wysiwyg: true

tabs:
  content:
    fields:
      entrys:
        extends: fields/img_slider
        min: 2
      ratio:
        label: field.blocks.image.ratio
        type: select
        placeholder: Auto
        width: 1/2
        options:
          1/1: "1:1"
          16/9: "16:9"
          21/9: "21:9"
          4/3: "4:3"
          3/2: "3:2"
          3/1: "3:1"
          1/3: "1:3"
          2/3: "2:3"
          3/4: "3:4"
          9/21: "9:21"
          9/16: "9:16"
      crop:
        label: Bild in Fläche einpassen
        type: toggle
        width: 1/2
  settings:
    fields:
      headline_2:
        label: Abstand
        type: headline
        numbered: false
      space_top:
        extends: fields/space
        label: Abstand Oben
      space_bottom:
        extends: fields/space
        label: Abstand Unten
      space_left:
        extends: fields/space
        label: Abstand Links
      space_right:
        extends: fields/space
        label: Abstand Rechts
      space_page_margin:
        type: toggle
        default: false
        text:
          - nein
          - ja
      headline_3:
        label: Position
        type: headline
        numbered: false
      position:
        extends: fields/position
        label: ...


fields/img_slider:

type: structure
label: Karussel Content
translation: false

fields:
  format:
    type: toggles
    default: "Bild"
    options:
      - Video
      - Bild
  video:
    extends: fields/video
    when:
      format: Video
  bild:
    label: Karussel Bild
    when:
      format: Bild
    type: files
    size: full
    info: "{{ file.dimensions }}"
    layout: cards
    max: 1
    templalte: casefile
    uploads: casefile
    query: site.pages.children.images
    image:
      ratio: 4/3
      back: white
  height_img:
    label: Höhe des Bildes/Videos
    help: "in keinen Displays und wenn nur ein Item da ist"
    after: "%"
    type: range
    default: 100
    min: 10
    max: 100
    step: 1
    width: 1/2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs: information ❓ Requires more information to proceed needs: replication 🔬 Requires a sample to reproduce the issue
Development

No branches or pull requests

3 participants