Hi,
In my blog, I have a list of authors in my blog page with a structure field, like this :
authors_tab:
label: Auteurs
icon: account
fields:
authors:
label: Auteurs
type: structure
fields:
name:
label: Prénom
type: text
counter: false
surname:
label: Nom
type: text
counter: false
mail:
label: Mail
type: text
counter: false
role:
label: Rôle
type: text
counter: false
description:
label: Description
type: text
counter: false
photo:
label: Photo
type: files
When I try to get the structure with:
<?php $authors = page('blog')->authors()->toStructure(); ?>
It return this instead of my structure field:
pre: Kirby\Cms\Structure Object
(
[0] => 0
[1] => 1
[2] => 2
)
The field:
<?php $authors = page('blog')->authors(); ?>
Return this:
pre: Kirby\Cms\Field Object
(
[authors] => -
name: Jean
surname: Quette
mail: email@email.com
role: Butcher
description: Lalalala
photo:
- file://qaWOtrVnoOot0QI9
-
name: Pierre
surname: Ponce
mail: email@email.com
role: Butcher
description: Lalalala
photo:
- file://Gcl5tMfAtDmxoV9S
I don’t understand how toStructure works …
Thanks!