Our Joomla! extensions are all OpenSource and free of charge. Support is also free of charge. Nevertheless, we do have costs that need to be paid. This is done out of our own pocket. We have had a donation button on our website for some time now, which is actually used to make donations from time to time. The donation progress bar is intended to show how much support we have received and how much is still missing to cover the basic costs, such as hosting and services. The annual costs currently amount to 356€.

Thank you for your support!

Donate PayPal GitHub Sponsors You want to support and there is no suitable platform? Write to us in the forum.

93,33€

Duplicate entries for categories with parent categories in Joomla 4

5 months 3 days ago #477 by Sven Schultschik
there is a release candidate available for testing extensions.schultschik.com/schuweb-sitem...eb-sitemap-5-0-0-rc2

Hint: The XML URLs have changed and the XML need to be generated in the backend.
The following user(s) said Thank You: LUCiD

Please Log in or Create an account to join the conversation.

5 months 10 minutes ago - 4 months 4 weeks ago #480 by LUCiD
Hi Sven,
thanks vor the RC, but there is only a RC1 for the main component - is this a typo?
And the plugin for the cronjob (Joomla Task Scheduler[1]) is still missing, if I looked correctly in the package (without it, it can only be used to a limited extent).
Edit: I just saw that it, the Joomla task, was listed as a known issue.

Anyway. I've downloaded this RC just now, but I don't have much time at the moment. I will try to test it in the next few days and then report back.

Cya then.

[1] docs.joomla.org/Help4.x:Scheduled_Tasks

Please Log in or Create an account to join the conversation.

4 months 3 weeks ago - 4 months 3 weeks ago #482 by LUCiD
Hi Sven.

I have now tested RC1 and I think everything is working as it should.
This means that I have only tested the included content plugin with the corresponding HTML and XML sitemap and the XML sitemap for the images. I have not tested the sitemap for the news, as I neither use nor need news.google.com.
What is still missing in the XML outputs is the CSS respectively the button for "Beautify XML", but I think it will be available later when the edit function is added. It is not important for the search engines, but it also improves the readability of the XML output if you want to check it, for example.

The two options "Remove duplicate" and "Remove duplicate menu" also work, whereby direct article links in other menus (e.g. selected articles) no longer appear if you activate "Remove duplicate", but this is expected behavior and, as already mentioned, acceptable as the articles are already contained in the categories.
I have now also found the cause of the duplicate entries, which does not appear at all in Joomla 3. Here the behavior of Joomla 4 differs from Joomla 3. If one can take this into account, then there will be no duplicates for the subcategories - so now the cause and the possible solution.

At the menu links to the root categories of the type "Category Blog" and "Category List" there is the option "Subcategory Levels" in the 2nd tab with the name "Category" (can also be set globally), which is already activated in a fresh Joomla 4 installation with the test data. This means that on this category page links to the sub-categories are added at the bottom (also with "Subcategories Heading" and "Subcategories Descriptions" if set to show), depending on the depth you set there more or less sub-categories, if you also have several sub-levels in the article categories. In opposite to Joomla 3, this setting creates the duplicates in the sitemap. If you set this option of the "Subcategory Level" to "None" respectively switch it off, or have no subcategories at all, no duplicates will appear in the sitemap and you do not have to use the options for removing duplicates within the sitemap settings.
But if you have sub-categories and also need these sub-level display / links on the respective pages, then you can and have to use this new and additional options in the sitemap settings to avoid and filter out duplicates in the sitemap entries.
As already mentioned, this behavior is new in Joomla 4. In Joomla 3, this setting of the "subcategory level" does not affect the output of the sitemap and there are no duplicates as a result.

Conclusion:
The additional programming work to prevent duplicates was therefore not unnecessary, as one might now assume, since the setting not to display sub-levels does not create any duplicates. But if you need these sub-category display / links, for whatever reason, you may also need the additional options in the sitemap settings to prevent the duplicates it then created.

Good work Sven and thanks for this additional flexibility of customization in Joomla - with the upcoming Task Scheduler plugin, this will be, as far as I can say, the best free sitemap extension for Joomla 4+!

