如何使用表单插件在管理面板的页面中包含多个表单

时间:2019-05-26 15:44:17

标签: php gravity-forms-plugin grav

我正在使用从管理面板运行的grav插件。我已使用自定义模板将新页面添加到管理导航侧栏,现在我想通过文件上传向其添加多个表单。出于测试目的,我从一个表单开始,虽然当我在模板中使用{% include "forms/form.html.twig" %}时它确实会生成表单,但是当我尝试指定要使用{% include "forms/form.html.twig" with { form: forms('testing') } %}生成哪个表单时,它只是空白。关于如何解决此问题的任何想法吗?

我要呈现的表单示例

forms:
    testing:
        method: POST
        fields:
            action:
                type: hidden
                default: "create"
            new_project_name:
                label: New project name
                type: text
                size: small
            new_description:
                type: Textarea
                label: 'Project description'
                name: 'new_description'
                id: 'new_description'

            new_project_files:
                type: file
                label: Project files
                multiple: True
                destination: user/pages/media/
                name: 'new_project_files'
                id: 'new_project_files'
                accept:
                    - image/*
                    - audio/*
                    - video/*
            create_history:
                label: Share with sycamore
                type: radio
                name: create_history
                default: true
                required: true
                options:
                    True: yes
                    False: no

        buttons:
            - type: submit
              value: Submit

        process:
            custom_upload: "create"

0 个答案:

没有答案