D8 node load

In D8 way of loading a node is as follow

1) Add following name space at top of your code.
use Drupal\node\Entity\Node;

2) Use following line of code to load node
$node = Node::load($nid);

Learning Resource for Theming with Drupal 8

Learning Resource for Theming with Drupal 8

Can anyone suggest a good, up to date, resource for learning theming with Drupal 8?

I've tried a book but it's about a year old and comes with databases to load onto drupal and I'm having so many difficulties working around problems and system crashes, possibly arising from incompatibility with the current version of drupal, that I'm spending all my time doing that rather than learning theming.

A lot of tutorials are quite old.

Any suggestions appreciated.

Site Failure

My Drupal 8 site is giving me the following error message. Any help appreciated.

Error while creating custom module in drupal 8

I am developing custom module in drupal 8 , try to create a database getting

sqlstate error: PHP message: Uncaught PHP Exception Drupal\Core\Database\DatabaseExceptionWrapper: "SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DEFAULT 'NULL',

Drupal 8 Status Report Errors


My Drupal 8 status report is giving me warnings:

The first relates to protection of configuration files:

How to use an IF statement on Boolean values in .twig?

I've created a Boolean field (field_warn) with the settings listed below. I expect the message to display if On (true) or display nothing if Off, but the message is ALWAYS displayed regardless if the box is checked (on) or unchecked (off). Any ideas why?

  • Allowed number of values of 1
  • "On" label: On
  • "Off" label: Off

In my .twig file:


Subscribe with RSS Subscribe to RSS - Drupal 8.x