Multi-sections datas issue

Hi !
First thank you so much to Kirby existance :heart_eyes:

I’ve an issue to get back my data on a multi sections page.

On my blueprint I put a Fields section and a Page Section to create subPage :

columns: 
  - width: 1/1
    sections:
      contentCol:
        type: fields
        fields:
          title_part_collections:
            label: Titre de l'index
            type: text
 
  - width: 1/1
    sections:
      pages:
        type: pages
        template: 
          - historique
          - contemporain
          - suivi-de-chantier
        max: 3
        layout: cards
        image: 
          cover: true
          back: white

After that I make a representation file of my page to take back my datas ( but I imagine it will be the same issue if I used a classical php template )

I try multi stuff to find my title :

$data = [
    'title' => 'page' => $page->contentCol()->data()    
];

answer : value: null

$data = [
    'title' => 'page' => $page->contentCol()->title_part_collections()
];

answer : value: null

$data = [
    'title' => 'page' => $page->title_part_collections()
];

answer : value: null

$data = [
    'title' => 'page' => $page->content()->data()
];

answer : it’s give me page section content, it return an object with all subPage’s fields

My content :

If you can give me a tips to access to this title-part-collections data it will be super…

Thx a lot !

You are using a fields section, so that means that you have to access each field separately:

This should work to access the title_part_collections field, but the $data array should look like this:

$data = [
    'title' => $page->title_part_collections()
];

I badly simplify my code but it was what I did.
I make you an other test with exactly this configuration:

$data = [
    'title' => $page->title_part_collections()
];
echo json_encode($data);

Answer: Capture d’écran 2022-07-29 à 08.51.41

Is there an error in the structure of my yml?

Ok…
sorry it was a stupid error on my representation file, where I assigned $page to a subpage…
Thx ! :pray: