Not sure if this is a bug, but I wanted to add some debug into an HTML comment in my page.html.twig
file. I added <!-- type={{node.type}} -->
but I get:
Uncaught PHP Exception Exception: "Object of type Drupal\Core\Field\EntityReferenceFieldItemList cannot be printed." at /www/cn8/core/lib/Drupal/Core/Template/TwigExtension.php line 443
It took me a while to track down since I was sure this would work. Shouldn't EntityReferenceFieldItemList have a toString() function for this purpose?
node.type.target_id
and get the content type as a string, but still don't understand whynode.type
doesn't output something, but crashes... – Nic Sep 15 '16 at 8:23