In another post I managed to use grav's default form in the woo template ( http://getgrav.org/forum#!/general:instert-a-simple-contact , tried to bump it with this subject but lets separate it ).
Now the problem I'm faced with is putting the contact into the modular home page. I have read the documentation on it: http://learn.getgrav.org/advanced/forms#using-forms-in-modular-pages
I tried to follow the steps described but ended up with an empty section where the form should be. Here are the questions I have regarding the instructions:
- In your theme, add a templates/modular/form.html.twig file copying templates/forms/form.html.twig.
a. Shouldn't I edit first the form.html.twig to get rid of these lines?
{% extends 'partials/base.html.twig' %}
{% block content %}
{% endblock %}
b. should I copy formdata.html.twig together with forms folder from the templates folder? ... inside formdata.html.twig there are references to that folder.
-
Create a modular folder with page type form.md
a. Need a bit of clarification on what should I understand under modular fol der. I have a modular folder01.homeshould I create a folder inside this modular folder like _contact or add a form.md just near modular.md?
b. Can I just copy the single page form.md that is working in single page mode into the modular folder? -
Add the form header to the main modular page, modular.md ?
a. form header, that's from the single page form.md thefrom:withename:,fields:, etc. or the whole header that is everything from form.md except the begin/end signs---
b. Or for form headerform: action: /is enough without any other property? (my modular page is the home page)
As for my results, if I put the form.md near the modular.md I will get instead of my modular page the form only. If I create a _contact folder with form.md I get the a white section that is from trying to render my form but only a little white area is all that I get instead of a form. Looking at its source I it renders my form into this:
<section id="contact" style="padding: 90px 0 72px; background: #fff;">
<div class="alert"></div>
<form name=""
action="/newsite/home/_contact"
method="POST">
<div class="buttons">
</div>
</form>
</section>
Thanks for any help! :)