Related #37679
<script type="application/ld+json">{"@context":"https:\/\/schema.org","@type":"BreadcrumbList","itemListElement":[]}</script>
is created.
See image in opener post of https://forum.joomla.de/thread/16214-google-search-sonsole-zeigt-falscher-werttyp-id-an/?postID=110426#post110426
EDIT 2022-07-06:
Menu Assignment
: On all pages
Home
on Hide
.Last
is Show
or Hide
.https://github.com/GHSVS-de/GHSVSThings/blob/master/relaterquatch/mod_breadcrumbs/default.php#L114
Labels |
Added:
No Code Attached Yet
|
Addition: TBH, I think that my recommended solution is the easiest one and is always correct.
Thanks for the additional context.
I think the real issue is that the home item should be shown in the JSON for correct SEO breadcrumbs regardless of whether it is displayed to the user. (On the homepage as well as sub pages.) Currently, it's only added to the list when the parameter in the module is enabled, which made sense when the module was for users only. Now that the module also adds structured data it is incorrect.
This goes deeper into the module helper than I feel comfortable editing. @roland-d I think at this point any changes would go into 4.2, right? Who would be the best person to take a look here?
Deleted by author because wrong.
@crystalenka These changes can still go into 4.2 as they would be a bugfix.
Honestly, I have no idea who would be the right person to look at this.
There are more issues with ld+json. E.g. the position is calculated wrongly if there are menu headlines in the pathway.
Even if I think that it's wrong to build ld+json in a module I have written some times ago a custom mod_breadcrumbs based upon the core module.
My question before I provide a pr: If I would add an additional module setting like "Add structured data (ld+json)" is that possible for Joomla 4.2 or would that block the pr until Joomla version 8.7.0 or so ;-) ... because I hate it to have open prs over months ;-)
I am sorry that I have to withdraw my offer to create a PR. I can't cope with the new Joomla code style hell in my editor and don't want to break its configuration or type and count hundreds of spaces at the moment.
This would have been my pr (based upon J4.1.5). If you or somebody else want to take over just feel free to do so.
It's B\C as far as I see. I've tested it on some "living" sites.
Further commits are just cosmetic https://github.com/GHSVS-de/mod_breadcrumbsghsvs/commits/main
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2022-07-16 13:27:31 |
Closed_By | ⇒ | ReLater |
Thanks for the tag.
I'm having trouble understanding the conditions under which this bug happens. The breadcrumbs should always generate at least the current page in the JSON, even if "show current item" is disabled in the module because the JSON does not display to the user.
Could you please elaborate the steps to reproduce the issue so I can take a closer look? Under what circumstances exactly does the issue occur? I'm afraid I don't speak German and Google Translate was not particularly helpful reading the thread you linked.
For the record, my "making google happy again" PR was just about header items that don't have links; I'm not the original code owner here so I'm making educated guesses about the JSON. We may need to loop in someone else who has deeper knowledge of the module's inner workings because this may be a different sort of bug.