How to Create Joomla! 5 Component
This is step-by-step guide on how to create a Joomla! 5 Model-View-Controller (MVC) component from scratch. Joomla! components are split into three parts: Administrator, Site and API.
The administrator part provides an interface to manage the component from the backend. The site part provides the pages requested by users visiting the website at the frontend. The API part allows to access component through Joomla web services.
In this tutorial, we will be creating a Joomla! component - com_stars. This component will store the information about various Planets. First, we will develop the Admin part and then the Site part.
The main directory of the component will be com_stars. The "com" prefix means "component" and the "stars" is the name of the component. Inside this directory, there are three subfolders for the admin part, site part and API part. You also need a manifest file - stars.xml. Keep changing this manifest file as you develop your extension and add more files and features.
A. General Concepts
- How Joomla MVC Component Works
- Manifest Files for Extensions
- Types of Models in Joomla
- Admin Model
- Backend Toolbar and Actions
- Joomla XML Form
- SQL Queries
B. Backend or Admin Part
- Adding Basic Files
- Creating and Managing Joomla Database Tables
- Form - Model and View
- Actions: Save and Cancel
- Automatic Handling of Fields
- List Items - Model and View
- List Layout File
- Actions: New and Edit
- Actions: Delete, Publish and Unpublish
- Searching and Filtering
- Sorting and Ordering
- Pagination
- Custom Actions
- Sub menu (Joomla! 3 Only)
C. Frontend or Site Part
- Folder Structure and Main Controller
- Frontend View for Item
- Frontend Model for Item
- Site Menu and Request Parameters
- How to Access Menu Parameters
- Frontend List of Items
- Frontend Single Item
- Frontend Form
- Title for Frontend Views
D. Advanced Component Development
- How to Use User State Variables
- Link with Joomla Categories Component
- Add Configuration Options and Parameters
- Add Alias Field to Joomla Component
- Create Router for Component
- Add Access Control List (ACL) in Joomla
- Working with Images in Component
- Add Modal to Joomla Component
- Add Ordering of Items
- Add Update Server to Component
- Link with Joomla Custom Fields