How to display structured field data in pages section 'info'

I have a series of events that are categorized through a multiselect query:

    width: 1/2
    label: Type
    type: multiselect
    translate: false
    options: query
      text: "{{ structureItem.title }}"
      value: "{{ structureItem.autoid }}"

This query pulls from a structured field from a ‘Types’ page:

title: Types
    label: Types
    type: structure
        type: hidden
        translate: false
        label: Title
        type: text
        label: Description
        type: textarea

I’m trying to pull this information into the pages section ‘info’, so for example, Test Program is tagged with Talk and Exhibition, I would like to show this to the user on the right side:

I’m a bit confused how to bring this in as info: "{{page.type}}" just shows the saved autoid(s) of course.

I reality you would have to query the structure field to get the realy values via the autoid. I think this is best done via a page model.

Thank you @texnixe this is exactly what I was looking for. In case it helps anyone else, this was my solution:


class EventPage extends Page {
  public function types() {
    $type_ids = explode(", ", $this->type());

    return implode(", ", site()->page('types')
      ->filterBy('autoid', 'in', $type_ids)

I’m wondering if this coudl be written better as the exploding/imploding feels a bit hacky to me, but it does work!