Skip to content
Grav 2.0 is officially stable. Read the announcement →
General

List field inside a list field

Solved by Michael Garcia View solution

Started by Michael Garcia 8 years ago · 1 replies · 714 views
8 years ago

Hi,

i'm editing my .yaml file from a template and I would like to add a list inside another one. I think my .yaml is good because it's working on my back office.

My issue is that when I save the page, everything I contributed inside my child list disappears. Does anyone have an idea ?

Thank you very much

My .yaml :

YAML
header.composition:
  name: composition
  type: list
  style: vertical
  label: Composition des différentes bandes de la page projet
  fields:

    .background:
      type: select
      size: long
      classes: fancy
      label: Couleur de fond
      options:
        "#FFFFFF" : Blanc
        "#ececec" : Gris 1
        "#d8d8d8" : Gris 2
        "#aab1b6" : Gris 3

    .images:
      type: list
      style: vertical
      label: Liste d'images
      fields:
        uneImage:
          type: filepicker
          folder: '@self'
          label: Image
          preview_images: true
          accept:
            - .png
            - .jpg

Here's a screenshot of my backoffice before and after saving :

34|587x500

Thank you for your help !

8 years ago Solution

Ok...
So I just fixed it :
I forgot to add the "." in my child list.

Thank you

Suggested topics

Topic Participants Replies Views Activity
General · by Hanns Mattes, 3 weeks ago
1 268 3 weeks ago
General · by Andy Miller, 3 weeks ago
0 196 3 weeks ago
General · by Jerry Hunt, 3 weeks ago
2 331 3 weeks ago
General · by pamtbaau, 3 weeks ago
1 253 3 weeks ago
General · by Andy Miller, 3 weeks ago
0 225 3 weeks ago