Icon in navigation top bar cannot be customized

Created on 10 March 2025, 24 days ago

Problem/Motivation

The navigation top bar hardcodes the database icon, there is no way to alter it or customize it. It is not conditional on the entity type, does not come from an entity method or annotation.

Steps to reproduce

Proposed resolution

Add a way to customize the icon.

Remaining tasks

Agree on how to do it. Implement it.

User interface changes

Icon will depend on the entity type potentially.

๐Ÿ› Bug report
Status

Active

Version

11.0 ๐Ÿ”ฅ

Component

navigation.module

Created by

๐Ÿ‡ญ๐Ÿ‡บHungary Gรกbor Hojtsy Hungary

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

Comments & Activities

  • Issue created by @Gรกbor Hojtsy
  • ๐Ÿ‡ญ๐Ÿ‡บHungary Gรกbor Hojtsy Hungary
  • ๐Ÿ‡ง๐Ÿ‡ชBelgium wim leers Ghent ๐Ÿ‡ง๐Ÿ‡ช๐Ÿ‡ช๐Ÿ‡บ
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia anjali rathod India
  • ๐Ÿ‡ท๐Ÿ‡ธSerbia finnsky

    @anjali rathod Thank you for joining Navigation!

    You don't need to assign tasks to yourself. Usually it's enough to write that you're working on it.

    https://www.drupal.org/docs/develop/issues/fields-and-other-parts-of-an-... โ†’

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia anjali rathod India

    Sure!
    I will be working on this.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia anjali rathod India

    Should we have separate icon set for different entity types? This would mean to have another field added to each entity type and user if has set the logo for the entity then it would appear otherwise fallback to database icon. Or should we have another field for icon in the module configuration form that would replace the default icon and would be same across all the entities.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia anjali rathod India

    I am thinking of doing something like this. Any suggestions or if there is any better way to implement it?

  • ๐Ÿ‡ญ๐Ÿ‡บHungary Gรกbor Hojtsy Hungary

    I think the current problem is the code does not allow for different icons at all, it is hardcoded to one icon for all entities. I don't think this should be quite given to the user as an option, but the developers of the entity should be able to specify an icon, practically I think in the entity PHP annotation / attributes. Then the icons could be swapped with a different icon set assuming a contrib for that on the site or possibly the entity definition altered for even more icon customization. But the core module I don't think would need a UI to upload/change these icons only.

  • ๐Ÿ‡ช๐Ÿ‡ธSpain plopesc Valladolid

    Agree that adding a new UI to handle this could be complex and not easy to maintain, since new modules can add new content entity types.

    Besides Gร bor's approach, another possibility could be to use create a theme wrapper for the PageContext render array. That theme wrapper would expose a preprocess hook, from where XB or other modules could alter the PageContext content. That would allow to customize quickly not only the icon, but also the badge text or status.

Production build 0.71.5 2024