Why Every Joomla Front-End Developer Needs to Learn PHP

Young man with beard and glasses at desk

Years ago, in a conversation with one of the founding members of Joomla, he said to me, 'Stop being lazy and learn how to code.'

 

Stop being lazy and learn how to code.

 

I remember being very conflicted and at a loss for words in response to his comment at the time because I was balancing so many things on my plate. I was newly self-employed, running my own Joomla business, and it was challenging especially after many years of better paid employment working in a different industry. I was already dealing with HTML, CSS, web servers, sales and marketing, project management, people management, accounting, etc. Many of the people reading this blog might be able to relate to this.

Despite confidence in my own front-end skills, this person was clearly superior, even though he rarely did front end work. I observed him effortlessly write JavaScript for a Joomla drop-down menu in real time. Then he generously handed it over for use on my website. When I asked how he could write code freehand he simply responded, "Code is poetry." In that moment I realized my poetry skills were lacking.

 

Code is poetry.

 

Whenever I attempted to learn PHP through many of the free courses I found online, I would make some progress, but the demands of life, including earning a living, would invariably disrupt my focus and the discipline required to complete them. Years would go by and although from time to time I would do some PHP related things I had little understanding of how it really worked.

In Joomla v3.7 when custom fields became a thing I wanted to use them in layout overrides and I wasn't able to figure it out. I read articles and tutorials about custom fields and layout overrides but I still struggled with them.

I turned to third-party extensions and complex page builders, which I noticed many Joomlers adopting. They produced nice looking sites. However, I was uncomfortable about becoming reliant on these tools. I didn't use them on my most crucial website - my personal Intranet - it remained predominantly stock Joomla. I was constantly adding information, updating, and experimenting on my Intranet. Then, one day, something intriguing occurred.

 

How can I use custom fields in a layout override?

 

I posted a general question in a Joomla Slack Workspace where there were lots of really good Joomla developers, including the guy that told me to stop being lazy. The question was, "How can I use custom fields in a layout override?" To show I wasn't just trying to get someone to give me something for nothing without any effort on my part I posted some code that failed to work.

A person I didn't recognize reached out to me in the Slack channel and offered to help. He sent some code and showed me how to use it in a PHP file and it worked! I was really grateful for the help. I was hoping to find him chatting around in the Workspace some more but didn't. I got busy again and went merrily on my way now that I had a tiny bit of knowledge on how to use custom fields in a layout override, and boy did I use that code a lot!

Joomla and PHP

Layout overrides using custom fields unlocked my creativity, I was doing some really cool things, but still only within my Intranet. When it came to client websites, I continued to rely on extensions and page builders.

 

A trip to JoomlaDay Austin Texas was the turning point

 

I used the JoomlaDay USA 2022 event in Austin Texas as an opportunity take a bit of a break and made a road trip out of it with my wife. We drove from Canada to Texas over the course of a couple of days stopping along the way to see some things of interest. We did the JoomlaDay event and headed back home for the drive. By this time I knew a bit more about the guy that helped me in the Slack forum. His name was Adam Melcher and he lived near Nashville. Adam's Joomla centric business is called New Line Web Design. We would be passing nearby where he lived and I thought it would be really nice to meet him. We were literally 3 hours away from his place when I texted him and asked if he would be willing to meet me in person for a coffee.

He responded with an invitation to visit his home, which we accepted. We ended up spending a night at his beautiful residence and had a great visit with Adam and his wife. Our interaction was brief, yet we instantly hit it off. Now I regarded Adam not only as a fellow Joomler but also as a personal friend. However, this relationship evolved to be much more significant. Adam is the reason I am finally learning PHP.

Adam showed me some of the things he is doing with Joomla and I only knew of a couple people in the Joomla community, mostly overseas, that were doing anything at all with Joomla like he was. He showed me what he was doing with just the Joomla core that everyone else I knew was using extensions and page builders to do. This really appealed to me because I hated the onerous task of updating to new major Joomla version on sites that have several third party frameworks and dependancies.

 

Here's what made the difference

 

Adam offered to share his time to help me learn how to work with Joomla and PHP. I took him up on it with a lot of trepidation because of my previous failed attempts. We started doing Zoom sessions together. We'd schedule one hour but often it would go three or fours hours straight and I would be mentally exhausted by the time we ended. Adam stuck with me and encouraged me and made me believe that doing what I had failed to do several times before was totally doable as long as I stayed the course. I kept at it because a very talented person, whose time is valuable, was willing to share his knowledge with me. He is a busy guy and I have no idea how he is able to do what he does as well as squeeze me into the mix.

When I asked him why he was doing this with me, he explained that someone had once helped him, and this was his way of paying it forward. I feel fortunate to be the recipient of this philosophy. After a long struggle, I am finally liberated from total dependency on 'helpers.' I can now harness Joomla's core capabilities which are formidable. It's made a massive difference and I'm only getting started.

Before this adventure I had already made up my mind that I was going to build my own Joomla template for Joomla 4 and 5. I created the HTML for one using Tailwind which was easy for me me since I was already comfortable with CSS. Then I built a CSS Grid only version thinking it would be a better choice. When Adam got a hold of me he said, "just use what is already in Joomla". This happens to be Bootstrap and it's really well documented online. Once I came to terms with this then everything started to click. With a lot of help from Adam I now have a custom website theme based on the stock Cassiopeia template that comes with Joomla. Working this way has reignited my passion for Joomla and my creativity has exploded.

 

Just use what is already in Joomla

 

I got Adam involved with the JoomlaDay USA team and he has been branching out to show North American Joomlers how to do things with core Joomla. Here's something that you might like:

 

mysite

Adam Melcher of New Line Web Design has made a core Joomla 5 template available for anyone to use. You can get it here:

Go to mysite.jdayusa

 

Why should every joomla front-end developer Learn PHP? By learning how to work with Joomla's core PHP files you can unleash your creativity and do things the way you want to do them. You will be learning PHP in a way that tangibly benefits you. It's hard work, but it is work that will make a huge difference down the road. Imagine the day when the developer of that extension or template you depend on decides they no longer want to continue with it. When that day comes, you won't be in a big crisis even if you are using their code because you will know how to deal with it. This is what open source is all about.

Joomla vapourware shouldn't surprise you. Consider the numerous technology companies, like Google and Apple, that have developed products only to discontinue them after users have grown dependent on them, due to a change in their strategic direction.

 

Without knowledge of PHP, you're unaware of the opportunities it can give you, but substantial benefits come from the strength of your PHP knowledge.

 

Joomla is developed using PHP so if you want to be really good at Joomla and not just someone who is dependant on others it behooves you to learn PHP. If you are using Joomla then you are already in an open source environment and community where others will help you make it through the PHP learning curve so you can become comfortable with it. Am I a PHP developer now that I know how to do some things with core Joomla? Not at all, I still have a long way to go but when I look back at what has been accomplished I am really happy. I hope you find someone to help you along the way to learn how to work with core Joomla files and PHP. The Joomla Community has people like Adam in it who will help if you are willing to pay the price in time and sweat just like they did. Then you will get to a place where you are able to fearlessly tackle Joomla core and PHP. This will make you better and more valuable at what you do with Joomla.