Panel with Select within Structure does not show looked-up title

panelfield

#1

When moving a working Select field:

fields:
  artist:
    type: select
    options: query
    query:
      page: artists
      fetch: children
      value: '{{uid}}'
      text: '{{title}}'

… into a Structure:

fields:
  relatedartists:
    type: structure 
    label: Artists
    style: table
    fields:
      artist:
        type: select
        options: query
        query:
          page: artists
          fetch: children
          value: '{{uid}}'
          text: '{{title}}'

… the text part of the query is replaced by the the value part in the panel, so the uid is shown instead of the title. As mentioned when the identical field and its query are outside of the structure, it works and the title is shown.


#2

I can’t reproduce this, have you made. sure your indentation is correct?


#3

Yes. I also tried it in an empty project and it does not work.

But it is good to know that it should work, because then it makes sense to further “investigate” here…


#4

What is your Kirby version?


#5

The version is 2.5.10.


#6

I put your field from above into a fresh starter kit and everything works as expected, the only change I made was to the page because a Starterkit doesn’t have an artists page.

Does the title field exist? Maybe you named it differently?


#7

Yes, it does. The same field blueprint works perfectly when it is outside of the structure.


#8

What happens if you remove the text option? Title is the default, so it’s a bit weird that the uid is shown. The UID is the fallback value if no title exists.


#9

There is no change without the text option: the uid is shown. I also tried different fields to no avail. This is the “related” blueprint file part:

  title:
    label: Artist
    type: text
    required: true

So nothing special. I think I have to step through with the debugger to see what’s happening.


#10

Have you tested this in a fresh starterkit? All I can say that is works without any problem in my starter kit setup and have no idea how to reproduce your issue.


#11

Just did (new download of the start kit). Does not work. I must be doing something wrong.

Here is the code of the three files:

# artists.yml

title: Artists

pages:

  template: artist

fields:

  title:
    type: text
    label: Title
    required: true

# artist.yml

title: Artist

fields:
  
  title:
    label: Artist
    type: text
    required: true

# test.yml

title: Test

fields:

  relatedartists:
    type: structure 
    label: Related artists
    fields:
      artist:
        type: select
        options: query
        query:
          page: artists
          fetch: children
          value: '{{uid}}'
          text: '{{title}}'