-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix microdata for the last breadcrumb item #26268
Conversation
I have tested this item ✅ successfully on 035c38b This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/26268. |
I have tested this item 🔴 unsuccessfully on 035c38b This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/26268. |
hmm is something not working than expected? |
This fails for multiple reasons.
So what does google say about breadcrumbs?
Which is why most people dont have show last enabled and if you do then you dont expect it to be a link to itself Never rely on automated tools to test something :) |
This is definitely a case where the user should create an override. And even if it is decided to accept this it needs to be applied to beex as well |
Well it is enabled by default. So i think most sites have this option enabled.
Ok got the point so the |
@zero-24 I am confused now what the intention is here now. Can you please update the title and description please as now this isnt adding anything ;) |
Done thanks. |
can you correct that please |
That's valid for Google. ...but looks wrong somehow from my point of view. Couldn't find any reliable source if LINK in BODY is allowed that way. The main problem is that G changes its criterias and things that were valid yesterday aren't valid today... Don't forget to push #25117 ;-) and remove MicroData from Joomla. |
hmm confirmed but it seams the tool is broken there? When I just enter the breadcrumb part of the page it works good but when i paste the complete page it also shows this error here. |
I stick by my original comment that this is something a determined user can fix for themselves in a template override. |
EDIT: the following is wrong, read below. Removing all the itemprop, itemscope and itemtype attributes from the $show_last part would do such a thing and it would be semantically appropriate. At the moment the last item is an itemListElement of https://schema.org/BreadcrumbList, which is wrong, since it is not part of the way back. So the following code would suffice:
-- remove end -- |
I just tested @StefanSTS suggestion and at least it makes google happy |
according to https://developers.google.com/search/docs/data-types/breadcrumb
Interesting is the last line stating: by starting from the last breadcrumb If I understand the PR correctly the last part of the breadcrumb trail is excluded from the list. |
add the top code after 53 & 68 of modules/mod_breadcrumbs/tmpl/default.php This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/26268. |
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/26268. |
just stumbled upon an edge case we have to solve as well. https://www.oeteldonk.org/veur-carnaval/proklemaosie-van-de-peer (Dutch website) |
You can solve it with adding
But you have another error when $item->link is empt y(in case you use separator for eg.) |
None of both codes about the last item worked 100% for me. Is this issue still open? |
I also encountered this issue. While it does seem silly to show the last (the current page) item linked, that is also how the Microdata examples have done it for a very long time. It was also mentioned elsewhere that in menus we do link to the current page (just styling it differently), so in that sense not too different. In an earlier PR for Joomla 4.0 @zwiastunsw made a reasonable argument why having the last item in the breadcrumb as a link, also make sense for accessibility. For my own quick-fix of the Missing field "item" error, I only changed the "Render last item if reqd." section of the breadcrumb template in an override (but we should not expect most users to know how to do this.) So that part I changed to:
I don't know if echo JURI::getInstance()->toString(); is the best way to get the correct link, but it worked for a few different scenarios that I tested it with. One could add an option to the breadcrumb module, to display the last item as a link or not. That would avoid changing old layouts unless they want to change. @hans2103 I don't know how we would deal with your situation. Someone with good accessibility knowledge should perhaps comment if the practice (that I also use) of having some menu items that are not actual links (at all or just # ) will create other issues. |
The information page about breadcrumbs written by Google tells us that the implementation is depending upon the search context. There is a example given where a specific book title is search for and the breadcrumbs include this page. But, they also specify that the last item should be omitted if "the page could be found in a larger set of search result". To me it is unclear what the best solution is, but it also indicates that both could be right and valid. The current implementation is semantically wrong. I am (and probably nobody is) not quite sure about how Google processes semantically incorrect microdata, but it should be fixed for sure. Since the last item never has been a true HTML link <li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
<span itemscope itemtype="http://schema.org/Thing" itemprop="item" itemid="/ul/to/page">
<span itemprop="name">This page</span>
</span>
<meta itemprop="position" content="3" />
</li> Note the |
I have just implemented the suggested changes by @n9iels thanks. |
…readcrumbs_microdata
Haven't tried the latest changes and, therefore, my comments may be inappropriate. See my comments posted at the J! forum a couple of days ago: https://forum.joomla.org/viewtopic.php?f=712&t=974526#p3581156 |
Tested the last-mentioned update to the changed file. While it render's valid microdata (and passes GSC's requirements) it still does not meet my needs as I described at https://forum.joomla.org/viewtopic.php?f=712&t=974526#p3581156 Looks like GSC is being unnecessarily finnicky (?) |
I've tested it and it looks like that the This behaviour is caused by this line, that is writen 9 years ago as far as I can tell 😅 No idea what the intention was.
This could be replaced by the following line: $path = array(array('title' => $this->item->title, 'link' => ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid, $this->item->language))); Not sure if this could have any side effects, in what situation there is no direct link to the article and what will happen on that point. |
@n9iels Where does @sozzled the "issue" that you describe in the forum does not seem to be an issue? Searching for a popular term, all results are more or less the same irrespective of Joomla or another CMS or even if microdata was used or just a div called breadcrumbs. (Google shows the base URL at the start, which makes sense, since the user may want to see where they are going before clicking on the link) |
@JacquesR See this page: https://schema.org/docs/datamodel.html#identifierBg |
Hello, I have made an attempt for showing the last item without a link and still getting the Google Tool happy. I described it here: https://forum.joomla.org/viewtopic.php?f=712&t=974526&p=3581290#p3581290 My approach to just say, the last item is not part of the breadcrumb list was nonsense, the first sentence in the description on schema.org says definitely something different: |
There's some confusion about whether Google is making changes behind-the-scenes as we speak (see https://forum.joomla.org/viewtopic.php?f=712&t=974526&p=3581379#p3581370) and so I'm waiting for things to settle down until we know what we know about GSC and its enforcement of b/crumbs microdata parsing. I'm a bit lost with this. |
I saw that post, but that one error about the @id will not go away. So if anyone would test the default.php in the forum post, it could help. |
Did you also see https://forum.joomla.org/viewtopic.php?f=712&t=974526#p3581373 ? I'm happy enough to test things but, if Google is making changes as we speak, I'm wondering if the exercise is useful? I'm not concerned about "valid microdata". I am concerned that the "last" segment of the b/crumbs doesn't appear on G's SERPs. The 3rd-party extension Krizalys Breadcrumbs (https://extensions.joomla.org/extension/krizalys-breadcrumbs/) took care of that however, GSC now (or, at least a few days ago) doesn't like it. |
The last segment got an @id and a name now. So the SERP's should show the last item. |
The The current situation for me is that for the current core implementation the test fails, and when testing this PR both versions with a empty |
The absolute URI is needed for itemid, because it is not automatically converted to the absolute URI. For the href JUri:: getInstance() could be changed to the relative URI, since there it is resolved against the base URI. |
Great let me know when you get feedback from google on this 👍 |
I just tested the Joomla! Core implementation against the testing tool and it passed. The |
@n9iels Well sounds like google fixed the issue and we can close this issue here? Feel free to re-open when needed. |
Pull Request for Issue https://forum.joomla.de/thread/10185-strukturierte-daten-im-breadcrumbs-modul/ (German)
Summary of Changes
Add missing itemprop item to the last breadcrumb item
https://developers.google.com/search/docs/data-types/breadcrumb
Testing Instructions
show_last
in the breadcrumb moduleExpected result
The google tool is happy
Actual result
The google tool compains that the item is missing.
Documentation Changes Required
none