Missing "nav-link" class on some navigation lists

Created on 2 June 2025, 4 days ago

Problem/Motivation

The default links.html.twig template provided seems to not render some navigation lists properly. Here is an example of what the links for article comments look like currently

Bootswatch/bootstrap styles are not applied, due to missing nav-link class. Here is what it should look like in my case

Steps to reproduce

Create fresh theme from radix starterkit, create article, add comment.

Proposed resolution

It seems like src/kits/radix_starterkit/templates/navigation/links.html.twig could be patched to properly add "nav-link" class to a <span> containing the link. Currently it tries to add that clas using item.link.text_attributes.addClass('nav-link'), but .text_attributes are always null here. Also, the docblock only mentions item.text_attributes.addClass('nav-link'), not item.link.text_attributes.addClass('nav-link'). I'd propose applying the attached patch to fix this.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

6.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024