Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By Paulset on
Hi,
I look for a long time but do not find answer (i use drupal 8).
I would simply want to add a <span></span>
in the links of the user menu (like <li><a><span></span></a></li>
).
I believe that it is necessary to use preprocess links, but for the moment my tries do not work.
Anybody has the solution?
Comments
It is so complicated?
It is so complicated?
I looked everywhere, in the api...
It was not useless because I learnt things, but nothing to add how of the markup to a link of menu.
If somebody has some documentation or knows where I have to look, it would be welcome
Add span to menu links
A solved it in the twig template. I am not sure if it the right way but it works: