Pages field inside structure field: Selected page title not shown?

I have a pages field inside of a structure field. The pages field is querying the listed children of some other page of the site…

event:
  type: pages
  label: Event
  options: query
  query: site.find('Program').children.listed
  max: 1
  text: "{{ page.title.upper }}"
  help: …select an event
  when:
    type: event

Selecting a page works just fine, but afterwards the structure field entry is not displaying the selected page’s title…

Why could this be happening?

You’d have to define what you want to see in the table columns, see docs:

@texnixe Thank you. But how would I configure the table column to display the selected page’s title? The only options available for the columns property are width, align, before, after and mobile.

I think the problem is not with the structure field but the pages field inside of it…

event:
  type: pages
  label: Event
  options: query
  query: site.find('Program').children.listed
  max: 1
  text: "{{ page.title.upper }}"
  help: …select an event
  when:
    type: event

Although it’s configured to display the selected page’s title ({{ page.title.upper }}), it’s not displayed in the field.

Interestingly, it is displayed right after selecting a page, but as soon as I close structure field’s editing dialog, only a dash is displayed…

(right after selecting a page)

(after closing the dialog)

(hence no title visible in the corresponding column)

Well, what you have in the text field in your pages field is what is shown for the field, but not for the columms. That’s why I pointed you to the columns configuration, which is a separate thing.

I’m still confused. How does the column config. relate to the missing/not displayed page title? The column itself works, it shows the selected page, just without it’s title.

I did some testing. The problem might be related to the query option I’ve set for the pages field: When removing it, the selected page’s title is displayed just fine :thinking:

(with query option)

event:
  type: pages
  label: Event
  options: query
  query: site.find('Program').children.listed
  max: 1
  text: "{{ page.title }}"
  help: …select an event

(without query option)

event:
  type: pages
  label: Event
  # options: query
  # query: site.find('Program').children.listed
  max: 1
  text: "{{ page.title }}"
  help: …select an event

The problem is not the query, but options which is not a valid property of the pages field.

1 Like

Ah, silly mistake. Thank you!