Using custom icons from a kit

Created on 21 February 2025, 3 months ago
Updated 22 February 2025, 3 months ago

Problem/Motivation

We were not able to get our custom icons to display within the menu.
The current list of prefixes does not include 'fak' which is necessary to access custom icons.

$form['fa_icon']['fa_icon_prefix'] = [
    '#type'          => 'select',
    '#title'         => t('Style prefix'),
    '#default_value' => !empty($menu_link_options['fa_icon_prefix']) ? $menu_link_options['fa_icon_prefix'] : 'fa',
    '#options'       => [
      'fa'  => 'fa (' . t('4.x only') . ')',
      'fas' => 'fas (' . t('5.x only') . ')',
      'far' => 'far (' . t('5.x only') . ')',
      'fal' => 'fal (' . t('5.x only') . ')',
      'fad' => 'fad (' . t('5.x only') . ')',
      'fab' => 'fab (' . t('5.x only') . ')',
      'fa-solid' => 'Solid (' . t('6.x only') . ')',
      'fa-regular' => 'Regular (' . t('6.x only') . ')',
      'fa-light' => 'Light (' . t('6.x only') . ')',
      'fa-thin' => 'Thin (' . t('6.x only') . ')',
      'fa-duotone' => 'Duotone (' . t('6.x only') . ')',
      'fa-brands' => 'Brands (' . t('6.x only') . ')',
    ],
  ];

Steps to reproduce

Use the dropdown menu in the form.

Proposed resolution

Add 'fak' in the options list.

  $form['fa_icon']['fa_icon_prefix'] = [
    '#type'          => 'select',
    '#title'         => t('Style prefix'),
    '#default_value' => !empty($menu_link_options['fa_icon_prefix']) ? $menu_link_options['fa_icon_prefix'] : 'fa',
    '#options'       => [
      'fa'  => 'fa (' . t('4.x only') . ')',
      'fas' => 'fas (' . t('5.x only') . ')',
      'far' => 'far (' . t('5.x only') . ')',
      'fal' => 'fal (' . t('5.x only') . ')',
      'fad' => 'fad (' . t('5.x only') . ')',
      'fab' => 'fab (' . t('5.x only') . ')',
      'fak' => 'Custom Icons (' . t('6.x only') . ')',
      'fa-solid' => 'Solid (' . t('6.x only') . ')',
      'fa-regular' => 'Regular (' . t('6.x only') . ')',
      'fa-light' => 'Light (' . t('6.x only') . ')',
      'fa-thin' => 'Thin (' . t('6.x only') . ')',
      'fa-duotone' => 'Duotone (' . t('6.x only') . ')',
      'fa-brands' => 'Brands (' . t('6.x only') . ')',
    ],
  ];

Remaining tasks

Create a merge request to add this additional feature.

Feature request
Status

Active

Version

3.0

Component

Code

Created by

🇺🇸United States ccoulon

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024