Greets and all the best!

Oh, BTW: The HTML page title is also not yet set and the switch for the backlink does not (yet) work either.
The following user(s) said Thank You: Sven Schultschik

Please Log in or Create an account to join the conversation.

4 months 2 weeks ago #487 by Sven Schultschik

Hi Sven.

I have now tested RC1 and I think everything is working as it should.
This means that I have only tested the included content plugin with the corresponding HTML and XML sitemap and the XML sitemap for the images. I have not tested the sitemap for the news, as I neither use nor need news.google.com.
What is still missing in the XML outputs is the CSS respectively the button for "Beautify XML", but I think it will be available later when the edit function is added. It is not important for the search engines, but it also improves the readability of the XML output if you want to check it, for example.
 
I would like to review some independent Browser Plugins or Open Source Tools to view XML and write some recommendations. This would lower development effort and I try to don't invent the wheel again, if other tools or extensions can do the displaying better than I can beautify it.

The two options "Remove duplicate" and "Remove duplicate menu" also work, whereby direct article links in other menus (e.g. selected articles) no longer appear if you activate "Remove duplicate", but this is expected behavior and, as already mentioned, acceptable as the articles are already contained in the categories.
I have now also found the cause of the duplicate entries, which does not appear at all in Joomla 3. Here the behavior of Joomla 4 differs from Joomla 3. If one can take this into account, then there will be no duplicates for the subcategories - so now the cause and the possible solution.

At the menu links to the root categories of the type "Category Blog" and "Category List" there is the option "Subcategory Levels" in the 2nd tab with the name "Category" (can also be set globally), which is already activated in a fresh Joomla 4 installation with the test data. This means that on this category page links to the sub-categories are added at the bottom (also with "Subcategories Heading" and "Subcategories Descriptions" if set to show), depending on the depth you set there more or less sub-categories, if you also have several sub-levels in the article categories. In opposite to Joomla 3, this setting creates the duplicates in the sitemap. If you set this option of the "Subcategory Level" to "None" respectively switch it off, or have no subcategories at all, no duplicates will appear in the sitemap and you do not have to use the options for removing duplicates within the sitemap settings.
But if you have sub-categories and also need these sub-level display / links on the respective pages, then you can and have to use this new and additional options in the sitemap settings to avoid and filter out duplicates in the sitemap entries.
As already mentioned, this behavior is new in Joomla 4. In Joomla 3, this setting of the "subcategory level" does not affect the output of the sitemap and there are no duplicates as a result.

Yeah that was the reason why I tough that it need a break here. Rewrite it the code base and be J4 native and look what customers want nowadays. Happy that it works now for you.

Conclusion:
The additional programming work to prevent duplicates was therefore not unnecessary, as one might now assume, since the setting not to display sub-levels does not create any duplicates. But if you need these sub-category display / links, for whatever reason, you may also need the additional options in the sitemap settings to prevent the duplicates it then created.

Yes, there are so many possibilities to do things. Instead of over engineering things I hope that customers write me their use cases, so I can think about concrete use cases and how to solve them.

Good work Sven and thanks for this additional flexibility of customization in Joomla - with the upcoming Task Scheduler plugin, this will be, as far as I can say, the best free sitemap extension for Joomla 4+!

That's my goal. Make SchuWeb Sitemap GREAT AGAIN :D

Greets and all the best!

Oh, BTW: The HTML page title is also not yet set and the switch for the backlink does not (yet) work either.

Thank you I took those two into issue list to check.

Please Log in or Create an account to join the conversation.

4 months 2 weeks ago - 4 months 2 weeks ago #488 by LUCiD
Hi Sven.

I would like to review some independent Browser Plugins or Open Source Tools to view XML and write some recommendations. This would lower development effort and I try to don't invent the wheel again, if other tools or extensions can do the displaying better than I can beautify it.
You don't have to invent the wheel again, cause it is already done for you in your old (xmap fork) component.

I'll give you an example on your own sitemap here with the editor Notepad++ and the xml tools plugin (on Windows). How to do this online without the Editor see below in the paragraph about the tools.

