Jump to content
  • Beta 1 - theme editing - 'navigation icons' effect on top-level menu items


    Nathan Explosion
    • Status: Moved to Github

    Enabling the 'Navigation icons' setting in Header -> Desktop header will result in the top-level menu items FA icon not working. Sub-menu items display as expected.

    Steps to reproduce:

    1. Access the theme editor
    2. Go to Header -> Desktop header
    3. Enable the 'Navigation icons' settings
    4. Result:

    Could contain: Text

    Tested in Firefox/Chrome (current releases) on Windows 11 24H2, on test site and localhost site.

    Video in attached zip.

     

    (Offline) A Test Forum - Invision Community — Mozilla Firefox 2024-10-17 12-28-44.zip


    User Feedback

    Recommended Comments

    I know it’s a simple answer, but you’ve edited these icons in Menu Manager in the AdminCP right?

    I know I had to do it when I upgraded to Beta 1 for this same reason. After choosing the Font Awesome icons, they displayed correctly.

    Link to comment
    Share on other sites

    Just now, Gary said:

    I know it’s a simple answer, but you’ve edited these icons in Menu Manager in the AdminCP right?

    Aware of that, yes but I'm reporting a bug with the front-end functionality - if the above is a requirement for it to display an icon correctly then the front-end should alert to that being a requirement.

    Additionally, the ACP icon advice is:

    "You may pick a custom icon for this menu item. If none is selected, a context relevant default icon may be used"

    Could contain: Text

    • "May" implies a choice
    • "Must" would imply a requirement.

    And as none is selected (because it isn't a requirement) then the 'context relevant default icon' should be a 'context relevant' icon, not what appears (to a layman) to be a broken FA icon (it's actually just the one indicated) considering that the sub-menu items all have a 'context relevant' icon.

    Could contain: Text

    Could contain: File, Webpage, Text

     

    Link to comment
    Share on other sites

    Something like this would be more logical than the existing image:

    Could contain: Text, Computer Hardware, Electronics, Hardware, Computer, Pc

    • eye
    • list-ul (which is the one used for some of the 'Activity' sub-menu items)
    • cart-shopping (which is the one used for the 'Store' sub-menu item)
    Link to comment
    Share on other sites

    I confirm this bug. And if you look at the code - a specific icon is missing...

    Could contain: Text, File

    PS. Also in drop-down menu icon My details is the same bug...

    Edited by Adlago
    Link to comment
    Share on other sites

    27 minutes ago, Marc said:

    Is it the standard store item being used, or an external link? Im asking as for me its showing

    @Marc - just spotting you specifically mentioning 'Store' there, and it appears you have been led easily by my indicator arrow.

    I'm not only referring to the 'Store' here. Look at the icon to the left of each of the top-level menu items.

    Without any added icons (just the defaults) the 'default' for them all is file-image

    Could contain: Text

    With me adding icons:

    Could contain: Text, Computer Hardware, Electronics, Hardware, Computer, Pc

    For reference only, if I do this IN_DEV then the store icon appears fine.

    Adding a var_dump on navBarItems, the $roots for those 3 menu items are:

    C:\wamp64\www\dev\ips_50_dev_a\system\Theme\Theme.php(3678) : eval()'d code:15:
    array (size=3)
      1 => 
        object(IPS\core\extensions\core\FrontNavigation\CustomItem)[215]
          public string 'defaultIcon' => *uninitialized*
          protected ?array 'subItems' => null
          protected array 'configuration' => 
            array (size=2)
              'menu_custom_item_url' => string 'https://localhost/dev/ips_50_dev_a/' (length=35)
              'menu_custom_item_target_blank' => boolean false
          public ?int 'id' => int 1
          public array|string|null 'permissions' => string '*' (length=1)
          public string 'menuTypes' => string '*' (length=1)
          public ?array 'icon' => null
          public int 'parent' => int 0
      2 => 
        object(IPS\core\extensions\core\FrontNavigation\CustomItem)[251]
          public string 'defaultIcon' => *uninitialized*
          protected ?array 'subItems' => null
          protected array 'configuration' => 
            array (size=4)
              'menu_custom_item_url' => string 'app=core&module=discover&controller=streams' (length=43)
              'menu_custom_item_target_blank' => boolean false
              'internal' => string 'discover_all' (length=12)
              'seoTitles' => 
                array (size=0)
          public ?int 'id' => int 2
          public array|string|null 'permissions' => string '*' (length=1)
          public string 'menuTypes' => string '*' (length=1)
          public ?array 'icon' => null
          public int 'parent' => int 0
      16 => 
        object(IPS\nexus\extensions\core\FrontNavigation\Store)[248]
          public string 'defaultIcon' => string '\f07a' (length=5)
          protected ?array 'subItems' => null
          protected array 'configuration' => 
            array (size=0)
              empty
          public ?int 'id' => int 16
          public array|string|null 'permissions' => null
          public string 'menuTypes' => string '*' (length=1)
          public ?array 'icon' => null
          public int 'parent' => int 0

    That last one is Store - and looking at that IPS\nexus\extensions\core\FrontNavigation\StoreFrontNavigation extension, there is a defaultIcon value that is cart-shopping

    /**
    	 * @var string Default icon
    	 */
    	public string $defaultIcon = '\f07a';

    But the 'Browse' and 'Activity' roots are generated from IPS\core\extensions\core\FrontNavigation\CustomItem, and there is no defaultIcon value in them so the file-image icon will be used for them.

    Link to comment
    Share on other sites

    If you have manually added that as a submenu, then yes you would need to choose an appropriate icon, as the system wouldnt know what it is. However the default setup, does indeed show the store icon

    Link to comment
    Share on other sites

     

    9 minutes ago, Marc said:

    If you have manually added that as a submenu

    I haven't...it's your own menu manager as-is

     

    9 minutes ago, Marc said:

    However the default setup, does indeed show the store icon

    I give up.

    Could contain: Text, Computer Hardware, Electronics, Hardware

    Edited by Nathan Explosion
    Link to comment
    Share on other sites

    41 minutes ago, Nathan Explosion said:

     

    I haven't...it's your own menu manager as-is

     

    I give up.

    Could contain: Text, Computer Hardware, Electronics, Hardware

    OK, let me rephrase, as I realise you feel Im hung up on the store icon itself. By default it was showing browse icon, the activity icon, and the store icon at the top level (not the one under it), when I change to icons. I'm certainly not ignoring what you are saying, I simply wasnt seeing the issue.

    That said, what I have realised is something must have changed from alpha to beta. As while when I switched them on they were all fine, if I then reset the menu to its defaults, they are then broken, and will report accordingly.

    Link to comment
    Share on other sites


×
×
  • Create New...