The importance of the menu item in the functioning of your Joomla! website

The importance of the menu item in the functioning of Joomla!

In this article we will explain the importance of the menu item in the functioning of your Joomla! website.

If there' s anything essential in Joomla, it's the menu link! To better understand its importance, here is a small computer graphic that shows very schematically what happens when an article is called up in Joomla! [To simplify, we have removed the management of languages and other small details...]

Le lien de menu, colonne vertébrale de Joomla!

The call of the content

This one is far from going in a brutal azimuth, it will glean on its way the different elements that will constitute the page. Because as you know, the pages of your website do not exist as such, but are constituted when they are called up

If I call up the updated page of my website, via a category blog type menu link, set to display one full-width article and two introductions, displayed by date, the last three articles will be displayed on the page. But if I only have two articles available, the page will only display two articles. This is a miracle of the CMS which builds pages according to my request and to what can answer it !

One call, serval possibilites

There are three possible scenarios :

  1. There is a menu link

  2. There is a related menu link

  3. There is no menu link

lien-de-menu-joomla-illus-01

In case A, the call is made directly through a menu link and we therefore have the so-called itemid. This is the unique numerical identifier of the menu link in the database. Joomla will then look for what is assigned to this menu link: template, modules, etc.

In case B, the call is made by a read more for example. Since there is no itemid at the start of the call, Joomla will search for a menu link in the database to the called item, or even a link to the item's category. As there is a "news" menu link which leads to this category, Joomla will therefore look for what is assigned to this menu

In case C, we have neither a menu link at the beginning, nor a related menu link. So what will Joomla do? The answer is simple: it will use the original ItemId of the page where the click occurred! Joomla will therefore display the article in the page layout that is the one of the call page.

This explains why my pretty slider module, which is only assigned to the home page, is still there when you click on the read more article on the home page. This article and its category are not served by another menu link: Joomla remains in the existing layout when clicked.

Learn how to create your website with Joomla! 4 The book

Joomla! 4 Le livre

Digital version

18.00€

Add to cart

Paper version

29.00€

Add to cart

On the way to the page rendering

  1. Click from: A a menu link, B a read more with a related menu link or C a list of items.
  2. The database is queried.
  3. Retrieve the template assigned to the ItemId.
  4. Extract the module publication positions from the template.
  5. Retrieve the published modules, with verification of rights, on this ItemId.
  6. We retrieve the content of the article, with verification of the reading rights.

And we display the page as it should be.

Le lien de menu joomla, illustration 02

How can this problem be solved ? It's very simple, by creating a menu link to the category in a menu different from the main menu, a menu which may not be displayed and which is only used to manage module and template assignments.

Assistance Joomla!

Icone assistance

We are at your disposal if you have a question or a project for us.

Crédits photo

Photo de Clem Onojeghuo provenant de Pexels

Cinnk EN