
What's new in Joomla 5.1?
On 16 April 2024, Joomla 5.1 was released. If you have a website running Joomla version 4.x or 5.x, then you can update your Joomla website with the click of a button.
This release brings many small (code) improvements and a number of options and features will be 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 number 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 take care of these updates for all customers with a maintenance subscription. They don't need to worry, but if you don't maintain your website properly, you therefore run a considerable risk. It would be great if the Joomla! Security Strike Team could update a release Joomla automatically so that all websites are immediately secured.
Before we can think about automatic updates, we need to make sure the update system is secure and 100% reliable. With the release of Joomla 5.1, The Update Framework (TUF) marks 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 has been 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. In 6 steps, this tour gives a quick overview of how to get started with Joomla! Handy for new users! Although, at the moment, a new user will not see this tour automatically.

Improved dark mode
In Joomla 5.0, the dark mode of the admin area was introduced. I personally wasn't a fan of the display. It didn't look very nice in my eyes. But that will change with the release of Joomla 5.1. There is a big hit 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 saved in your browser's cookies.

2) You can also save this choice to a user, this way this setting is carried over in different browsers. However, this option will be overridden if you choose a different mode than your default choice via the above method.

3) You can also make this choice on the template itself via: System > Manage template styles > Colour 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 plugin "System - SEF".

Ever since the beginning of Joomla, we have known the "Use URL rewrite" option 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 then 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 to turn this option 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.nl/blog/ then the last slash will be removed if you choose this option and you will get website.nl/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 has been made to the "system - SEF plugin".
New shortcuts
To quickly move from one screen to another, new buttons have been added on various pages.
In 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 'mandatory' in the DOM to be mandatory in the field e.g. for tours related to search where the input field is mandatory for 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 instance, 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 customisation
The list custom field is extended with a header. This text is used to select no value.

New API capabilities
The API now allows filtering by search.
{{base_path}}/api/index.php/v1/tags?filter[search]=text
{{base_path}}/api/index.php/v1/content/categories?filter[search]=text
New CLI features
New commands are available for those using Joomla's Command Line Interface (CLI).
Updating the Joomla database structure via CLI
Via 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 right 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
A button to add a new article now appears in the blog view of Joomla 5.1 (obviously only if you have the rights to add an article to this category via the frontend of the website)

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 via 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 should make sure 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 e-mail. However, if the image is added to the email 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)
Joomla continues to evolve, but are you getting the most out of your website?

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!
Nederlands
English