Blog: PHP

Upcoming changes to Joomla 4's head include

Published

I do admit that I like to be in control of the markup of a site - I like to know what is being loaded, and why – and I like to have some say in what gets loaded and where.

Google PageSpeed gives your site a rank for its performance on desktop and mobile, and one of those factors is about loading external assets – JavaScript, CSS, fonts, etc.

In a template in Joomla 3, there’s that handy line to pull in the assets needed for the site, especially those required by any component or plugin you may be using:

<jdoc:include type="head"/>

But what if I don’t want it all in the head of my site? Sorry, Joomla 3 won’t allow me to work that way. A Google around shows that I’m not the only one wanting an alternate way. There are solutions of changing core Joomla files, but that’s such a no-no – when you update Joomla, the changes are lost. So that is totally not an option for me.

But on my dev machine, I have a sandbox for playing with different things - and one of those is the current Alpha build of Joomla 4.

What is really cool about Joomla 4 is the introduction of different includes to help placement of different parts of the code – so for example, scripts could be loaded below the fold to help with increasing the site’s Page Speed ranking and performance.

<jdoc:include type="metas" />
<jdoc:include type="styles" />
<jdoc:include type="scripts" />

It will be so handy to have this greater control on what goes where – and have this functionality native out of the box.

But Joomla 4 is still in Alpha – and while the current roadmap aims for a RC by 4th Quarter 2018, there still seems to be a lot of work to complete. A stable release is currently planned for the first half of 2019.

This minor tweak of the include makes my life so much happier as a developer. I’m such a control freak.

Blog

View all
JS

TinyMCE 5: Creating an Autocomplete Plugin

I had a great time last week hanging out with the Tiny team in Brisbane for their Product Week, seeing what the team are up to (and experimenting with during their...

Continue reading...

JS

Bulma, Vue and Webpack: oh my!

I’m working on a new project. Well, actually, no, it’s the rebuild of an old project. Written for PHP4/5 old. And yet, because I rock, still runs on PHP7. But…...

Continue reading...

Music

Why

While collating tracks for a 138 bpm mix, I found that not only was there so much great music out there, but I had enough for different "feels" of 138 bpm. This...

Continue reading...

JS

TinyMCE 5: Creating a custom Dialog Plugin (and with Custom Button Icons)

Edited: February 6, 2019. The included code also works with the TinyMCE 5 Stable release. I’ve been using TinyMCE for years – I think if I look back in my...

Continue reading...

I am the Development Director (and co-owner) at Mity Digital, a Melbourne-based digital agency specialising in responsive web design, custom web development and graphic design.
Mity Digital