joomla-cms icon indicating copy to clipboard operation
joomla-cms copied to clipboard

Admin Menu Separator in first position is not displayed

Open hytsch opened this issue 7 months ago • 3 comments

Steps to Reproduce the Issue

  1. Create an admin menu, an admin menu Modul an place it on position Administrator Menu
  2. Create several admin menu items: a, b, c, d, e, f.
  3. Create separators: s1, s2, s3.
  4. Arrange the items and separators in the following order: s1, a, b, s2, c, d, s3, e, f.

Expected Result

The menu items are displayed in the following order: s1, a, b, s2, c, d, s3, e, f.

Actual Result

The first separator (s1) is not displayed. The menu appears as: a, b, s2, c, d, s3, e, f.

System Information

j5.3 php 8.3

Additional Comments

If you use the separator item solely as a visual separator, the first separator at the top might not make sense (unless you place additional entries above the Custom Admin menu). However, if you use the 'Label' option, along with appropriate text for orientation, then a separator item at the top is quite useful.

hytsch avatar May 17 '25 01:05 hytsch

Confirmed. When the separator is the first item it is not displayed. But then I guess that would be correct as it can not separate anything. "A separator with or without a text label, useful to separate items within a menu."

However I do agree with you that it would be useful to display

brianteeman avatar Jun 10 '25 08:06 brianteeman

This is the code that is preventing the separator from being displayed. I do not understand the purpose of this code so am reluctant to touch it myself. Perhaps this information will assist someone else to resolve this issue

https://github.com/joomla/joomla-cms/blob/ee450c9193f5dd817a4d0897cd40d08828f7c14e/administrator/modules/mod_menu/src/Menu/CssMenu.php#L448-L458

brianteeman avatar Jun 10 '25 08:06 brianteeman

I also note that if there is a separator at the end then it is displayed even though this code block suggests that it should not be

https://github.com/joomla/joomla-cms/blob/ee450c9193f5dd817a4d0897cd40d08828f7c14e/administrator/modules/mod_menu/src/Menu/CssMenu.php#L473-L478

brianteeman avatar Jun 19 '25 07:06 brianteeman