@anon76427325, Yes I read the documentation and it is quite ok. I mean reading it again, it says everything. It’s just that a total newbie like me needs things to be emphasised sometimes I guess. I will give some examples. Please don’t judge, it’s really not simple when you start from little knowledge.
So the documentation says:
To add a form to a page of your site, create a page […]
Here my issue was that for me a “page” is not a very precise term. I was trying to find out where this page should be.
Earlier in the documentation it was well said that
you need to be aware that all our user content, is stored in the user/pages/
folder of your Grav install
but still, I had done some modifications in the theme template and so I it wasn’t obvious to me that whenever the documentation talks about a page, it refers to the pages of your websites that are in the pages folder. It sounds a bit obvious now, I admit, but it wasn’t at that time.
[…] and set its Page File to “Form”. You can do it via the Admin Panel, or via filesystem directly by naming the page form.md
.
This part made me unsure whether my issues could be related to the fact that my forms were not always in pages called form.md. And then this:
You can even provide the name of a form defined in other pages.
made me think that it was probably ok, but since it wasn’t working, I did spend a bit of time renaming my pages seeing if it was the issue.
Later it says
There is however a more powerful method of displaying forms that can take advantage of the new multi-forms support. With this method you actually pass a form:
parameter to the Twig template specifying the form you wish to display:
{% include "forms/form.html.twig" with { form: forms('contact-form') } %}
So what I’ve discovered is that neither the page in which you want the form to be rendered, nor the page where the form is defined actually need to be named form.md. It would have helped me here if it was said that the names of pages (both ways where it’s defined and where it’s rendered) don’t matter when you call forms by their names or path (please tell me if I’m not correct).
and then it is said that
An alternative way to display a form is to reference the page route rather than the form name using an array, for example:
# Contact Form
{% include "forms/form.html.twig" with { form: forms( {route:'/forms/contact'} ) } %}
Here I was back into my issue of knowing where my forms should be, because it wasn’t obvious at all to me that ‘/forms/contact’ refers to ‘grav/user/pages/forms/contact’. I mean it’s a bit the same as my “where my page should be” issue. It makes total sense now, but at that time, I was struggling, placing the forms everywhere , in the template folder, config folder, plugin folder, etc. cause there were some folders called “forms” here and there, so maybe it could be there .
Basically I think the documentation is quite good, and maybe close to very good, but when you’re a newbie, you need to hear things a few times in different ways, have recaps etc. because when you have issues, you try things where you feel the documentation is not toootally clear.
Finally for my YAML comment, yes I kinda knew the front matter was YAML synthax, cause well it is said before and I had even heard that in other contexts… and then the YAML bit of the documentation explains how it works, but it comes in the “advanced chapter”. I feel some emphasis earlier that one needs to be very careful about not messing up with the indentation would be useful. Also there’s no real mention that one should go and have a look at YAML chapter. You have to try clicking on the YAML hyperlink to realise that there’s a whole section about the YAML syntax (it’s already nice, don’t get me wrong, you did a really good job with this whole documentation, but for a newbie, a bit more emphasis would be useful). Also what is a bit confusing is that you have proper yaml files and also some yaml bits that can be in markdown files. A newbie may wonder if those are really the same YAML syntax exactly or not etc. At least I did.
Overall these are very small additions that are needed I think. Mostly recaps and emphasis, but for newbies they are super useful. By the way, I appreciate your reply. We can see that you care about it. It’s very nice. Thanks… and grav is great. I really like the website that it allows me to build at the moment and I feel I’m learning tons.