A module is a small, self-contained block of reusable content or functionality (such as a menu, login form, or custom bit of text). Joomla is structured by menu items which are synonymous with pages. Modules are configured to appear on all menu items (pages) by default, but can be set to appear (or not appear) on discrete menu items. This tutorial demonstrates how to do that.
Prerequisites
Administrator access to a Joomla site (version 5 or above). See 1.0 Admin Login.
The tutorial is created on a fresh installation of Joomla 6.
Setup
Create an Article
- Navigate to Content > Articles
- Click New to create a new article.
- Title: Snails
- Article Text: Leave blank, enter random text, or ask AI for a paragraph on snails and paste in the results.
- Save & Close
Create a Menu Item for the Article
- Navigate to Menus > Main Menu
- Click New to create a new menu item
- Title: Snails
- Type: Articles > Single Article
- Article: Snails
- Save & Close
Create Two Custom Modules
One will have a fun fact about snails and appear only on the Snails menu item (the Snails article); the other will be a notice of site maintenance and appear on every menu item (every page in the site).
- Navigate to Content > Site Modules
- Click New and select Custom.
- Title: Fun Fact
- Enter a fun snail fact into the text editor, e.g. "The average garden snail moves at a pace of roughly 3.6 to 47 meters per hour, depending on the species and conditions."
- Position: Sidebar-left [sidebar-left]
- Click on the Menu Assignment tab.
- Change the module assignment to Only on pages selected.
- Update so that only Snails is ticked.
- Save & New (this will save and display a new-module form)
- The Menu Assignment tab is selected.
- Observe that the module assignment is for On all pages.
- Click on the Module tab
- Title: Site Maintenance
- Enter a message into the text editor, e.g. "Our site will be offline for maintenance this evening."
- Position: Sidebar-left [sidebar-left]
- Save & Close
Description
View the website by clicking on the icon in the header.
- The Site Maintenance module appears on the homepage.
- The Main Menu contains a link for Snails.
- There is a Login Form module.
- In the center of the page just under the header is a breadcrumb module (You are here: Home).
Click on the Snails link in the main menu.
- Both the Fun Fact and Site Maintenance modules appear.
- There is a Login Form module.
- The breadcrumb module (You are here: Home).
Remove the Login Module
For this site we want the login module to appear everywhere except the Snail article. Return to the administrative area.
- Navigate to Content > Site Modules
- Click on the Login Form module.
- Click on Menu Assignment (tab, just below the title)
- Set Module Assignment to On all pages except those selected
- Uncheck Home (leave Snails checked)
- Save & Close
View the Snails article. The login form appears everywhere except in the snail article.
Summary
Using the module assignment feature we created a Snail Fun Fact module to appear only on the Snails page. We created a Site Maintenance module to appear on all pages, and reconfigured the Login Form module to appear everywhere except the Snails menu item.
Concepts
Modules are assigned to all menu items by default, but can be configured to appear only on selected pages, or to be excluded from selected pages.
In Joomla menu items are synonymous with pages. Assigning modules to menu items is to assign them to pages.