I'm using a Bootstrap theme and would like to add a glyphicon to the "Add new comment" link so that it comes out something like this:
<a href="..."><span class="glyphicon glyphicon-comment"></span> Add new comment</a>
I've considered overriding the link's default text, but I'm not sure how to do it for this string of text, and I don't like the idea of adding HTML to a translatable string.
Using THEME_preprocess_links(&$variables)
, I used Kint to explore $variables['links']['comment-add']
, but I couldn't find any public methods that would allow me to edit the link contents.
<a>
element isn't how it's done in bootstrap and it affects the formatting of the link's content.return $generated_link->setGeneratedLink('<a' . $attributes . '>' . $variables['text'] . '</a>');
. It looks like I'd need to form a new link and edit the$variables['text']
section...