Drupal 8 Third Party Settings and Pseudo-Fields
In the first installment of this series we started our journey towards creating some simple but powerful functionality. The goal we set was to have the possibility to load a form on each node page and to be able to choose which form type should be used on the different node bundles.
The first step is done. We created a custom plugin type called ReusableForm
already featured with a base plugin class that new plugins can extend. Additionally, we saw that each plugin will interact with a form class that is defined in their annotation. And like with the plugins, we also created a base class new forms can extend.
It follows to see how we can configure the core node types to use one of the plugins defined on the site and how to render the relevant form when viewing the node. But first, in order to have something to work with, let’s create our first ReusableForm
plugin that uses a very simple form.
Our first plugin
Inside the src/Form
folder of our module, create a class called BasicForm.php
(or whatever you want to call it). Inside, we can have this simple form definition:
Continue reading %Drupal 8 Third Party Settings and Pseudo-Fields%
LEAVE A REPLY
You must be logged in to post a comment.