Possibility to fill content in panel from structure field on other pages

I have defined two times of content: books + publishers

On the books page I have a structure field which allows me to add/edit multiple versions of the book. Apart from other fields, for each version I can edit the ISBN and the publisher.

// book.yml

...
  versions:
    label: Versions
    type: structure
    sortBy: name asc
    sortable: false
    translate: false
    fields:
      isbn:
        label: ISBN
        type: text
      publisher:
        label: Uitgever
        type: select
        icon: false
        options: query
        sort: true
        query: 
          fetch: kirby.collection('publishers')
          text: '{{ page.title }}'
          value: '{{ page.AUTOID }}'
      autoid:
        type: hidden
        translate: false

On the publisher page in the panel, I would like to show a list of all books, that I have entered in the versions structure on the books pages. This could be a (disabled) multiselect or a structure field.

// publisher.yml

...
  books:
    label: All books from this publisher
    // how can I display these in the panel?

Is it possible to feed the content for a multiselect or structure dynamically based on some query or collection? I know this is possible to query the (multi)select options, but I cannot find any information about dynamically “feeding” the content of these fields.

Moreover, I would also be fine with simply displaying the books on the publisher page in a plain HTML list. But I have no idea how to achieve this simply in the panel (opposed to the website).

Can anyone help me in the right direction?

I don’t think a multiselect field (or any field for that matter) would be the right choice.

If those items were pages, I’d say use the pagesdisplay plugin (PagesDisplay Section | Kirby CMS), but of course that doesn’t work with a structure field.

So what are your options:

  1. a custom section that displays structure field items instead of pages
  2. turn the structure items into virtual pages and display in a pagesdisplay section (see above)
  3. use an info section that displays structure items in a HTML list (easiest option via a custom page method and a snippet).
1 Like