By editor, 13 November, 2015 Question How to create a node programmatically in Drupal 8 ? Here an example for create node programmatically in Drupal 8 Node type : article $language = \Drupal::languageManager()->getCurrentLanguage()->getId(); $node = \Drupal\node\Entity\Node::create(array( 'type' => 'article', 'title' => 'The title', 'langcode' => $language, 'uid' => 1, 'status' => 1, 'body' => array('The body text'), 'field_date' => array("2000-01-30"), //'field_fields' => array('Custom values'), // Add your custon field values like this )); $node->save(); Tags Drupal 8 Code Node Add new comment Comments2 You must have JavaScript enabled to use this form. Your name Subject Comment About text formats Text format Plain textBasic_html Plain text No HTML tags allowed. Lines and paragraphs break automatically. Web page addresses and email addresses turn into links automatically. PHP Fatal error:  Call to… PHP Fatal error: Call to undefined function Drupal\file\Plugin\Field\FieldType\file_default_scheme() in core/modules/file/src/Plugin/Field/FieldType/FileItem.php on line 39 Reply Please send me your codes… Please send me your codes and full details. Reply
PHP Fatal error:  Call to… PHP Fatal error: Call to undefined function Drupal\file\Plugin\Field\FieldType\file_default_scheme() in core/modules/file/src/Plugin/Field/FieldType/FileItem.php on line 39 Reply
Comments2
PHP Fatal error:  Call to…
PHP Fatal error: Call to undefined function Drupal\file\Plugin\Field\FieldType\file_default_scheme() in core/modules/file/src/Plugin/Field/FieldType/FileItem.php on line 39
Please send me your codes…
Please send me your codes and full details.