How to become a Joomla extensions developer
One of Joomla! Key strength lies in its extensibility through the use of Joomla extensions. If you have a passion for web development and want to contribute to the Joomla community, becoming a Joomla Extension developer can be a rewarding path to follow. In this article, we will explore the knowledge and skills required, along with some essential dos and don'ts, to help you embark on your journey as a Joomla Extension developer.
Learn the basics
Joomla is developed on PHP, so most of the time you will be writing or using PHP code in your extension. You do not need to be a PHP guru, but knowing the basics of modern PHP will help you develop better extensions.
As any programming language, in PHP you have multiple recommendations, or design patterns. These designs are just a solution for a repetitive problem anyone found sometime. If there is one simple design pattern you need to know when programming Joomla extensions, that is the Model-View-Controller (MVC) design pattern. This pattern is so extensive in Joomla, it affects the philosophy and usability of the whole system.
The best way to learn Joomla Extension development is by building actual extensions. Start with simple projects and gradually work your way up to more complex ones.
Start building a Joomla plugin. It's the simplest extension you may write in Joomla and also, it could be really powerful. After your first simple plugin, you may keep improving its code structure to use the new Container Injection pattern that is part of every Joomla extension now.
Write solutions, not code
Ok, this looks like against the previous advice but, do you know what do the top-rated Joomla extensions have in common? They started as a solution for a problem their developers faced. These developers needed to solve a problem with their customers, and they found it easier to do it with an extension. Then they eventually decided to publish the code.
You may think that after 18 years of Joomla, all the problems are solved, but that is far from being true. Just check Joomla forums, Joomla Subreddits or Joomla Stack Exchange and you will see lots of problems people need to solve.
Taking a minute to help these users will give you 2 benefits:
- You will learn a lot about how Joomla internals and how some third party extensions work
- You will practice writing simple snippets of code that solve the issues these users face.
Eventually, you will identify a problem that could be solved with an extension, and you will be ready to create your first extension.
I keep contradicting my self... But you should trust the mantra:
"Good coders write code, the best coders steal it"
This does not mean copying and pasting code from anywhere in your extension, but getting inspiration from other developers.
The Joomla Extensions Directory (JED) provides a vast collection of existing extensions that you may study and analyze to understand their structure and functionality.
Check their code, analyze why they use
array_map instead of a
foreach structure, and try to get into their heads. That will help you learn design practices from the best.
Joomla is an evolving platform, and staying current with the latest developments is essential. Keep track of Joomla's official website, developer forums, and relevant blogs to stay informed about new features, updates, and security guidelines.
Regularly update your knowledge to ensure that your extensions remain compatible with the latest Joomla version.
Set up a development environment (and be comfortable with it)
First things first, you should choose a code editor you feel comfortable with. A very popular option is Code by Microsoft. It's extendable with plugins, and we even have a community channel at Mattermost to share tips about it. Also, Joomla Core developers are in love with PHPStorm and I must confess I am of those crazy people using Vim for coding... Anyway, use whatever feels good for you.
Once you choose your editor, you need to set up a testing environment. You may choose to install your own web server on your local machine, set up a remote server, or use docker to have your environment. In any case, don't be amazed by the shining lights of dockerized environments integrated with CI and automated testing. That is a complex setup to create, and you may not feel comfortable with it.
I find the service of launch.joomla.org very convenient as a starting point. You will not need to worry about setting up or maintaining the service and you have all the basics of a webserver.
Personally, I started developing in my local machine using a local installation of Apache, MySQL and PHP. It was nice at the beginning but as PHP started to evolve, and I had the need of testing multiple PHP versions, everything become more complex. Nowadays, I mainly use a remote server for my tests and sometimes I use docker on my computer to test locally.
Publish your code
Finally, once you got to something you think might be helpful to others, make it public. No matter you do not have a website to distribute it. Nowadays, you can use GitHub to store and publish your releases and in case you want to charge for the extension, you can use services like FastSpring or GumRoad to request a fee for it.
But you need to publish it. Leonardo Da Vinci (the italian genius) said:
[...] stagnant water loses its purity; even so your code rusts from not being published.
So, make it available to the world 😜.
Quick tips for your code
- Follow the Joomla coding standards and best practices to ensure the quality and maintainability of your extensions.
- Write clean and modular code to make your extensions more flexible and easier to maintain.
- Use xdebug to learn more about Joomla and to see how your code integrates in the system.
- Continuously update and improve your extensions based on user feedback and changing requirements.
- Don't overlook security practices. Joomla has built-in security features, but it is important to follow secure coding practices to safeguard your extensions from vulnerabilities.
- Don't copy or modify existing extensions without proper permission or attribution. Respect intellectual property rights and licensing terms.
- Don't ignore documentation. Document your code and provide clear instructions for installation, configuration, and usage of your extensions. Well-documented extensions are more likely to be adopted by users.
Becoming a Joomla Extension developer is an exciting and rewarding journey for anyone passionate about web development. By building a strong foundation in web technologies, mastering the Joomla framework, gaining hands-on experience, staying up-to-date with the latest developments, and engaging with the Joomla community, you can unlock a world of possibilities.
Remember to adhere to coding standards, prioritize security, and contribute positively to the Joomla ecosystem. Embrace continuous learning and improvement to create high-quality extensions that add value to the Joomla community. Happy coding!
We are in May, it's a great time to bloom as Joomla Extension developer 😉.
By accepting you will be accessing a service provided by a third-party external to https://magazine.joomla.org/