Structure Fields Showing Raw Data

Hi everyone,

I’m encountering some issues with structure fields in my Kirby setup after updating my Kirby to v4 and would appreciate your help.

Basically instead of showing a preview of the pages on the structure fields, all the content is displayed as raw data. For example:

[ { "id": "pages/example-page", "title": "Example Page" } ]

Additionally, despite adding sortable: true to the structure field, the rows in the field remain non-sortable. There’s no drag-and-drop functionality to rearrange them.

Is there something I could be missing in my setup? It all worked fine before switching versions.

Thanks in advance for any guidance!

please share your blueprint setup for the page where the structure is located.

Sure! Thank you


fields:
  projects:
    label: Portfolio
    type: structure
    empty: No projects yet
    sortable: true
    columns:
      type:
        width: 2/12
      project_or_group:
        width: 5/12
      style:
        width: 5/12
    fields:
      type:
        label: Type
        type: select
        default: "project"
        options:
          project: Project
          group: Group
      project_or_group:
        label: Project or Group
        type: pages
        query: page.children.filterBy('template', 'in', ['default'])
        multiple: false
        subpages: false
        when:
          type: project
      style:
        label: Cover Style
        type: select
        default: "standard"
        options:
          standard: Standard
          slider: Slider
        when:
          type: project
      large_slider:
        label: Large Slider
        type: toggle
        text:
          - "No"
          - "Yes"
        when:
          style: slider

i think the id (and maybe even type) field might be a reserved keyword in the structureitem code, like $item->id(). You would need to migrate the content to use a different key as well as the blueprint to show it.

current content

Title: Some Title
----
projects:
  - id: pages/example-page
    title: example

new content

Title: Some Title
----
projects:
  - project: pages/example-page. # id to project
    title: example

blueprint

fields:
  projects:
    label: Portfolio
    type: structure
    # ... ommited for brevity
    fields:
      project:
         type: pages
         store: id # maybe this is needed, see field-properties (link below)

The issue was resolved by removing a plugin that was interfering with the latest Kirby version. Funny how that happens sometimes! Thanks again for your help.