-
Notifications
You must be signed in to change notification settings - Fork 788
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
Form in modular pages documentation is outdated #867
Comments
This documentation might be also affected: https://learn.getgrav.org/16/forms/forms#modular-forms |
Please be free to fix the documentation. In the mean time there's a reason why the form is in the "parent" page. That is basically needed to make the URL correct, otherwise submitting the form fails (blueprints are needed to validate the form). We used to have forms in modular, but none of them were working without a lot of trickery by the person who wrote the form. And that generally meant writing some code as well. The current solution is nowhere perfect, though, but at least makes the forms to work (yes, Cache must be disabled in any page having a form (including parent page if you have modular form). That is a limitation of current implementation. |
Hm, I did not need to disable the cache, but I added the form loading inside the twig template, not the markdown file. Having the form in the parent makes sense. It seems to still work on my case, even with redirect to |
Oh yeah, you cannot really add form loading to Markdown as there's really no way to find out that form needs to be loaded. I think there's a way to get some forms to work like that, but.. It's complicated. |
https://learn.getgrav.org/16/forms/forms/how-to-forms-in-modular-pages
From my testing it seems that the following changes are not true for the current forms plugin 4.2:
templates/form.html.twig
should be renamed totemplates/modular/form.html.twig
templates/formdata.html.twig
should be removedtemplates/modular/form.html.twig
is currently missing in antimatter or other themes (I can provide an example for quark, if you wish)action
can be left empty, it will just work. I used#anchor
to scroll to the modular page however. It might be a useful hint.If you wish, I can add a modular form for quark theme, similar to the text template but with a form instead of an image.
The text was updated successfully, but these errors were encountered: