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

Cannot save frontmatter fields with custom modal in Admin

admin

Started by Anna 7 years ago · 0 replies · 465 views
7 years ago

Hello everybody,

I have a custom page type (event) that I made a custom modal page creation form in Admin for, almost exactly as described in the docs. It works well so far, but I would like to add some frontmatter fields to it since that is where most of the event information is stored.

However, while I can add those fields alright and fill them out, they do not get saved. After clicking "continue" I am taken to basically the same form with the title filled out and the fields that should have been saved as frontmatter empty.

I have noticed that the page creation modal does not seem to actually create the page – that seems to happen only after clicking save in the second form. That does explain why I can't save frontmatter before that :-) however, this is not what I want. I would like an easy way of creating new events in one step. If I can't do that with the modal, I really would like to skip that step altogether and have a button that takes me to a new event creation page straight away. Does anybody know how to achieve this? Either have a modal that actually creates a folder and file, or else be taken to a nonmodal page creation form directly?

Thank you for your ideas!

Suggested topics

Topic Participants Replies Views Activity
Forms & Blueprints · by Ton Haarmans, 5 years ago
13 1145 4 months ago
Forms & Blueprints · by Hugo Oliveira, 5 months ago
0 67 5 months ago
Forms & Blueprints · by Flachy Joe, 6 months ago
9 142 6 months ago
Forms & Blueprints · by Augustus, 7 months ago
7 118 7 months ago
Forms & Blueprints · by Julien, 7 months ago
10 136 7 months ago