mercredi 17 février 2016

Gantry5 - custom field type for particle configuration

I am new to the Gantry5 Framework and I started out creating a custom Particle, wasn't that difficult all in all.

I am using Gantry5 for Wordpress and I would like to create a particle, which can be configured with an existing Page.

Therefore I need a form field, in best case a dropdown Menu, which displays a list of pages.

Right now the configuration of the Particle (custom/particle/page_particle.yaml) looks like this:

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

Does anybody know how to add the nessesary code (where to place, how to name) and how to tell Gantry about that new Type?

Thanks in Ahead!



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire