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.

Forms & Blueprints

"Embedding Form (import@)" example not saving data in page header

admin first-time form

Solved by pamtbaau View solution

Started by Giulio Scattolin 6 years ago · 1 replies · 558 views
6 years ago

Hi everybody!

I'm currently using the latest Grav 1.6.23 + Admin 1.9.13 and the default Quark theme. I'm following these instructions on a new Grav instance. The fields are rendered correctly but the data is not stored after saving: the list is empty when it should not.

Am I missing anything?
Thank you very much!

6 years ago Solution

@giulio.scattolin, I presume you are using the example in a page blueprint?

When creating a blueprint for a page, fields that need to be saved into the header of the page need to be prefixed with header.

So, in your page blueprint, the snippet for the included form should then look like:

YAML
form:
  fields:
    header.gallery.images:  <-- Added prefix 'header.'
      type: list
      label: Images
      fields:
        .src:
          type: text
          label: Image

After adding items 'image1' and 'image2' to the list, the following values will be added to the page header:

YAML
gallery:
  images:
    -
      src: image1
    -
      src: image2

Hope this helps...

👍 1
last edited 03/24/20 by pamtbaau

Suggested topics

Topic Participants Replies Views Activity
Forms & Blueprints · by Ton Haarmans, 5 years ago
13 1165 4 months ago
Forms & Blueprints · by Hugo Oliveira, 5 months ago
0 89 5 months ago
Forms & Blueprints · by Flachy Joe, 6 months ago
9 163 6 months ago
Forms & Blueprints · by Augustus, 7 months ago
7 138 7 months ago
Forms & Blueprints · by Julien, 7 months ago
10 156 7 months ago