Skip to content
Grav 2.0 is officially stable. Read the announcement →
Archive

Insert form midway through page content

Started by Muut Archive 10 years ago · 4 replies · 416 views
10 years ago

Can a contact form be placed halfway through a page's content?
For example: in form.md

TXT

Page content..

{output form here}

More page content...
---
10 years ago

Another alternative, which I use frequently, is to separate between summary and content using the === break. So for example:

TXT
Introduction, for example a paragraph or two.

===

Rest of content, several paragraphs.

And in twig, I use:

TWIG

{{ page.summary }}
{% include "forms/form.html.twig" %}
{{ page.content|slice(page.summary|length) }}
10 years ago

Alternatively you can put the form as part of a modular page.

A modular page allows you to put content on top, then the form in the middle, then another content after the form.

Quick tutorial here.

10 years ago

The Page Inject plugin seems to be the ideal solution, but it doesn't work with forms.

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1354 9 years ago
Archive · by Muut Archive, 9 years ago
2 935 9 years ago
Archive · by Muut Archive, 9 years ago
2 4064 9 years ago
Archive · by Muut Archive, 9 years ago
1 2951 9 years ago
Archive · by Muut Archive, 9 years ago
3 1119 9 years ago