- Issue created by @stevenovy
- Merge request !22Resolved #3488501: Menu entries with <nolink> paths are rendered as empty <a> hrefs. → (Merged) created by debrup
- 🇮🇳India debrup
Fixed the issue by modifying the twig files.
- Added checks to see if the url has a link or no link at all.
- Modified few manual tags to the drupal twig link() filter for better code optimization and automatic handling of the given issue :)Please review the changes and check if the issue has been fixed or not.
Note: Since drupal twigs link() filter does not allow extra html tags in its text, so I have not changed those links which have other html tags inside the tags.
- 🇺🇸United States stevenovy
Installed and reviewed the changes, looks good, works well.
- 🇮🇳India sayan_k_dutta
Reviewed the changes. Looks Good. Attaching screenshot of the same and moving to RTBC.
- Status changed to RTBC
16 days ago 2:28pm 17 April 2025 - First commit to issue fork.
-
jrglasgow →
committed fbbe4346 on 3.x authored by
debrup →
Resolved #3488501: Menu entries with <nolink> paths are rendered as...
-
jrglasgow →
committed fbbe4346 on 3.x authored by
debrup →
- 🇺🇸United States simplyshipley
It appears that this MR introduced a bug when creating the links in the menu--sidebar_first.html.yml and menu--sidebar_second.html.yml files. The new code creates a link, but uses item.text instead of item.title which was previously used. This causes the links to be created without a label.
Updated code:
<li class="usa-sidenav__item"> {{ link(item.text, item.url, create_attribute({'class': classes})) }}
Previous code:
<li class="usa-sidenav__item"> <a href="{{ item.url }}"{% if item.in_active_trail %} class="usa-current"{% endif %}> <span>{{ item.title }}</span> </a>