1. Download Notepad++ , if you don't have it yet and install it.
2. Open Notepad++ and open the "Plugins Admin" via the Menu "Plugins/Plugins Admin".
3. In the first tab "Available" type "XML Tools" (github.com/morbac/xmltools) in the Search box, select it in the list and click install at the top right - restart Notepad++.
4. Open your xml sitemap with the browser and save it to your desktop (or elsewhere) as sitemap.xml
5. Open this saved sitemap.xml wit Notepad++.
6. Have a look at the second line with the XSL entry (this is the xml-stylesheet to transform the xml into xhtml):
<?xml-stylesheet type="text/xsl" href="https://extensions.schultschik.com/index.php?option=com_schuweb_sitemap&amp;view=xml&amp;layout=xsl&amp;tmpl=component&amp;id=1&amp;filter_showtitle=0&amp;filter_showexcluded=0"?>
7. Open this href entry with your browser and then save the output near your sitemap.xml at the desktop (or elsewhere) as sitemap.xsl (or sitemap.txt and change the filename extension afterwards from .txt to .xsl).
8. Go back to Notepad++ with your sitemap.xml file opened and choose from Menu "Plugins/XML Tools/XSL Transformation"
9. In the "XML Transformation" popup select at the top your saved sitemap.xsl file and click Transform at the bottom right - it generates a new HTML output in the Editor.
10. Close the "XML Transform" popup and save the new generated HTML output to your desktop (or elsewhere) as sitemap.html (not .xhtml, cause then it will not be valid - the rules for xhtml are to strict).
11. open this sitemap.html file with your browser - voila!

You see, it is all done for you already on the fly by your browser with XSLT.
So, have a look at your sitemap component 4.0 at "/components/com_schuweb_sitemap/views/xml/tmpl/default_xsl.php". This is where the XSL(T) template is created (and you may only have to adapt it a little to the native code of joomla 4). XSLT  is a language originally designed for transforming XML documents into other documents, e.g. XML, (X)HTML etc.

About the tools you mentioned to display XML more human friendly readable.
I had already referred to the Notepad++ editor with the XML Tools plugin, but you can also do this more easily online, without the editor, e.g. here:  freeformatter.com/xsl-transformer.html  - there you can C&P the XML and XLS output, or load the files you created, as I described above.
Another good FOSS Tool for viewing and editing XML is here:  github.com/microsoft/XmlNotepad  also with an inplace HTML viewer for the translation / processing of xml-stilesheets instructions.
And here is another free tool for the more advanced user as e.g. developers:  www.liquid-technologies.com/liquid-community-edition - the free trial works as the free community edition after the 15 trial days.

There are even more free tools for this task. Just enter "Best Free XML Editors" in the search engine of your choice if you want to try out more. Transforming XML (or JSON), e.g. when offering web services, can be quite complex, and suitable tools can be very helpful. If you use a special development environment, then there are certainly suitable tools or plugins for this.

For only viewing a XML sitemap more human friendly readable in your browser, without to have an own xml-stilesheet (XSLT), maybe this browser addon will suit your needs: Sitemap Explorer addon for all major browsers (but not for Safari). But it seems that this addon only works with sitemaps declared in the robots.txt file (or maybe also with sitemaps in the default path, the root of a website), maybe there is another browser addon solution, where the user also can manually input an URL to a sitemap as an alternative method to the automatic detection.
But if you want to make sure that search engine crawlers can find an XML sitemap without specifying it in the webmaster accounts as they do with Google, then it is essential to declare it in the robots.txt file anyway, store the sitemap in the default path and / or to route rewrite the real URL to the default path using web server directives ( with e.g. Apache mod_rewrite directives in the root .htaccess file).

Have a nice one! q:D
The following user(s) said Thank You: Sven Schultschik

Please Log in or Create an account to join the conversation.

4 months 1 hour ago #490 by Sven Schultschik
Version 5.0.0 is released. But not as automated update, because of the XML generation B/C breaking change.
The following user(s) said Thank You: LUCiD

Please Log in or Create an account to join the conversation.

Time to create page: 0.161 seconds
Powered by Kunena Forum