How Do Joomla Menu Levels Work?

How Joomla Menu Levels Work

Joomla menus allow you to create different levels. This is essential for creating any kind of sub-menu such as a dropdown menu.

Sometimes it's necessary to show only one or two levels from the menu. For example, you may show the top level links in the main navigation and sub-links in a sidebar navigation.

In this post, we'll show you how to display only specific menu levels in a sidebar module.


The menu items structure

Here's an example of my Main Menu menu items structure with three different levels:

  • Level 1 A
    • Level 2 A
      • Level 3 A
      • Level 3 B
      • Level 3 C
    • Level 2 B
    • Level 2 C
  • Level 1 B
  • Level 1 C

three levels of main menu

Let's see if we display our menu item levels selectively.


Step #1. Display the menu items with a sidebar module

Joomla displays menu items in modules by the Menu type. If you have not created such a module, let's do it together.

  • Go to Extensions > Modules > New > Menu.

click menu

  • Give your new menu module a title. For my demonstration, I called my module Menu Levels.
  • Assign a valid module position. I selected the Protostar's position-7.
  • In the Select Menu option, choose the menu that contains your menu items. For my demonstration, I selected the Main Menu you have seen in the previous step.
  • Click Save.

select menu

  • Here's how our menu module looks by default:

the sidebar menu module default settings

  • Let's take a look at the result when the menu is published. As you can see, all the three levels links are showing:

all three levels displayed

Let's learn how to display our three levels of Joomla menu items selectively, at will.


Step #2. Display only second level menu items

Let's assume, you would like to display the only Level 2 menu items in your module.

  • Set the Start Level to 2.
  • Set the End Level to 2.
  • Click Save.

set the start and end levels to 2

  • Check the result. You will see that now your Joomla sidebar module will display the only Level 2 menu items.

only level two menu items displayed

Excellent! You now know how to set a Joomla menu module to display only level 2 menu items.

Will it work for our Level 3? Let's find out.


Step #3. Display only third level menu items

  • Click Select.

click select

  • You will see the Select or Change Menu Item modal box. Click on any of your level 3 menu items. For my demonstration, I clicked Level 3 B, as you can see on the image below:

select level 3 menu item

  • Set the Star Level to 3.
  • Set the End Level to 3.
  • Click Save.

level 3 menu items set

  • Go to your site front end and check the result. You will see that your menu module now displays only Level 3 menu items:

11 level three menu items displayed

This will be the result:

3-3-preview

Good job! You are now able to explicitly display your Joomla menu levels in a Joomla sidebar module.

Let's learn how to display our levels in combination.


Step #4. Display both second and third level menu items

Let's show menu items belonging to Level 2 and Level 3.

  • Go to the Base Item parameter and click Clear:

click clear

  • The parameter will then display Current:

click select

  • Click Select and then select Level 2 A menu item.
  • Set the Start Level to 2.
  • Set the End Level to 3.
  • Click Save.

module set to display level 2 and level 3

  • Check the result:

level 2 and level 3 menu items displayed

What's Next?

Save $1,000's when you sign up to Joomlashack's Everything Club.

You will get access to all our 32 extensions, and legendary support!

  Click here to join the Everything Club