Book Image

Developing Extensions for Joomla! 5

By : Carlos M. Cámara Mora
5 (2)
Book Image

Developing Extensions for Joomla! 5

5 (2)
By: Carlos M. Cámara Mora

Overview of this book

Joomla! 5 is a groundbreaking CMS that helps you take a significant leap into the world of content management systems. Joomla! 5 features a variety of impressive new features that align with current web standards and enable you to experience lightning-fast performance for optimal web page optimization, leverage the new code architecture, and tap into the WebService API, among others. This book takes you on a journey of extending Joomla's capabilities by developing your own extensions. The chapters not only explain the key concepts behind Joomla's architecture but also equip you with the latest techniques for crafting components and plugins. You’ll discover how to leverage existing features within Joomla! to empower your extensions and create tailored solutions. The book takes you from the initial stages of planning your extension development to a fully featured finished product. As you advance, you'll learn invaluable techniques for testing your extension, addressing common issues, and preparing it for publication. The concluding chapters of this comprehensive guide teach you how to test your extension for common issues, along with how to publish the extension for everyone to use. By the end of this book, you’ll have the confidence and skills to complete the cycle of extension development.
Table of Contents (21 chapters)
1
Part 1: Developing Components
8
Part 2: Developing Modules and Plugins
12
Part 3: Extending Templates
15
Part 4: Distributing Your Extensions

Understanding what a Joomla! component is

In Joomla!, we have several types of extensions – components, modules, plugins, templates, libraries, packages, and languages. All of these have a specific purpose in the system, but due to Joomla’s flexibility, in some cases, it can get difficult to choose one type over the other. Should I use a module to include content at the end of my articles, or is it better to use a content plugin? Do I use a custom user plugin to add fields to my user profile, or should I use Joomla! Custom Fields capabilities? After reading this book, you will be able to choose the option that best fits your project.

The main and most complete extensions in Joomla! are components. We can think of Joomla! components as small web applications on their own. Components do not need to be supported by any other parts of your Joomla! site. They can work isolated from the rest of your site, and they complete the scope of your website.

In any case, you will get the most from any component when they team up with other Joomla! parts, such as modules or plugins.

Your website is formed by lots of pages, and every page has a URL. In Joomla!, every time you access a URL, you are inside a Joomla! component. So, components have their own page requests, and no other components of the site can affect them when you load their URL. Despite this isolation, they can communicate with other components using their code.

Some characteristics of a Joomla! component are as follows:

  • Joomla! components offer a secure entry point for your requests. With them, you may create webhooks for external services or receive data from forms.
  • Components usually have a backend and a frontend. The backend is usually restricted to managers and administrators of the site and is used to manage the data.
  • In most scenarios, your component will have to store data in the database. For instance, if you want to create a component to track your projects’ progress, you need to store the names of your projects, their statuses, and probably more information in the database. For this reason, components install new tables in your database to store information.
  • Components automatically add themselves to Joomla’s backend menu, and they install new menu item types on your site to show their data on the site’s frontend.

In fact, in Joomla!, you are always working with components as every page (backend or frontend) of your site is a component view.

Now that we know some characteristics of a component, let’s see how we can use them to solve real-world problems.