Page 1 of 1

google complains about my cmsms breadcrumb schema

Posted: Sun Jan 26, 2020 10:31 am
by maehschaf
Dear experts,

first of all: thank You for the great software!!!

I got email from google search console. They complain about the (in their words) deprecated breadcrumb schema used by cmsms. As I think it is a bad idea to argue with a web-crawling roboter, I want to make this machine happy.

In the source code of my web pages I find the schema "http://data-vocabulary.org/Breadcrumb". I found out that it is possible to specify a diferent template for Navigator's breadcrumb generation, so I tried to change the breadcrumb template. But as I am a real bad programmer I clearly failedn to generate something like this (example code from schema.org):

Code: Select all

    <ol vocab="http://schema.org/" typeof="BreadcrumbList">
      <li property="itemListElement" typeof="ListItem">
        <a property="item" typeof="WebPage" href="https://example.com/dresses">
         <span property="name">Dresses</span></a>
         <meta property="position" content="1">
      </li>
      <li property="itemListElement" typeof="ListItem">
        <a property="item" typeof="WebPage" href="https://example.com/dresses/real">
        <span property="name">Real Dresses</span></a>
        <meta property="position" content="2">
      </li>
    </ol>
Now my idea is: I am sure I am neither the firs person nor the only having this issue.

Is there a good (or at least better) programmer out there willing to share his code?

Thank You in advance!

Martin

Re: google complains about my cmsms breadcrumb schema

Posted: Sun Jan 26, 2020 4:25 pm
by DIGI3
Something like this?

Code: Select all

<ol vocab="http://schema.org/" typeof="BreadcrumbList">
  {foreach $nodelist as $node}
    <li property="itemListElement" typeof="ListItem">
      <a property="item" typeof="WebPage" href="{$node->url}">
        <span property="name">{$node->menutext}</span>
      </a>
      <meta property="position" content="{$node@iteration}">
    </li>
  {/foreach}
</ol>

Re: google complains about my cmsms breadcrumb schema [solve

Posted: Sun Jan 26, 2020 9:13 pm
by maehschaf
Yes, great! Thank You very much! That really helped me! :)

So this is what my "main" template Simplex looks like now:

Code: Select all

<div class='content-top cf' itemscope itemtype='http://schema.org/breadcrumb'>
{Navigator action='breadcrumbs' template='Breadcrumbs_schema_org'}
<span class='title-border' aria-hidden='true'></span>
</div>
And this is what my Breadcrumb_schema_org Template looks like now:

Code: Select all

{* modified breadcrumbs template *}
{strip}
  <div class="breadcrumb" style="display:inline">{if isset($starttext)}{$starttext}:&nbsp;{/if}
    <ol vocab="http://schema.org/" typeof="BreadcrumbList" style="white-space:nowrap;display:inline-block">
      {foreach $nodelist as $node}
        <li property="itemListElement" typeof="ListItem" style="display:inline-block">
          {if ($node@iteration > 1)}&nbsp;>&nbsp;{/if}
          <a property="item" typeof="WebPage" href="{$node->url}"
            <span property="name">{$node->menutext}</span>
          </a>
          <meta property="position" content="{$node@iteration}">
        </li>
      {/foreach}
    </ol>
  </div>
{/strip}
I added some stuff to prevent line returns and make the line more pretty. I should have done that with css maybe, but maybe I will do that later... :)

Have a nice evening & week!
Martin

Re: google complains about my cmsms breadcrumb schema [solve

Posted: Tue Jan 28, 2020 8:27 pm
by maehschaf
Sorry, forgot a closing >

So, this is correct:

Code: Select all

    <ol vocab="http://schema.org/" typeof="BreadcrumbList">
      <li property="itemListElement" typeof="ListItem">
        <a property="item" typeof="WebPage" href="https://example.com/dresses">
         <span property="name">Dresses</span></a>
         <meta property="position" content="1">
      </li>
      <li property="itemListElement" typeof="ListItem">
        <a property="item" typeof="WebPage" href="https://example.com/dresses/real">
        <span property="name">Real Dresses</span></a>
        <meta property="position" content="2">
      </li>
    </ol>