How can I create a Link to an URL containing a fragment identifier? 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' =&gt; 77]);

And I want to link to: &quot;/node/77#example&quot;
Please 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-&gt;t('Title'), 'entity.node.canonical', ['node' =&gt; 77], ['fragment' =&gt; 'example']);