Joomla
Joomla! is a free and open-source content management system (CMS) for publishing web content. It is built on a model-view-controller (MVC) web application framework that can be used independently of the CMS that allows you to build powerful online applications.
How To Create Joomla 5.x Module
Modules are lightweight and flexible extensions that are displayed in pages at different module positions. These modules are displayed like boxes arranged around a component in top, sidebar or footer positions. For example, login module or html module.
Link Component with Joomla Custom Fields
You can enable custom fields feature to your component. This allows to create and display additional attributes to items or records.
How to Add ACL in Joomla Component
With Access Control, you can define which user groups are allowed or denied to do which actions in your component. In the database, these are stored in _assets table. You can also read the basics of Access Control Levels in Joomla.
How to Link Joomla Categories Component
You can link Joomla! Categories functionality in your custom component where you can define a set of categories to use. This way, you don't need separate categories table for your component.
How to Get Form in Front End
A form to the site frontend allows users to submit information that can be saved to the database or sent to emails. For example, frontend forms in Joomla are used to create article (com_content), contact form (com_contact), user registration form (com_users).
Frontend List of Items
The concept of displaying the list of items at the frontend is very similar to displaying the list of items at the backend. The View file gets the items from the Model and then the Layout file displays the list of items. You can display in tabular layout or blog layout or any other layout.
Add a Menu Type to Joomla Site Part
After the component is installed, you can create a menu Item to access it. This allows to access the component through a menu rather than having to remember what to type into the address bar. Each view and layout can have its own menu item.
Add a Model to Joomla Site Part
The HtmlView class asks the model for data using the get method. For example, this get method converts the get('Item') call into a getItem() call on the model, which is the method which you have to provide in the model.
Add a View to Joomla Site Part
When no task is given in the request variables, the default task is display. The BaseController class has such a task. When the display is used, the 'view' variable decides what is displayed on the page.
Main Joomla Controller File
The DisplayController is main or default controller for a Joomla! component. At present, the component specific controller doesn't do anything more than the parent class already does, which is why the controller class is empty.
How to Get List of Items in Joomla
While developing extensions, you need to query the database and display list of items. Joomla! provides an easy way to achieve this. The view file gets the items from the model and then the layout file displays the list of items in tabular format.
How to Add Sorting & Ordering of Columns in Joomla Component
The state variables list.ordering and list.direction are used to store the ordering column and ordering direction (ascending or descending). The filter form is used for the ordering and sorting field. In the model, you have to allowable columns in the $config array.
How to Add Search & Filtering in Joomla Component
Searching and Filtering is implemented through a form that is displayed above the list of items in the backend. Site administrators can search or filter the data as per the fields defined in the form.
Adding Back-end Actions: Save and Cancel
In the form View, you can add action buttons like Save and Cancel to submit the form or cancel the editing respectively. These buttons are added to the toolbar.
Adding Back-end Actions: Delete, Publish and Unpublish
From the list of records layouts, you can add a toolbar button to delete records. The task for the Delete action is: planets.delete
Adding Back-end Actions: New and Edit
Add and Edit actions both redirect to the same form. You can display the Edit by clicking the title. If the id is 0, it indicates Add action. If the id is greater than 0, it indicates Edit action.
Add Backend Toolbar and Actions in Joomla
In Joomla!, the administrator interacts with components through a toolbar. Toolbar is a collection of action buttons (New, Save, Close, Publish and so on). It also creates a title for the component.
Automatic Handling of Fields
Values of some fields in the form can be automatically handled. There is no need to fill in the values while creating or editing a record.
How to Get Form in Joomla Component
The Form class of Joomla is used to create complex forms with flexible layouts and dynamic properties. First, the form fields are defined in the XML file. Then, the view file gets the form from the model and layout file displays the form.
Creating and Managing Joomla Database Tables
In Joomla!, components usually manage content using database tables. During the install, update or uninstall phase of a component, you can execute SQL queries through SQL text files.
Joomla Backend List Layout File
The layout file, default.php, displays the list of records or items in tabular format. This list of items is obtained by the view file from the model as array of objects.
Adding Basic Files for Component
To start developing Joomla MVC component, first you need to add six files to create a working minimal component.
How Joomla MVC Component Works
Component is a type of Joomla extension (like Modules and Plugins). Unlike modules and plugins, components have two main parts - site and administrator. The site part is visible to visitors (frontend access). The administrator part is interface for managing extension from the backend.
How to Access Joomla Menu Parameters for Component
When you create a menu item for any view of the component, there are many options in the menu you can configure. These values can be accessed in Joomla! code.
How to Create Router for Joomla Component
Joomla! has capability of creating and parsing URLs as SEF (Search Engine Friendly) URLs. The SEF URLs follow a certain fixed pattern. User can define a short descriptive text (known as alias) for each segment of the URL.
Joomla MVC Component Class
Joomla! 4 has a new class for dispatching components. The class is called MVCComponent which extends Component class.
Add Alias Field to Joomla Component
An alias field is required for SEF (Search Engine Friendly) URLs for accessing items on the website. SEF URLs are helpful for to both humans and search engines.
How to Add Configuration Options in Joomla Component
The Joomla allows the use of parameters stored in each component. The fields for the configuration options are stored in the XML file located at admin/config.xml.
User State Variables in Joomla
Joomla has a built in functionality to make it easy for developers to store and retrieve variables that are stored with the session. There are two ways to set user state variables.
Get Single Item in Front End
The view asks the model for the item. In the model, you need the id of the item for querying the database. You can get this id from the URL.
Adding Custom Back-end Actions
The task for the custom action is defined as compound tasks - the first part is the controller and the second part is the name of the method.
Add Pagination
When you have many records, you can use pagination to divide the records into multiple pages. Joomla! provides a simple way to include pagination to the list view and layouts.
Joomla XML Form
The Joomla! XML forms are used to define form fields, field sets and field groups.
SQL Queries During Component Install, Uninstall and Update
During the install, uninstall or update phase of a component, you can execute SQL queries through the use of SQL text files.
Add a Model to Joomla Admin Part
The HtmlView class asks the model for the data using the get method of the BaseHtmlView class.
Nested Set Model in Joomla
Joomla includes support for storing and retrieving hierarchical information in the form of nested sets in database tables. This is used in the implementation of menus and categories in the core Joomla CMS from version 1.6 onwards.
Joomla Manifest Files for Extensions
All Joomla extensions have XML manifest files (<extension_name>.xml). This file is located in the root directory of the installation package. It include general installation information and parameters for the extension.
How to Create Joomla Task Scheduler Plugin
Joomla! included Task Scheduler from the version Joomla! 4.1. It helps to automate repetitive and routine tasks for for a wide variety of maintenance and reporting tasks.
Different Types of Models in Joomla
There are six types of models that can be used in a component. To create a model in your component, extend your model class with one of the models provided by Joomla.
How to Create Joomla 4.x Plugin
Plugins are easily installed as a .zip file but a correctly formatted XML file must be included. The object-oriented way of writing plugins involves writing a subclass of CMSPlugin.
Joomla accesslevel Form Field Type
It provides a drop down list of access level options with the current option selected.
Joomla calendar Form Field Type
The calendar form field type provides a text box for entry of a date. An icon next to the text box provides a link to a pop-up calendar, which can also be used to enter the date value. If the field has a saved value this is shown in the text box. Otherwise the default value, if any, is displayed.
How to Get URI in Joomla
The Uri Class is used to get information about the current Joomla URL and parts of the URL.
Joomla list Form Field Type
The list form field type provides a drop down list or a list box of custom-defined entries. If the field has a saved value this is selected when the page is first loaded. If not, the default value (if any) is selected.
Joomla radio Form Field Type
The radio form field type provides radio buttons to select different options. If the field has a saved value this is selected when the page is first loaded. If not, the default value (if any) is selected.
Joomla textarea Form Field Type
The textarea form field type provides a text area for entry of multi-line text.
Joomla text Form Field Type
The text form field type provides a text box for data entry. If the field has a value saved, this value is displayed when the page is first loaded. If not, the default value (if any) is selected.
How to Display Messages and Notices in Joomla
Messages, errors, warnings and notices can be displayed from any component, module, plugin or template. The messages use the standard bootstrap CSS styles for alerts.
How to Get Menu in Joomla
In Joomla a Menu is the set of navigation links you can have as a main menu (at the top of site) or side menu or footer menu. Each of the individual navigation link is a Menu item. You can easily get menu items in Joomla.
Joomla HTMLHelper::_ Class Loader Method
The HTMLHelper is utility class for all HTML drawing classes. The _() method of HTMLHelper is a static function that grants quick access to a number of other static methods. The return value of this function depends on the return value of the method resolved by parsing the first parameter.
Retrieving Request Data Using Input
The Joomla Input class allows you to retrieve the parameters which were sent in the HTTP request. It doesn't matter whether the parameters are GET parameters or POST parameters, both can be accessible with the help of the Input Class.
Accessing Global Configuration Information in Joomla
Like user information, accessing global configuration of Joomla (like site name, from name) is a very simple process. You can use getConfig() method of Factory class in any part of the Joomla extension or template.
How to Handle Files in Joomla
The base for file handling is the File class. It is part of Filesystem library which includes File, Folder and Path.
Sending Email From Joomla Platform Using Mailer
Sending an email from any Joomla extension is very simple process. You can put this code into your component's controller file or module's helper file.
Working with Joomla Database
To query data source, you can call a number of DatabaseQuery methods like select, from, join, insert, update, delete, where and order. By using these methods, you can create almost any query.
Joomla Application Object
The main applications are Administrator, Site, and Installation. With the CMSApplication, you can access many things in Joomla. For example, you can access configuration, input variables, menu or enqueue messages which are shown to the user.
How To Use Dates in Joomla
Joomla has a helper class Date, which extends from PHP's DateTime class. It allows developers to handle date formatting more efficiently.
Joomla menuitem Form Field Type
The menuitem form field type provides a drop down grouped list of the available menu items from Joomla site.
Page 1 of 4