0

In drupal 8 (or 7?), is it possible to load programmatically an existing field ? I mean : from the drupal administration, I create a new custom content type with some fields. This fields have an unique machine name. I want create a form from a custom module. In this form, I want "load" the existing fields created in the custom content.

So, is it possible to load existing fields in a .php module ?

spacecodeur
  • 2,206
  • 7
  • 35
  • 71

1 Answers1

0

In case you want to build a custom form with field values of a created node, you can load the node programmatically with Node::load($nid) and put the the values in the render array. This way you need a predefined node you created yourself, because you call it using it's ID.

Elendas
  • 733
  • 3
  • 8
  • 22