Quantcast
Channel: Joomla! Forum - community, help and support
Viewing all articles
Browse latest Browse all 2064

Joomla! 5.x Coding • Re: Behavior-Backward Compatibility plugin unchecked: issue with the Canonical URL SEO

$
0
0
Hello everyone.
I am posting the solution below.
The code suggested by Toivo works with Joomla5 (which runs with PHP minimum 8.1), but to prevent the Canonical TAG from being wrong, the following change needs to be made:

change true to false in this line:

Code:

$customFields = FieldsHelper::getFields('com_content.article', $this->item, true);

Code:

$customFields = FieldsHelper::getFields('com_content.article', $this->item, false);
After the well-deserved thanks to Toivo, who have been very supportive, I have two points to make:
the first is that it is strange that there isn't an updated tutorial for Joomla 4 and 5 that shows the updated code to insert into the override default.php file in order to insert the canonical tag.
The second consideration is that at this point, even for those like me who are trying to completely eliminate or minimize third-party components, it becomes more convenient to install a canonical tag plugin than to continue with overriding.
In fact, even overriding has the same drawbacks as third-party plugins, namely possible incompatibility after an upgrade.

Statistics: Posted by sgiobbio — Wed Apr 10, 2024 4:17 pm



Viewing all articles
Browse latest Browse all 2064

Trending Articles


Dammapeta Mandal Sarpanch Upa-Sarpanch Mobile Numbers List Khammam District...


Sarah Samis, Emil Bove III


ZARIA CUMMINGS


Need radio code for IVECO Delphi Aptiv FJ5 RBT M16


Black Angus Grilled Artichokes


Ed Sheeran – Sapphire – Pre-Single [iTunes Plus M4A]


Sunny Garcia’s Ex-Wife Colleen McCullough


99 God Status for Whatsapp, Facebook


Funeral of Sir Warwick Franklin


MHDD



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>