Printing out Unix date, NID, sticky, etc

By mherchel, 18 May, 2022

There’s a bunch of getXXX methods under the node object that are not viewable while PHP debugging. You can call these with {{ node.XXX.value }}.

Image
Screenshot of items within node object taken in PHPStorm
node-object.twig
            
            {# Created date #}
{{ node.created.value }}

{# Updated date #}
{{ node.changed.value }}

{# Node ID #}
{{ node.nid.value }}

{# UID #}
{{ node.uid.value }}

{# Status #}
{{ node.status.value }}

{# Node Type #}
{{ node.type.value }}