龙门5 - 用于粒子配置的自定义字段类型


Gantry5 - custom field type for particle configuration

我是Gantry5框架的新手,我开始创建自定义粒子,总而言之,这并不难。

我正在使用Gantry5进行Wordpress,我想创建一个粒子,可以使用现有页面进行配置。

因此,我需要一个表单字段,在最好的情况下是一个下拉菜单,它显示页面列表。

现在粒子(custom/particle/page_particle.yaml)的配置如下所示:

name: Page
description: Displays the content of a Page
type: particle
form:
  fields:
    enabled:
      type: input.checkbox
      label: Enabled
      description: Globally enable to the particles.
      default: true
    title:
      type: input.text
      label: Title
      description: Customize the section title text.
#following lines describe what I need
    page:
      type: ##custom type
      label: Page
      default: -1

有谁知道如何添加代码(放置位置,如何命名)以及如何告诉龙门架有关新类型的信息?

提前感谢!

请在此处查看教程。它可能会有所帮助

https://github.com/jarednova/timber/wiki/ACF-Cookbook