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

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

General

List field inside a list field

Solved by Michael Garcia View solution

Started by Michael Garcia 8 years ago · 1 replies · 665 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 Jerry Hunt, 4 days ago
2 82 10 hours ago
General · by pamtbaau, 16 hours ago
1 53 15 hours ago
General · by Andy Miller, 1 day ago
0 45 1 day ago
General · by Marcel, 12 months ago
6 347 5 days ago
General · by Duc , 5 days ago
3 41 5 days ago