google complains about my cmsms breadcrumb schema

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Locked
maehschaf
New Member
New Member
Posts: 9
Joined: Fri Jan 27, 2017 2:53 pm

google complains about my cmsms breadcrumb schema

Post 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
User avatar
DIGI3
Dev Team Member
Dev Team Member
Posts: 1627
Joined: Wed Feb 25, 2009 4:25 am
Location: Victoria, BC

Re: google complains about my cmsms breadcrumb schema

Post 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>
Not getting the answer you need? CMSMS support options
maehschaf
New Member
New Member
Posts: 9
Joined: Fri Jan 27, 2017 2:53 pm

Re: google complains about my cmsms breadcrumb schema [solve

Post 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
maehschaf
New Member
New Member
Posts: 9
Joined: Fri Jan 27, 2017 2:53 pm

Re: google complains about my cmsms breadcrumb schema [solve

Post 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>
Locked

Return to “CMSMS Core”