Hello everyone,
I’ve encountered an issue with Kirby version 4.2 that I’m hoping someone can assist me with. Here’s the problem:
In my setup, I have a parzelle.yml file and a models/parzelle.php file. Within parzelle.yml, I’ve defined two fields: one of type object and another of type structure. My objective is to have a default value displayed in the text field of the structure type, derived from a field within the object type.
Here’s an excerpt of my YAML configuration for clarity:
waterData:
label: Wasser
width: 1/2
type: object
fields:
nummer:
label: Zählernummer
type: text
hersteller:
label: Hersteller
type: text
startEich:
label: Eichjahr
type: date
display: YYYY
endEich:
label: gültig bis
type: date
display: YYYY
waterMeters:
width: 1/2
label: Wasser
type: structure
empty: keine Zählerstände vorhanden
fields:
year:
label: Jahr
type: date
display: YYYY
default: today
disabled: true
meter:
label: Zählerstand
type: number
kennung:
label: Zählernummer
type: text
disabled: true
default: "{{ page.waterNumber }}"
Additionally, my parzelle.php model includes the following method:
public function waterNumber(): string
{
$a = $this->waterData()->toObject();
return $a->nummer();
}
However, the default value is being outputted as expected when I apply the query in a field of type headline.
Could someone please point out what I might be doing wrong here? Any assistance would be greatly appreciated.
Thank you in advance!