I have got a kunden.yml file with a structure that has informations about shops.
title: Kunden
tabs:
structure:
label: Kunden
fields:
Kunden:
label: Kunden
type: structure
sortable: true
fields:
Logo:
type: files
required: true
Firma:
label: Firma
type: text
required: true
I would like to use those shop names in a select box in another structure examples.yml:
title: Arbeitsbeispiele Übersicht
tabs:
structure:
label: Arbeitsbeispiele
fields:
Beispiele:
label: Arbeitsbeispiele
type: structure
sortable: true
fields:
files:
type: files
required: true
Firma:
label: Firma
type: select
options:
type: query
query: page("kunden").kunden.toStructure
text: "{{ item.firma }}"
value: "{{ item.firma }}"
required: true
Datum:
label: Datum
type: date
display: DD.MM.YYYY
calendar: true
collection kunden.php
<?php
return function () {
return page('Kunden')->Kunden()->toStructure();
}
?>
I tried a lot of things
- pages.get(“shops”).kunden.toStructure
- kirby.collection(“shops”)
- page(“shops”).kunden.toStructure
The colletion isself works.
But the select always shows “Illegal offset type in isset or empty”:
Can anybody help me to solve this?