Skip to content
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

Google showing the homepage link twice #1561

Closed
ghost opened this issue Jun 13, 2018 · 5 comments
Closed

Google showing the homepage link twice #1561

ghost opened this issue Jun 13, 2018 · 5 comments
Assignees
Labels
Milestone

Comments

@ghost
Copy link

ghost commented Jun 13, 2018

Comment by @CMSworker
June 11th, 2018, 21:56 GMT

Did somebody test this successfully in an active live installation?

In my case it didn't solve the problem of Google showing the homepage link twice. Still looking like this:

https://www.domain.de > Homepage > Subpage

instead of

https://www.domain.de > Subpage

I thougt the problem could possibly be the wrong id of the webpage, when the breadcrumbs are now a microdata child element of the whole page.

Like in your screenshot, right side, 2. line:

@id: https://.../top

The id "top" is set in line 28 in fe_page.html5 together with itemtype="http://schema.org/WebPage" :

<body id="top" class="...

Because of the anchor id there is a difference in the URL of the webpage element and the URL in the breadcrumb element. So probably machines see this as two different entities/webpages and the breadcrumb and page-id-url will never be identical?

I changed it for testing and added an explizit microdata itemid, so the url of the webpage-element is the same as within the breadcrumb link:

<body id="top" itemid="{{env::path}}{{env::request}}" class="...

Didn't work.

What are your findings?

@leofeyer
Copy link
Member

leofeyer commented Oct 22, 2018

@CMSworker @ausi What's the status of this issue?

@CMSworker
Copy link
Contributor

This issue is Google related and can not be solved, as long as you are ignoring the fields that Google is defining as "required" in their documentation.

So no, currently there is no solution, because fix #1527 is not working for Google (see comment here) and #1421 (or #1429) are already closed without a solution that is interpreted correctly by Google.

@leofeyer
Copy link
Member

leofeyer commented Oct 23, 2018

The following changes in the mod_breadcrumb.html5 template fix the errors in the test tool:

 <?php $this->block('content'); ?>
 
   <ul itemprop="breadcrumb" itemscope itemtype="http://schema.org/BreadcrumbList">
-    <?php foreach ($this->items as $item): ?>
+    <?php foreach ($this->items as $count => $item): ?>
       <?php if ($item['isActive']): ?>
-        <li class="active<?php if ($item['class']): ?> <?= $item['class'] ?><?php endif; ?> last" itemscope itemtype="http://schema.org/ListItem" itemprop="itemListElement"><span itemprop="name"><?= $item['link'] ?></span></li>
+        <li class="active<?php if ($item['class']): ?> <?= $item['class'] ?><?php endif; ?> last"><?= $item['link'] ?></li>
       <?php else: ?>
-        <li<?php if ($item['class']): ?> class="<?= $item['class'] ?>"<?php endif; ?> itemscope itemtype="http://schema.org/ListItem" itemprop="itemListElement"><a href="<?= $item['href'] ?>" title="<?= $item['title'] ?>" itemprop="url"><span itemprop="name"><?= $item['link'] ?></span></a></li>
+        <li<?php if ($item['class']): ?> class="<?= $item['class'] ?>"<?php endif; ?> itemscope itemtype="http://schema.org/ListItem" itemprop="itemListElement"><a href="<?= $item['href'] ?>" title="<?= $item['title'] ?>" itemprop="item"><span itemprop="name"><?= $item['link'] ?></span></a><meta itemprop="position" content="<?= $count + 1 ?>"></li>
       <?php endif; ?>
     <?php endforeach; ?>
   </ul>

@leofeyer leofeyer added the bug label Oct 23, 2018
@leofeyer leofeyer added this to the 4.4.27 milestone Oct 23, 2018
@leofeyer
Copy link
Member

Note that if $item['href'] is empty, we need to output / or ./ to prevent the "field item requires a value" error.

@leofeyer leofeyer self-assigned this Oct 30, 2018
@leofeyer
Copy link
Member

Fixed (hopefully for good) in contao/contao@23f005a.

@leofeyer leofeyer modified the milestones: 4.4.27, 4.4 May 14, 2019
leofeyer added a commit that referenced this issue Mar 26, 2020
Description
-----------

| Q                | A
| -----------------| ---
| Fixed issues     | Fixes #1271
| Docs PR or issue | -

Commits
-------

ec281b0e Show "-" instead of "0" if no related record can be loaded
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants