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.

Plugins

How to display the form plugin "Thank You" message in a modal popup?

form plugins theme

Solved by Julien Perret View solution

Started by Julien Perret 7 years ago · 4 replies · 3102 views
7 years ago

Hi everyone,

I'm using the Ceevee theme and the form plugin with email included in the theme.
The form is in the "Contact" page and the success message in a "thank you" page.
When the form is submitted and the email sent, the form redirects the website to /home with the "thankyou" message page under the "about" section of the website.

I want to display this "thank you" message page in a modal popup.
I suppose it can be done almost natively as I saw many included css and js mentioning modal pop ups (i.e. magnific-popup.js and css plus "popup-modal" class in the layout.css) but I can't figure out how to modify the plugin to do so.

For the moment I got this modular.md at the root of my Homepage,
...
form:
name: my-nice-form
action: /home
fields:

YAML
            name: name
            label: Nom
            placeholder: 'Entrer votre nom'
            autocomplete: 'on'
            type: text
            validate:
                required: true
        -
            name: email
            label: Email
            placeholder: 'Saisissez votre adresse email'
            type: text
            validate:
                rule: email
                required: true
        -
            name: message
            label: Message
            size: long
            placeholder: 'Nombre d exemplaires et adresse'
            type: textarea
            validate:
                required: true
    buttons:
        -
            type: submit
            value: Envoyer
            class: submit
    process:
        -
            email:
                from: '{{ config.plugins.email.from }}'
                to:
                    - '{{ config.plugins.email.to }}'
                    - '{{ form.value.email }}'
                subject: '[Feedback] {{ form.value.name|e }}'
                body: '{% include ''forms/data.html.twig'' %}'
        -
            save:
                fileprefix: feedback-
                dateformat: Ymd-His-u
                extension: txt
                body: '{% include ''forms/data.txt.twig'' %}'
        -
            message: 'Merci !'
        -
            display: thankyou

...
The thankyou message is a "formdata" template hidden page.

I found this related request on the website, but I can't figure out how to do it:
/forum/archive/thank-you-message-in-div-or-modal-t583

If you can give me some hints here it would be appreciated. Thanks in advance.
regards

7 years ago

Thank you @RobLui, I already came across this article but I'm new to Grav and it's particular workflow.
I will check this article more carefully and will post here the result.

👍 1

Suggested topics

Topic Participants Replies Views Activity
Plugins · by Rene, 1 week ago
2 41 1 week ago
Plugins · by Xavier, 4 weeks ago
2 50 4 weeks ago
Plugins · by Luka Prinčič, 7 years ago
3 1178 1 month ago
Plugins · by Sebastian van de Meer, 1 month ago
1 45 1 month ago
Plugins · by PIERROT Alain, 2 months ago
3 68 2 months ago