if logged in and nid drupal twig code example Example: get node id in twig drupal {{ path('entity.node.canonical', {'node': nide.id}) }}