cms icon indicating copy to clipboard operation
cms copied to clipboard

detect if icon is from the brands package

Open i-just opened this issue 8 months ago • 0 comments

Description

This PR adds a mechanism for detecting whether the selected icon is from the “brands” package.

When displaying icons from the Icon field, you need to specify the correct classes for the icon, or it will not display as expected.

For example, to display a standard “angle right” icon, you can use:

<i class="fa-solid fa-angle-right"></i> 

To display a “bluesky” icon, you should use:

<i class="fa-brands fa-bluesky"></i> 

Providing both fa-solid and fa-brands will only work in a limited number of cases.

This PR adds a mechanism for checking whether the selected icon is from the “brands” package.

To test whether the selected icon is from the “brands” package, you can use the following

<i class="{{ brandsIcon(entry.myIconField) ? 'fa-brands' : 'fa-solid' }} fa-{{ entry.myIconField }}"></i>

Related issues

#17402

i-just avatar Jun 10 '25 11:06 i-just