Icon CSS should load automatically

Created on 27 March 2024, 6 months ago
Updated 2 April 2024, 6 months ago

Problem/Motivation

I found that while this module provides a great UI for adding menu icons, it doesn't display the icon on the front-end theme.

Steps to reproduce

Use the module to add icons to a menu item.
Display the menu item on the front-end site.

What should happen:
* The icon displays as expected.

What actually happens:
* The icon does not display.

Proposed resolution

Work out what to do:
* Add an option to automatically load the menu_bootstrap_icon/cdn library, or..
* Add necessary logic to determine if menu_bootstrap_icon/cdn should be loaded, or...
* Document that menu_bootstrap_icon/cdn needs to be loaded in order for menu icons to display.

Remaining tasks

Work out the best approach to this.
Implement the changes.

User interface changes

Menu icons will display as expected.

API changes

TBD

Data model changes

n/a

Feature request
Status

RTBC

Version

1.0

Component

User interface

Created by

🇺🇸United States DamienMcKenna NH, USA

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

Comments & Activities

  • Issue created by @DamienMcKenna
  • 🇺🇸United States DamienMcKenna NH, USA

    FYI I added "menu_bootstrap_icon/cdn" to my theme's libraries list and it's working, but this wasn't documented anywhere.

    In reviewing the codebase I see that the library is loaded via the field formatter, but there's no logic to make it load when adding menu icons.

  • 🇮🇳India ravi kant Jaipur

    The issue is same to me.
    I am using Bootstrap5 theme as default and admin theme but icons is not rendering for default theme.
    so the CDN path is not including in Default theme source.

  • 🇮🇳India ravi kant Jaipur

    Created a separate issue for CDN path issue.
    https://www.drupal.org/project/menu_bootstrap_icon/issues/3436461 🐛 CDN link is not reflecting in source. Active

  • 🇬🇧United Kingdom aaron.ferris

    I also came across this, the CDN library is attached at various points in settings forms and the likes, but not when a menu item is actually viewed.

  • 🇫🇷France lazzyvn paris

    I think the menu icons will show with the custom theme, it's so easy to add to the custom theme. so we don't need to use hook page alter.
    I can modify the hook page but I think it loses performance.
    we can add this in customTheme.info

    libraries:
      - menu_bootstrap_icon/cdn

    CDN option is used for theme admin like Claro. This doesn't mean cdn is also used for frontend.

  • Status changed to Closed: works as designed 6 months ago
  • 🇫🇷France lazzyvn paris

    Add instructions to the home page module

  • Status changed to Needs review 6 months ago
  • 🇺🇸United States DamienMcKenna NH, USA

    That will help, thank you.

    If you don't want to try to handle it automatically, an addition to the README.md file would be helpful.

  • Status changed to RTBC 6 months ago
  • 🇮🇳India ravi kant Jaipur

    The issue is solved for me according comment #6

  • 🇬🇧United Kingdom aaron.ferris

    +1 for the patch.

Production build 0.71.5 2024