Querying structure items within blocks

,

Hi all - I am having trouble using query language to get items from a page’s structure field in a block.

Blueprint for the ‘range’ page (site.com/range)

 fields:
  products:
    type: structure
    label: Products
    style: table
    fields:
      productImage:
        type: files
        label: Product Image
        max: 1
      productTitle:
        type: text
        label: Product Name
      productType:
        type: select
        label: Product Type
        options:
          - fish
          - shellfish
          - sundries

Block:

name: Featured Products
icon: template
label: "{{ heading }}"
tabs:
  Content:
    label: Content
    icon: text
    fields:
      heading:
        label: Heading
        type: text
        default: Featured producs
      featuredProducts:
        label: Featured products
        type: select
        max: 3
        options: query
        query:
          fetch: site.find("range")products.toStructure
          text: "{{ productTitle }}"
          value: "{{ productTitle }}"

Current behaviour is a select field in the block’s panel view being rendered without any contents. (V5)

Hopefully a simple trick I’m missing. Thanks in advance!

There’s a dot missisng between find(‘rande’) and products.

And the productTitle won’t return anything, see Select | Kirby CMS

1 Like

Ah thanks, pesky typo.. plus need the ‘item’ prefix. Perfect!