Component Navigation in Joomla 4 Admin

Be informed that this forum is not an official support forum for Joomla! 4.0. Any issues regarding Joomla! 4.0 must be reported at https://issues.joomla.org/.

Joomla 4.0 is still in Beta stage. This forum should be used for sharing information about Joomla! 4.0.

Moderator: ooffick

Forum rules
Post Reply
chrisguk
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 104
Joined: Mon Nov 09, 2009 4:37 pm

Component Navigation in Joomla 4 Admin

Post by chrisguk » Wed Jul 08, 2020 4:01 pm

In the administator interface, Joomla 3 has two menus for controlling components. The main (top, horizontal) menu is built at component installation time from the <menu> and <submenu> elements in the component manifest XML file. The component can also draw its own menu in the sidebar using calls to JHtmlSidebar. In most components, the sidebar menu provides navigation within the component.

Joomla 4 has changed the top horizontal menu to a left vertical menu. It's responsive behaviour is the subject of other threads, but in this post I am concerned with the desktop interface. The sidebar menu, although it still works in Joomla 4, is no longer used by the core components, and my guess is that JHtmlSidebar is probably an endangered species. In any case, in Joomla 4 one needs to be careful that the main menu and the sidebar menu do not both appear at the same time as the result looks very odd indeed.

The main menu is built from the manifest XML in the same way as in Joomla 3, and the core components seem to manage quite well with the single menu. The menu behaves as follows: If the page URL is an exact match for one of the menu items, the menu is shown with the component submenu expanded. If the page URL is not an exact match for one of the menu items, the menu is shown unexpanded.

The menu can be suppressed, i.e. not shown at all, by setting the "hidemainmenu" variable. This is useful, but in different situations from its usage in Joomla 3. In Joomla 3 the function of this variable was to disable the menu so that it couldn't be used. The menu was still visible but nothing on it could be selected, in order to prevent the user accidentally navigating away from an item being edited. In our components, we preferred to leave the menu enabled, so we did not use hidemainmenu at all. In Joomla 4, hidemainmenu causes the menu not to be drawn at all, which, given the amount of space it takes up, is very useful in some cases, especially for lists and reports with many columns. However, we also now need to hide the menu when editing items, because as mentioned above, when the page URL does not exactly match a menu item, the menu is shown unexpanded, which is not useful for navigation within the component.

The new scheme works ok for simple components, but for larger components that need more deeply nested control structures, it doesn't work at all well.

Theoretically, it might be possible to hide the main menu and use the sidebar menu for internal component navigation, however, there is currently a bug that prevents this working properly and since we can't be sure about the future of the sidebar menu, we don't want to waste time on this idea.

Probably the only option we have currently is to hide the main menu whenever we must use a URL that would leave the menu unexpanded, and make sure that there is always a Cancel button on the toolbar which takes the user up one level, eventually to a point where the main menu is expanded to include the component submenu items. We anticipate that users will not be happy about the extra navigation steps.

A nice solution would be an API call that enables us to specify the component menu to be expanded. What are the chances of that?

Does anyone have any other ideas or solutions?

 
User avatar
ceford
Joomla! Intern
Joomla! Intern
Posts: 95
Joined: Mon Feb 24, 2014 10:38 pm
Location: Edinburgh, Scotland
Contact:

Re: Component Navigation in Joomla 4 Admin

Post by ceford » Wed Jul 08, 2020 5:04 pm

chrisguk wrote:
Wed Jul 08, 2020 4:01 pm

Does anyone have any other ideas or solutions?
I have a solution that goes back so far that I don't remember whether it originated in 2.5 or 3.x. We have a group of Administrators who are only allowed access to one component so the objective was to make it really simple. In the incarnation for Joomla 4 that has take the form of a Toolbar drop-down list. It looks like this:
sub-menu-solution-toolbar.png
And when expanded:
sub-menu-solution.png
There are about 15 menu items and it seems to work fine on narrow screens, although we expect the Admins to use a wide screen because they have wide tables to work with.

Perhaps you could devise something similar?
You do not have the required permissions to view the files attached to this post.

chrisguk
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 104
Joined: Mon Nov 09, 2009 4:37 pm

Re: Component Navigation in Joomla 4 Admin

Post by chrisguk » Wed Jul 08, 2020 8:01 pm

Thanks for that, it looks ideal. This seems to be new in Joomla 4. I will investigate.

 

Post Reply

Return to “Joomla! 4 Related”