Unable to add attribute from the drupal nav.twig file

41 views Asked by At

i am using radix on drupal 10 i wanted to add onmouseover="showDropdownMenu(this) " onmouseout="hideDropdownMenu(this)" to my nav link

{% if iitem.is_expanded and item.below and dropdown|default(true) %}
{% set nav_link_attributes = {
   'onmouseover': "showDropdownMenu(this)",
   'onmouseout': "hideDropdownMenu(this)",          
 } %}
{% else %}

this is setting up this

<a href="/testing/node" class="nav-link dropdown-toggle is-active" data-bs-toggle="dropdown" attributes="showDropdownMenu(this) hideDropdownMenu(this)" data-drupal-link-system-path="node">testingDropDown</a>

but i want it to be

<a href="/testing/node" class="nav-link dropdown-toggle is-active" data-bs-toggle="dropdown" onmouseover="showDropdownMenu(this) " onmouseout="hideDropdownMenu(this)" data-drupal-link-system-path="node">testingDropDown</a>
0

There are 0 answers