Updated February 14, 2023
Introduction to Joomla Modules
Joomla is an open-source, free website development tool that supports the content management system. Joomla provides different extensions, or we can say that widgets make easy development; the modules are also lightweight extensions that Joomla provides. Sometimes we need to display specific content, or we can say that if we want to insert the content on the page at that time, we can use the module. For example, we consider the news, login, or banner modules. Typically Joomla itself has different types of inbuilt modules.
Overview of Joomla Modules
Joomla modules are very light and easily migrated extensions used for the fastest delivery. Modules are boxes, so we can easily arrange them on a web page per our requirements. For example, we can consider the login module inside the footer and place a different menu. After establishing a connection with the part, we can also see substances of new news fields, or we can say that recent news. Joomla provides different types of inbuilt modules to the users. Modules are overseen in the Joomla Executive view by the Module Manager. More data about the module board can be found on the fitting variant assistance screens.
A module position is a placeholder in a format. Placeholders distinguish one or a few situations inside the layout and tell the Joomla application where to put yield from modules relegated to a specific position. The format originator has unlimited authority over module positions, making varieties among layouts and the different Joomla Default positions allocated to modules in the establishment test information.
Given below are some default modules as follows:
- Archived Articles: It shows the list of calendars containing archived articles.
- Articles: It displays a specific number of articles from a specified category.
- Related Articles: It is used to display related articles that are viewed.
- Categories are used to display the specific category from the parent category.
- Banners are used to display the active banners from the specified components.
- Breadcrumbs: It is used to display the breadcrumbs.
- Custom: By using this module, we can create our custom module per our requirements.
- Feed Display: We can display the syndicated feed using this module.
- Footer: It is used to show the copyright information of Joomla.
- Language Switcher: By using this module, we can display the list of available languages.
- Latest News: It is used to show a list of recent news.
- Latest Users: It is used to display the recently registered users. It also provides many more default modules to the user.
How to Create Joomla Modules?
Let’s see how we can create the modules in Joomla as follows:
First, we need to create the folder we want inside the Joomla modules folder, as shown in the screenshot below.
In the second step, we can create a helper.php file that is already created; with the help of this file, we can showcase the data. We need to create a PHP file named mod_samplehello.php and add the following code.
Code:
<?php
// Does not provide directory access
defined('specified directory name) or die;
// Include function for syndicates
require_once dir_name(specified file name) . '/helper.php';
$hello = modsamplerHelper::getsample($params);
require JModuleHelper::getLayoutPath('mod_helloworld');
?>
In the next step, we need to create the .xml file to store the information about the modules. This XML file stores all installed Joomla files for the specified module.
Code:
<?xml version = "1.0" encoding = "utf-8"?>
<extension type = "module" version = "3.1.0" client = "site" method="upgrade">
<name>Hello world Program!</name>
<author>Tutorials Point</author>
<version>1.0.0</version>
<description>Sample module creation part.</description>
<files>
<filename>mod_sampleword.xml</filename>
<filename module = "mod_sampleworld"> mod_samplehello.php</filename>
<filename>home.html</filename>
<filename>helper.php</filename>
<filename>temp/default.php</filename>
<filename>temp/home.html</filename>
</files>
<config>
</config>
</extension>
Next, we need to create the HTML file with the name home.html. The reason for composing this document is that the made indexes should not be perused. When a client peruses these registries, the index.html record gets shown. So you might keep this record vacant.
Code:
home.html
<html>
<body>This is Joomla module point </body>
</html>
We need to create the folder name as a temp and place the default.php file inside the temp folder as follows.
Code:
<?php
/**
* @package Joomla.Site
* @subpackage mod_firstmodule
* @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
>
<p>Hi SampleModule</p>
Now everything is fine; we need to select an extension; inside the extension, we need to select Extension manager; we will get a new screen, where we need to select create a module and click on the Upload and Install button as shown in the below screenshot.
Output:
After completing the upload, we must select a new option from Module Manager. There you can view your created module file as shown below.
Remove Joomla Modules
Let’s see how we can remove the modules in Joomla as follows:
First, we need to click on the Extensions menu and select the Manage option, as shown below screenshot.
After clicking on manage, we get a new screen where we need to search for the module we want to remove, as shown in the screenshot below.
Here we need to enter the module name and click on Uninstall; after clicking on Uninstall, we get a confirmation message, as shown in the screenshot below.
After clicking on it, we get the successful message on the screen, as shown below, for more confirmation.
Conclusion
In this article, we are trying to explore the Joomla modules. In this article, we saw the different types of Joomla modules as well as what are the uses and features of these modules. Another point we got from the article is how to install the modules in Joomla.
Recommended Articles
This is a guide to Joomla Modules. Here we discuss the introduction and how to create and remove Joomla modules. Respectively. You may also have a look at the following articles to learn more –