我已经查看这些文档https://learn.getgrav.org/forms/forms#multiple-forms 1 天了,但仍然无法看到我做错了什么。它填充两种形式的问题,但仅在此处列出的第一个:
forms:
sign-up-form:
title: Bolig i ....?
fields:
- name: navn
label: navn
placeholder: Navn
autofocus: off
autocomplete: off
type: text
validate:
required: true
- name: email
label: email
placeholder: Email
autofocus: off
autocomplete: off
type: text
validate:
required: true
buttons:
- type: submit
value: Skriv mig op
classes: "button white"
process:
- email:
from: "{{ config.plugins.email.from }}"
to:
- "{{ config.plugins.email.from }}"
- "{{ form.value.email }}"
subject: "[Feedback] {{ form.value.name|e }}"
body: "{% include 'forms/sign-up-form/data.html.twig' %}"
- save:
fileprefix: feedback-
dateformat: Ymd-His-u
extension: txt
body: "{% include 'forms/data.txt.twig' %}"
- message: Tak for din henvendelse, vi vender tilbage
footer-form:
title: Interesseret i ....?
fields:
- name: navn
label: navn
placeholder: Navn
autofocus: off
autocomplete: off
type: text
validate:
required: true
- name: email
label: email
placeholder: Email
autofocus: off
autocomplete: off
type: text
validate:
required: true
- name: phone
label: phone
placeholder: Telefon
autofocus: off
autocomplete: off
type: text
validate:
required: true
buttons:
- type: submit
value: Ja tak kontakt mig
classes: "button white"
process:
- email:
from: "{{ config.plugins.email.from }}"
to:
- "{{ config.plugins.email.from }}"
- "{{ form.value.email }}"
subject: "[Interesse I ....] {{ form.value.name|e }}"
body: "{% include 'forms/footer-form/data.html.twig' %}"
- save:
fileprefix: feedback-
dateformat: Ymd-His-u
extension: txt
body: "{% include 'forms/data.txt.twig' %}"
- message: Tak for din henvendelse, vi vender tilbage
我在我的列表中列出了两个表单配置,default.md
然后它完美地呈现了页面,但是我呈现表单的两个地方我以以下方式呈现它们:
{% include 'forms/sign-up-form/form.html.twig' with { form: forms('sign-up-form') } %}
{% include 'forms/footer-form/form.html.twig' with { form: forms('footer-form') } %}
我的想法为零,现在我只是对这里的任何解决方案视而不见,我希望这里有人可以帮助我。