Remove an empty class attribute from the template link when Font Awesome formatter is activated

Created on 15 March 2025, 22 days ago

Problem/Motivation

When the admin user opts for field formatter Font Awesome icons instead of Network name, a value for the class attribute of the link tag (<a />) is not provided. That causes an empty
class attribute to be rendered on the source code.

Steps to reproduce

Create a social link field and select field formatter Font Awesome icons. Create content and add a social media link reference. When rendered, inspect the source code and confirm there is an empty class attribute.

Proposed resolution

Apply logic to the template so that the empty class attribute is not rendered. The code needs to check if the output link.class is not empty prior to printing it.

Remaining tasks

Apply logic to the TWIG template.

User interface changes

Empty attribute class is not rendered on the template anymore.

API changes

--

Data model changes

--

🐛 Bug report
Status

Active

Version

2.1

Component

Code

Created by

🇧🇷Brazil mabho Rio de Janeiro, RJ

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024