Is it possible to create a Link to a node with a hash in url (for opening a special Tab).
I use:
Link::createFromRoute('Title', 'entity.node.canonical', ['node' => 77]);
And I want to link to: "/node/77#example"
Drupal Answers is a question and answer site for Drupal developers and administrators. It only takes a minute to sign up.
Sign up to join this communityPlease see public static function Link::createFromRoute
array $options: The options parameter takes exactly the same structure. See \Drupal\Core\Url::fromUri() for details.
You can pass a 4th argument as an array with a fragment
key value:
Link::createFromRoute($this->t('Title'), 'entity.node.canonical', ['node' => 77], ['fragment' => 'example']);