
What's new in Joomla 5.1?
On April 16, 2024, Joomla 5.1 was released. Do you have a website with Joomla version 4.x or 5.x, then you can update your Joomla website with 1 push of a button.
This release brings many small (code) improvements and there will be a number of options and features added. In this article I will show you the most important changes.
Secure Joomla updates with TUF
The Joomla! Project takes security vulnerabilities seriously. As such, the Joomla! Security Strike Team (JSST) monitors the project's security issues and follows a set of specific procedures in addressing them.
Sometimes critical issues come to light and are then resolved by this team. For example, this happened with this release of Joomla 4.2.8. Within hours of releasing this version, the team saw attacks on websites that had not been updated.
The problem is that you have to manually install a new Joomla version and not everyone is aware of this. Of course, I provide these updates for all customers with a maintenance subscription. They don't have to worry, but if you don't maintain your website properly, so you run a significant risk. It would be nice if the Joomla! Security Strike Team could update a release Joomla automatically so that all websites are secured immediately.
Before we can think of automatic updates, we must first ensure that the update system is secure and 100% reliable. With the release of Joomla 5.1, The Update Framework (TUF) is an important milestone in ensuring the integrity and security of Joomla installations worldwide.
TUF uses a range of cryptographic techniques such as digital signatures, metadata verification and role-based access control to establish a secure and transparent update process. By incorporating these techniques, TUF significantly reduces the attack surface and improves the overall security posture of software update mechanisms. A super important feature that you probably won't notice at all ;)
Welcome to Joomla tour
Since Joomla 4.3 it is possible to view different tours.
From now on, when you install a new Joomla version you will get to see a "Welcome to Joomla!" tour. This tour gives in 6 steps a quick overview of how to start with Joomla! Handy for new users! Although at this time it is not yet the case that a new user automatically gets to see this tour.
Improved dark mode
In Joomla 5.0 the dark mode of the admin area was introduced. From the display I personally was not a fan. It did not look very nice in my eyes. But that will change with the release of Joomla 5.1. There is a big battle with this view.
Just a comparison:
This is what it looked like in Joomla 5.0
In Joomla 5.1 this is:
Choose your own light or dark mode
The dark mode in Joomla 5.0 automatically adapted to your device or browser settings. It was not possible within Joomla itself to choose light or dark mode. In Joomla 5.1, this option is added and in several places.
1) In the user menu comes an additional option to switch modes. This choice is stored in your browser's cookies.
2) You can also save this choice to a user, so this setting will be copied to different browsers. However, this option will be overridden if you choose a different mode than your default via the above method.
3) You can also make this choice in the template itself via: System > Manage template styles > Color settings, then these options apply to all users unless they make a different choice in their profile or in the user menu.
New SEO options in Joomla 5.1
Strict handling of index.php
This option can be found in the "System - SEF" plugin.
Ever since the beginning of Joomla, we know the option "Use URL rewrite" in the general settings. This option allows you to reach a page even without index.php, for example: website.co.uk/index.php/blog then becomes website.co.uk/blog. However, the page with index.php can still be accessed. This officially creates duplicate content according to Google.
This new option enables stricter treatment of 'index.php' in URLs when 'Use URL rewriting' is enabled in the general settings. It will remove 'index.php' if a URL still contains it and redirect incoming requests with 'index.php' to the version without the 'index.php'.
By default, this option is off (on both updates and new installations). It is recommended that this option be turned on.
Back-slash for URLs.
This option can be found in the "System - SEF" plugin.
Force Joomla to use only URLs with or without Back-slash. If enabled, this will force the correct URL with redirects and be applied only when "add suffix to URL" is disabled.
If you have a website with this URL structure: website.com/blog/ then the last slash will be removed if you choose this option and you will get website.com/blog . I personally encounter this with websites that have migrated from WordPress to Joomla, for example.
Notification in the general configuration
To alert users to these options a new notification has been added to the general configuration (SEO options) where a reference is made to the "system - SEF plugin".
New shortcuts
To quickly move from one screen to another, new buttons have been added on various pages.
At manage extensions you will now find a button to go to extension updates.
In extension updates you will now find a button to go to extension management.
In language management a button has been added to install languages.
In installing languages, a button has been added with a link to content languages.
New options in the tours
- Add support for checkbox/radio/selection target element for interactive field types
- Add support for textarea target element in addition to input text type targets
- Allow fields that are not 'required' in the DOM to be required in the field e.g. for tours related to search where the input field is required by the tours but not by Joomla or the active page component
- Allow the tour to insist on a specific required value (translatable) so that the context of the tours can be maintained as it progresses e.g. search for a specific text value.
Adjustments in the Accessibility Checker.
Some adjustments have been made in this plugin. For example, it no longer uses a special Joomla version, but the standard sa11y package. This also offers more options that you can set in the plugin.
List field customization
The list custom field is extended with a header. This text is used to select no value.
New API capabilities.
In the API, it is now possible to filter by a query.
{{base_path}}/api/index.php/v1/tags?filter[search]=text
{{base_path}}/api/index.php/v1/content/categories?filter[search]=text
New CLI capabilities
New commands are available for those using Joomla's Command Line Interface (CLI).
Updating the Joomla database structure via CLI
Through the command: php cli/joomla.php maintenance:database
Joomla extension update control via CLI
Via the command: php cli/joomla.php update:extensions:check
Manage Joomla core update channel via CLI
e.g. change the update channel to Joomla next via the command: php cli/joomla.php core:update:channel next
Time zone Fancy select field
The field to select the time zone in the general configuration, is now a "fancy select field". The advantage of this is that it has a search function that allows you to find the correct time zone faster.
Moving subforms via up/down arrows
Subforms can be moved by drag and drop. Now 2 arrows have been added so you can also move the subform fields to a different position with a click.
Add new article via blog view
In the blog view of Joomla 5.1 now appears a button to add a new article (obviously only if you have the rights through the frontend of the website to add an article to this category)
Article schema.org plugin
A new plugin has been added that supports basic content options.
General schema.org plugin
In Joomla 5.0, the schema.org tab has been introduced. Now a general field is also added on this page.
This allows you to create a custom schema.org JSON-LD.
Form validation with regex.
The base class for Form validation rules has implemented validation with regular expression, but no way to enter a regular expression through the form definition. You have to build your own validation rule class, register it in Joomla and then use it. That seems too complex for this purpose, so Joomla 5.1 adds a rule to add regular expression validation.
For your field, add validate="regex" to your form definition and regular expression via validate_regex="". The value of the field is then validated server-side using the specified regex. You must be careful to properly escape the regex when adding it to the validate_regex attribute.
for example:validate="regex"
validate_regex="^([A-Za-z0-9_-]+:)?[A-Za-z0-9-][A-Za-z0-9\.-]*$"
SVG images in mod_banners
In the ad module it is now also possible to show SVG images.
Images in com_mails
When sending html mails created with com_mails it is possible to add images.
The function convertRelativeToAbsoluteUrls ensures that the images have absolute references so that they are loaded into the email. However, if the image is added to the e-mail using the media manager, loading="lazy" and data-path= are stripped.
<img src="/images/9.webp" width="1141" height="720" loading="lazy" data-path="local-images:/9.webp">
is converted to:
<img src="https://www.website.nl/images/9.webp" width="1141" height="720">
Rebuilding in Tags
If an issue has arisen with invalid lft and rgt values in the tags table, you can now easily fix it using the "rebuild" button on the tags page.
Code modifications
- All modules have been converted to the new "service provider" codestyle.
- The banner module now uses JLayout joomla.html.image instead of a hard-coded image.
- The assocciations component now consists only of vanilla JS and no longer needs JQuery.
- Added <main> element to the error.php page.
- New modal dialog in several places.
Miscellaneous Updates
- FontAwesome has been updated to version 6.5.1
- TinyMCE has been updated to version 6.8.3(changelog)
Want to know more?
Wondering if I'm the right partner for your project? Then take a look at my portfolio, see what my clients say or contact me directly.
About Jeroen
I have been working with the Joomla! CMS since 2006. Besides building and maintaining Joomla! websites and webshops, I am also familiar with search engine optimization (SEO), Joomla hosting and developing templates and extensions. Furthermore, I am a frequent visitor and speaker at JoomlaDays and various Joomla user groups.
I am committed to the Joomla! community as a member of the Extensions Directory team and the organization of Joomla user group Breda and JoomlaDagen Netherlands. In short: Are you looking for a Joomla Specialist, you should contact me!
