Form

Hello grav

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
---

What error does submitting yield?

Thank you for your help

Please find here screenshots Before-submitting After-submitting

Please note:

Error message in french output the 404 error page default.md message of standart error page (address is http://localhost/blog/fr/error/default/fr/md)

there is absolutely no styling?!

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?

Thanks for responding

I can’t see any way to solve this.
I am digging as far as I can and I feel that I am getting lost…

Form appear on http://localhost/fr/form.md without styling and lead to error page (no message)
(see captures in previous post)

Form do not appear on http://localhost/blog/fr/form {{ content }} is ouput with styling
reference picture Form-do-not-appear

Any help welcome!

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

Any help welcome

I finally found the issue: in site.yaml session name can not have any dot like in
site-name.com
it should be replaced by site-name-com for instance

So form works again!!!

Now form is working right now on a single page
not yet in modular page like previously…

I can not get the email to be sent from modular page anymore.

No email sent so far

Any ideas

Very proud of myself to have been able to find a way…

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?

Currently we have no way to donate. Hopefully we’ll have something soon!

ok I’ll wait then! Thanks again.

Note; Sommerregen has on its plugin repo on Github a FLATTR button…