Encodera

Thanks for reading!

Donate to the site — we work hard for you.

Contents

Introduction to Joomla

Joomla is a content management system (CMS). Right after installation it has articles, menus, users and access rights, and all of it is managed from a control panel in the browser. Whatever is missing is added with extensions — and this course is about writing them yourself.

Version

The course targets Joomla 5. Extensions in Joomla 4 are built the same way: classes live in namespaces, and every extension is wired up by a services/provider.php file. Differences from version 4 are pointed out in the text. Old-style Joomla 3 extensions are not covered.

What you need

WhatVersion
PHP8.1 or newer
MySQL8.0 or newer (MariaDB 10.4+ works too)
Web serverApache or Nginx — any local stack such as XAMPP, Laragon, OSPanel

Installation

  1. Download the Joomla 5 archive from joomla.org.
  2. Unpack it into a site folder of your local server, for example joomla.test.
  3. Create an empty database, for example joomla.
  4. Open the site in the browser — the installer starts.

The installer asks for the site name, the administrator name and password, and the database details. At the end it removes the installation folder itself and writes the settings into configuration.php.

Two sides of the site

After installation the site has two entrances:

AddressWhat it is
http://joomla.test/The site visitors see
http://joomla.test/administratorThe control panel

Log in to the panel with the name and password you set during installation. On the left there is a menu: Content, Menus, Components, Users, System. The course refers to these sections all the time.

Debug mode

During development errors must be visible. Open System → Global Configuration:

  • on the System tab turn on Debug System;
  • on the Server tab set Error Reporting to Maximum.

Save the settings. A debug bar appears at the bottom of every page: database queries, timing, loaded language files. A PHP error is now shown with the file and line number instead of a blank page.

What we will build

One example runs through the whole course — a set of "Hello" extensions:

ExtensionWhat it does
Module mod_helloA block with a greeting and a list of the latest articles
Plugin plg_content_helloInserts the current year into article text
Component com_helloA section with blog posts: a list, a post page, editing in the panel

Common mistake

Debug mode gets turned on on a live site "for a minute" and forgotten. The debug bar shows visitors database queries and server paths. Debug on a local copy, and keep debugging off on the live site.

Thanks for reading!

Donate to the site — we work hard for you.