I use Drupal 8.9.3 with custom theme. I need to do a menu item on the main navigation who go on an external link.

I would like to add target="_blank" on this link, but I don't see where I can put that attribute from the user interface.

Do I need a module? I would like to avoid a PHP function.

I tried https://www.drupal.org/project/menus_attribute/releases/8.x-1.2. I added my attr but nothing appears in my code.


2 Answers 2


The module for this is menu_link_attributes.


Try the Mix module, which allow you to set id/class/target attributes and other advanced settings to menu links. enter image description here enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.