Create a node programatically in Drupal 8

preview_player
Показать описание
We will see how we may create a node in Drupal 8 with a bit of code.

If you liked this video, please also have a look at my new course about Drupal 8 module development here (with 50% discount):

The nodes in Drupal are the most popular bits of content. This means it is quite often required to use code to create or edit them. In this video, we are going to learn how to create new ones.

We are going to be actively using the Drupal\node\Entity\Node class and with its help, we are going to be creating new nodes with different field values.

We would also use the devel and kint modules to study the structure of the nodes in order to be able to create exactly the node instances we need.

To support us please, don't forget to share, subscribe, like and comment on the video!
Рекомендации по теме
Комментарии
Автор

This was super helpful. Next I'd want to know how to use this code.

humanbeing
Автор

Hi, can you please make a video to upload image to drupal using api from postman?

kumarsaurabh
Автор

Hi Nicolay, do you have a video about how to update all nodes with HOOK_update_N()

jjggo