I am totally new to GRAV. I have just started a first project and created a form for my website. I used the form plugin, I see the text on the top of the form (the text I can edit with the editor). After the text the form is displayed as it should.
My question: How can I add additional text after the form e.g. a disclaimer or something else.
You might try the Spacer field (not the best name I must admit) field:
YAML
form:name:xyzfields:name:type:texttest:type:spacertitle:Disclaimertext:By submitting this form, your accept our privacy policy ...underline:truebuttons:submit:type:submiit
thank you for your answer. What I meant was to put text under the form, not inside. The text should appear after the submit button and not be part of the form.
@sam2105, You could add a field in the frontmatter of the page and inherit and tweak form.html.twig. Write the value of the field from frontmatter below the output of the form.
Like:
YAML
// form.md---myExtraText:This is the text I would like to display below the form.form:name:xyz...---
TWIG
// form.html.twig: Inherited/overridden from user/plugins/form/form.htm.twig
...
{{content|raw}}{%include"forms/form.html.twig"%}{{page.header.myExtraText}}
Some additional information for everybody facing the same problem. I used the default template and NOT the form template. And in the extended options I have to activate the option processing markdown AND twig.
@sam2105, First of all, your solution works and will not cause you issues.
However, if you want to go for the extra mile...
You'll need a custom theme or an inheriting (aka child) theme. If using a downloaded theme, you will lose your changes when the theme gets updated.
See Theme Inheritance.
Copy file /user/plugins/form/form.htm.twig into /user/mytheme/templates/ and add the following content:
TWIG
{{page.header.myExtraText | markdown}}
The value of field myExtraText will now be processed as Markdown.
Add the following Yaml with a Markdown value to the frontmatter of the page:
YAML
---...myExtraText:"###Disclaimer\nCompany **Acme Corp** will not accept..."---
Note: In yaml, character # is used to denote comments. Because my sample starts with ###, the string needs to be surrounded by quotes. And since the string contains a newline, double quotes are needed.
Btw. there are more ways to format long text values in Yaml. See the Yaml specs.