Development Access Entity Properties in a Field Twig Template December 4, 2018 / This doesn’t need much of an explanation. You can use any entity methods as far as I can tell. Here’s an example showing how to get the node ID in a field template: XHTML {% set nid = element['#object'].id() %} {{ nid }} 123 {% set nid = element['#object'].id() %} {{ nid }}