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.

Support

Newbie question, use a plugin

form plugin plugins

Started by andre_ani 7 years ago · 9 replies · 787 views
7 years ago

Hello,

I'm new to Grav. It seems very interesting. But... I don't understand how it works. I've installed some plugins, but I don't know how to use them.
Forms for example, I don't know how to make a simple contact form.
I look at the doc, but I can't create a form...

Or for the cookies.

Someone to help me begin with it please ?
Thanks ;-)

ANDRE Ani

7 years ago

Plugins in Grav mostly work through Templates or shortcuts.
or special markdown Files with extra header (=frontmatter).
As for contact Forms, take a look at the forms dokumentation - this should get you started.

7 years ago

I don't understand what is frontmatter... I've looked at the doc for Forms, but Idon't know where to put the example code... I've nothing on the page.

7 years ago

frontmatter is the head of your markdown page, all between
'---
title:XYZ ....

and
'---
the format for frontmatter is yaml

just copy this text
and save it as form.md in your form page folder.

7 years ago

I don't know how I do it but I have a form contact now ;-) In the page editor, I have just modified the template for form and the form appears.

Ok for frontmatter. But I don't understand it's utility and difference with the content of the page.

For some plugins, we have to modify the template (for cookies for example). Is it in frontmatter or in the content ?

7 years ago

page content is usually just what you write AFTER the frontmatter section.
you see it just as text on your website.
and no, templates are not frontmatter, they are a mix of html and twig template language, they are to define what will be shown where in a page.
twig variables are often variables which hold content defined by a plugin.
that's the way plugins work through templates.
the other way is through frontmatter, and another one is through shortcodes.
usually, you can find in the plugin documentation, which mehtod can be used (one or more of the above...)

7 years ago

Thanks a lot for your explanations ;-) It's more clear now.
But I asked me, why all these methods ? It's not simple.

7 years ago

not so simple, at a first look, agreed 🙂 - but it gives a lot of flexibility.
once you get used to it, it is easy, much more than having to click around in more or less inconsistent backend UI's (like the Wordpress plugin mess).

👍 1
7 years ago

Again a question for another plugin, please. Because there's something I don't really understand. For this plugin : https://github.com/kwachu96/grav-plugin-cookies-notice it says to add this code {{ cookiesnotice_markup }} before the body close tag. Is it in expert mode when editing a page, in the frontmaster ? Or in the content ? Or directly, with an external editor in the twig file directly ? I don't understand...

7 years ago

Ok, I found. It's directly in the twig template. Is there a more simple way to do this ? Impossible from the editor in the admin ?

Suggested topics

Topic Participants Replies Views Activity
Support · by Thomas, 1 week ago
2 60 16 hours ago
Support · by Anna, 3 days ago
2 66 19 hours ago
Support · by Justin Young, 20 hours ago
1 34 19 hours ago
Support · by Duc , 1 week ago
2 70 6 days ago
Support · by Colin Hume, 1 week ago
2 61 6 days ago