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.

Archive

Best way to include a form in a non modular page?

Started by Muut Archive 10 years ago · 0 replies · 374 views
10 years ago

Hi,

I built a custom page (extends default one) with my custom fields. These files manage content in left/right columns of the page.

One of the field is a about a newsletter subscription. if contributor activates it and select a value in a list (there are several lists), then on front side, the apprioriate form is displayed.

For the moment, I started with static values to ease debug:

TWIG
            {% if page.header.rc_newsletter %}
            <div class="cvsq-page-widget">
                {% set newsletter = page.find('/newsletter/animation-laser') %}
                {{ dump(newsletter) }}

                {% include 'forms/form.html.twig' with {'page': page.find('/newsletter/animation-laser')} %}
            </div>
            {% endif %}

newsletter will indeed dump the correct page but the form remains empty.

As form.html.twig expects a form object, I tried with

TWIG
{% include 'forms/form.html.twig' with {'form': page.find('/newsletter/animation-laser')} 

But it does not work either.

What do I miss?

Thanks,
Nicolas

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1318 9 years ago
Archive · by Muut Archive, 9 years ago
2 915 9 years ago
Archive · by Muut Archive, 9 years ago
2 4044 9 years ago
Archive · by Muut Archive, 9 years ago
1 2920 9 years ago
Archive · by Muut Archive, 9 years ago
3 1104 9 years ago