How to retrieve data from a blueprints when there are structures?
It’s OK for simple data:
$options = $kirby->user()->blueprint()->field('bio');
or
$options = $kirby->user()->blueprint()->field('sex')['options'];
It’s OK
To search in a structure and a substructure how to do?
here is the simplified result of the dump:
["athlete"]=>
array(5) {
["label"]=>
string(10) "L'athlète"
["icon"]=>
string(4) "text"
["columns"]=>
array(1) {
[0]=>
array(2) {
["width"]=>
string(3) "1/1"
["sections"]=>
array(1) {
["athlete"]=>
array(3) {
["type"]=>
string(6) "fields"
["fields"]=>
array(3) {
["size"]=>
array(5) {
["bio"]=>
array(4) {
["label"]=>
string(3) "Bio"
["type"]=>
string(8) "textarea"
["width"]=>
string(3) "1/1"
["name"]=>
string(3) "bio"
}
}
["name"]=>
string(7) "athlete"
}
}
}
}
["link"]=>
string(21) "/account/?tab=athlete"
["name"]=>
string(7) "athlete"
}
["social"]=>
array(5) {
["label"]=>
string(12) "Suivez-moi !"
["icon"]=>
string(4) "text"
["columns"]=>
array(1) {
[0]=>
array(2) {
["width"]=>
string(3) "1/1"
["sections"]=>
array(1) {
["social"]=>
array(3) {
["type"]=>
string(6) "fields"
["fields"]=>
array(3) {
["url_strava"]=>
array(4) {
["label"]=>
string(11) "Lien Strava"
["type"]=>
string(3) "url"
["width"]=>
string(3) "1/2"
["name"]=>
string(10) "url_strava"
}
["social_events_listing"]=>
array(5) {
["label"]=>
string(10) "Historique"
["type"]=>
string(9) "structure"
["fields"]=>
array(3) {
["social_events_date"]=>
array(5) {
["label"]=>
string(4) "Date"
["type"]=>
string(6) "number"
["max"]=>
int(2050)
["width"]=>
string(3) "1/2"
["name"]=>
string(18) "social_events_date"
}
["social_events_listing2"]=>
array(5) {
["label"]=>
string(13) "Sous-texte(s)"
["type"]=>
string(9) "structure"
["fields"]=>
array(5) {
....
["social_materials_listing2_select"]=>
array(6) {
["label"]=>
string(4) "Materials"
["type"]=>
string(6) "select"
["default"]=>
string(11) "materials_default"
["options"]=>
array(3) {
["materials_default"]=>
string(0) ""
["materials_1"]=>
string(8) "Material 1"
["materials_2"]=>
string(22) "Material 2"
}
["name"]=>
string(32) "social_materials_listing2_select"
["width"]=>
string(3) "1/1"
}
}
["name"]=>
string(25) "social_materials_listing2"
["width"]=>
string(3) "1/1"
}
}
["name"]=>
string(24) "social_materials_listing"
["width"]=>
string(3) "1/1"
}
}
["name"]=>
string(6) "social"
}
There is a first structure social_events_listing
then a second social_events_listing2
I would like to reach social_materials_listing2_select
which is built in the same way as the select sex