getgrav / grav-theme-agency

Agency Theme for Grav
https://getgrav.org
MIT License
27 stars 36 forks source link

How does the Contact Form work? #10

Closed blizam closed 8 years ago

blizam commented 8 years ago

The Readme says there's an included php file and the Changelog and contact.md refer to a Simple Form thing/plugin... not a Grav plugin but a plugin specific to Agency, in it's plugins folder?

I see this in contact.html.twig

'{% if config.plugins.simple_form.enabled %}'

but I don't see any simple_form in system.yaml or site.yaml

in simple_form.html.twig I see:

'https://getsimpleform.com/messages?form_api_token={{ token | e('html_attr') }}"'

Do I need to register an account on simpleform.com or something?

blizam commented 8 years ago

I'm sure this is wrong but in contact.html.twig if I change:

<div class="row"> {% if config.plugins.simple_form.enabled %} {% set simple_form_config = page.header.simple_form ?: config.themes.agency.simple_form %} {{ simple_form(simple_form_config) }} {% endif %} </div>

to

<div class="row"> {% set simple_form_config = page.header.simple_form ?: config.themes.agency.simple_form %} {{ simple_form(simple_form_config) }} {% include 'plugins/simple_form/simple_form.html.twig' %} </div>

It at least outputs the form... it doesn't pick up the auth code I set in the contact.md but I can hardcode it... seems like at the very least it's missing the Include for simple_form.html.twig and the config toggle for IF enabled

flaviocopes commented 8 years ago

It uses the Simple Form plugin which sadly has been discontinued (and removed) from its author.

I need to change this to use the Form plugin instead, which is the new way of handing forms in Grav.

In the meantime, you can copy templates/form.html.twig from Antimatter to start with, and start from here: https://learn.getgrav.org/forms/forms/example-form

blizam commented 8 years ago

Thank you, I'll check into using the Form plugin and since I intend to keep the current Agency form styling I'll post my code back here should it prove useful :)

flaviocopes commented 8 years ago

The theme part is fixed in https://github.com/getgrav/grav-theme-agency/commit/1f0e6623c1253cc646687982cbb856d80f9804f6

flaviocopes commented 8 years ago

Skeleton fixed too: https://github.com/getgrav/grav-skeleton-agency-site/commit/712ca1a1aad34b1f4fd9586a1dd253f2c1b0a9a4

swinde commented 6 years ago

Is there a technical reason to omit the closing tags for

and <div class = "container>,
? Sorry for Google translator