Hot answers tagged

4

You will need to check if the $node variable is actually an instance of node object. if ($node instanceof \Drupal\node\NodeInterface) { // You can get nid and anything else you need from the node object. $nid = $node->id(); } See How do I get the current node ID?


1

Use [current-page:query:foo] in Default Value field and set query string to node/1?foo=1,2 and it will work. Installing Tokens module will show you some values you can use in your default value field.


Only top voted, non community-wiki answers of a minimum length are eligible