How do you create a custom module?
From Joomla! Documentation
Revision as of 13:36, 1 August 2019 by Cmb (Brought the page up to Joomla version 3.)
To insert a custom module in your Website, go to Administrator → Extensions → Modules and select the New icon. You will see a list of available modules. Select the Custom icon and edit the module.
A module is a special program, or even a special type of article, that can be displayed in the module positions available in your Joomla Website's template.
To see all of your template's available module positions, add the code ?tp=1 after one of your page's URLs. For example, http://www.yoursite.com/?tp=1
To see the list of all the modules available on your site, go to Administrator → Extensions → Modules.
Before you create a new module, look at an example:
It is of a particular type: mod_login.
Title - The title of this module.
Show Title - Display or hide the title.
Position - This relates to your available Module Positions mentioned above.
Order - The order in which the module is displayed if there is more than one module in the selected position. (You control this after saving the module and looking at all the modules for this position. See Order of the Modules for a Position, below)
Menu Assignment - This is where you choose where this module will be displayed. For example, the login form might only be displayed on the Home page.
Options - Some modules have parameters associated with them that are set from this tab.
Create Your New Custom Module
To display some information on some or all pages, in say the left column, you can go to the Module Manager and create a New custom module.
In Administrator → Extensions → Modules select the New button. Then choose Custom.
- Enter a title
- Choose to show or hide the title
- Select the module position
- Set the Status to Published
- Switch to the Menu Assignment tab and designate the pages on which the module will be displayed
Note that Module Class Suffix is a setting that will relate to your template. Refer to the template's documentation to use this parameter.
Try it Out
Put in a test module and see what you can achieve. Set Status to Unpublished to turn it off if you are not ready to display it to the world.
Order of the Modules for a Position
In Administrator → Extensions → Modules, restrict which modules you are looking at by choosing Search Tools → Select Position. Enable the drag and drop ordering tool by selecting the up and down arrows icon at the top of the far left column. You can now use your cursor to grab one of the first column icons to reorder the modules.
You use this to control who can see a module. For example, the User Menu module might have the access set to Registered. This means that this module is only seen when a registered user is logged in.
As a super administrator, you can restrict the Access level to Special. Then only you and the other administrators will see a module when you are logged in on the front of the site.