My email form went out of order, I am trying to get it back.
I have been coding it from zero seperately according to the docs create a simple form but for some reason, there are unattended issues.
First: form.md is output without any styling (form.md is referenced below).
I can’t understand why.
Second:
push submit leads to an error,
no mail sent to data,
no redirection to thank you
I am becoming crazy… please help!
title: A page with a form
form:
name: my-nice-form
fields:
- name: name
label: Name
placeholder: Enter your name
autofocus: on
autocomplete: on
type: text
validate:
required: true
- name: email
label: Email
placeholder: Enter your email address
type: text
validate:
rule: email
required: true
buttons:
- type: submit
value: Submit
process:
- email:
from: "{{ config.plugins.email.from }}"
to:
- "{{ config.plugins.email.from }}"
- "{{ form.value.email }}"
subject: "[Feedback] {{ form.value.name|e }}"
body: "{% include 'forms/data.html.twig' %}"
- save:
fileprefix: feedback-
dateformat: Ymd-His-u
extension: text
body: "{% include 'forms/data.txt.twig' %}"
- message: Thank you for your feedback!
- display: /thankyou
MY FORM
Please note:
I have 3 languages [fr, ja, en]
I have 3 environnements [localhost, blog, docs] > multisite subdirectory structured site
example of folder structure is for language [fr]
`/user`
`/user/pages/01.home/modular.fr.md` (antimatter inheritence mytheme)
address > http://localhost/fr
`/user/sites/blog/01.home/form.fr.md` (antimatter inheritence mytheme)
address > http://localhost/blog/fr/form
`/user/sites/docs/01.home/chapter.fr.md` (learn2 inheritence mytheme)
address > http://localhost/docs/fr/some-docs
---
Styling will have something to do with how the template accesses the stylesheets, likely a typo in an include or the template not extending a parent template. This happens in the .twig.html-files, not the Markdown-files (.mnd).
Is the “After-submitting” redirecting to the 404-template? It is seemingly outputting a validation error on the form-template itself. Hard for me to say without knowing french though. Troubleshooting the templates in your multisite setup really requires a thorough overview of the files. Is the Antimatter theme, which your theme inherits from, unaltered?
Correction:
statements of previous post are wrong. All my apologies
Correct statement:
Form appear on both http://localhost/fr/form.mdand http://localhost/blog/fr/form without styling and lead to error page > no message sent
(see captures in previous post)
Form do not appear on template set page.header to default.md or blog.md. {{ content }} is ouput with styling > no form, no message sent
Check your email plugin configuration. You might need to modify it to get things working but it really depends on your host and even potentially, the mx records for your domain.
I really appreciate your post, Rhukster, thank you.
It’s important to find support…
I finally manage to have my modular form working again!!! I am very proud of myself right now, and it’s a good experience!
Franckly, I don’t know how I have been able to find it out!!! …
It’s also hard for me because Grav is my first experience in web site building.
Sometimes I feel descriptions in english are too shorts for me to get all what they imply (especially in such a strategic place as system.yaml like right now…
Anyway, everything is set again and that’s what is important.
Problem was in system.yaml, parameter in section pages: theme: mytheme markdown: extra: true: redirect_default_route.
It was set to true while it was to be on false (so that the form address in the template finds the proper real address…).
Here is the address of my site (it’s under construction!!!).
By the way, I am thankful, and would like to donate to Grav, is there a way to do so?