-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unexpected results from form blueprint #1287
Comments
Add the header.taxonomy.tag:
type: checkboxes
label: 'Tag for Blog Post'
options:
tag1: 'Tag 1'
tag2: 'Tag 2'
tag3: 'Tag 3'
tag4: 'Tag 4'
use: keys It will store as taxonomy:
tag:
tag1: true
tag2: true
tag3: true
tag4: false |
Thank you very much for the info @flaviocopes (I did not know about keys) but I am still unable to get the results I am trying for - setting the tags for a taxonomy as recognized by Grav. I am trying to get this final result:
Is this even possible then? Might there be another format accepted by Grav when building taxonomy tags? Thanks again, |
I tried on a page blueprint. Did you use it on a page blueprint too? Or if somewhere else, where? |
I am using it in a blueprint along with the Add Page by Form plugin (https://github.com/bleutzinn/grav-plugin-add-page-by-form), perhaps I also need to loop back with the plugin author and do some more tests. Thanks again for your help! |
Oh ok thanks, in a frontend form. I thought in an Admin blueprint. Need to test as well. |
Might as well be unique to that plugin, as the frontmatter is created upon form submit. |
In the Add Page plugin I merge the preset frontmatter with the submitted field values and format the YAML like this: I was "inspired" by the exact same line of code in the Admin plugin. |
I've looked into the issue a bit. Why the Add Page plugin does is that it inserts the form field values as frontmatter of the newly created page. This goes well for simple field types such as text fields. However, with more complex field types such as checkbox this is not as straightforward. |
@bleutzinn try doing this https://github.com/getgrav/grav-plugin-admin/blob/develop/classes/admincontroller.php#L1707-L1708 which is in the method that prepares the page for storage after saving. |
Thanks flaviocopes. I've changed With four checkboxes in the form named
Pages with frontmatter in the above format are found when using With the addition of
However, with this format pages with this tags can not be found using The above format is initially displayed as such in the Admin. Things get really weird when you edit this frontmatter in Admin and, for instance, change
|
As suggested in getgrav/grav#1287 (comment)
I have the following blueprint:
And the front matter generated looks like this:
Is this an issue with my blueprint formatting or an issue with Grav blueprint processing?
Thanks very much,
Paul
The text was updated successfully, but these errors were encountered: