XF 2.2 Missing field 'itemListElement'

AbuGhaith

Well-known member
I tested my home page web site in https://search.google.com/test/rich-results, I get: "Page not eligible for rich results known by this test"

All is right for The Threads

after I tested the PAGE_CONTAINER I get This: "Missing field 'itemListElement"



Code:
<ul class="p-breadcrumbs {{ $variant ? 'p-breadcrumbs--' . $variant : '' }}"
            itemscope itemtype="https://schema.org/BreadcrumbList">
        <xf:contentcheck>
            <xf:set var="$position" value="{{ 0 }}" />

            <xf:set var="$rootBreadcrumb" value="{$navTree.{$xf.options.rootBreadcrumb}}" />
            <xf:if is="$rootBreadcrumb AND $rootBreadcrumb.href != $xf.uri AND $rootBreadcrumb.href != $xf.fullUri">
                <xf:set var="$position" value="{{ $position + 1 }}" />
                <xf:macro name="crumb"
                    arg-position="{$position}"
                    arg-href="{$rootBreadcrumb.href}"
                    arg-value="{$rootBreadcrumb.title}" />
            </xf:macro></xf:set></xf:if>

            <xf:if is="$selectedNavEntry AND $selectedNavEntry.href AND $selectedNavEntry.href != $xf.uri AND $selectedNavEntry.href != $xf.fullUri AND $selectedNavEntry.href != $rootBreadcrumb.href">
                <xf:set var="$position" value="{{ $position + 1 }}" />
                <xf:macro name="crumb"
                    arg-position="{$position}"
                    arg-href="{$selectedNavEntry.href}"
                    arg-value="{$selectedNavEntry.title}" />
            </xf:macro></xf:set></xf:if>
            <xf:foreach loop="$breadcrumbs" value="$breadcrumb" if="$breadcrumb.href != $xf.uri AND $breadcrumb.href != $xf.fullUri">
                <xf:set var="$position" value="{{ $position + 1 }}" />
                <xf:macro name="crumb"
                    arg-position="{$position}"
                    arg-href="{$breadcrumb.href}"
                    arg-value="{$breadcrumb.value}" />
            </xf:macro></xf:set></xf:foreach>

        </xf:set></xf:set></xf:contentcheck>
        </ul>
 
Too me, same problem here.
Search console says that in the breadcrumb of each user page (example: www.xenforo.com/members/Bobmarley.15541) is mmissing the Itemlistelement, showing me this part of the code:

Code:
<div class="p-page-header-inner flex f-v-stretch">

<ul class="p-breadcrumbs p-breadcrumbs--pageHeader block-container p-breadcrumbs--xf1 with-icon hide-label" itemscope itemtype="https://schema.org/BreadcrumbList">


</ul>
 
Last edited:
Any help please

I don't know if this can help but try it

In PAGE_CONTAINER Search

HTML:
<ul class="p-breadcrumbs "
            itemscope itemtype="https://schema.org/BreadcrumbList">

Add After

HTML:
    <li itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
        <a href="https://site.com/" itemprop="item">
            <span itemprop="name">Home</span>
        </a>
        <meta itemprop="position" content="1" />
    </li>

P.N: Change The name Site To yours
 
Last edited:
Yes Brogan, so it must be an issue of my theme.

Abu many thanks for your suggestion.

The code I have there is a bit different is wrote like this:

Code:
<xf:if contentcheck="true">
        <ul class="p-breadcrumbs {{ $variant ? 'p-breadcrumbs--' . $variant : '' }}{{ property('nlUseXF1Breadcrumb') ? ' block-container p-breadcrumbs--xf1' : '' }}{{ property('nlBreadcrumbHomeIcon') ? ' with-icon' : ''}}{{ property('nlBreadcrumbHideHomeLabel') ? ' hide-label' : ''}}"
            itemscope itemtype="https://schema.org/BreadcrumbList">
        <xf:contentcheck>
 
But more down I have also this, more similar to your suggestion

Code:
<xf:macro name="crumb" arg-href="!" arg-value="!" arg-position="{{ 0 }}">
    <li itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
        <a href="{$href}" itemprop="item">
            <span itemprop="name">{$value}</span>
        </a>
        <xf:if is="$position"><meta itemprop="position" content="{$position}" /></xf:if>
        <xf:if is="property('nlUseXF1Breadcrumb') == true">
            <span class="arrow"><span></span></span>
        </xf:if>
    </li>
</xf:macro>
 
Yes Brogan, so it must be an issue of my theme.

Abu many thanks for your suggestion.

The code I have there is a bit different is wrote like this:

Code:
<xf:if contentcheck="true">
        <ul class="p-breadcrumbs {{ $variant ? 'p-breadcrumbs--' . $variant : '' }}{{ property('nlUseXF1Breadcrumb') ? ' block-container p-breadcrumbs--xf1' : '' }}{{ property('nlBreadcrumbHomeIcon') ? ' with-icon' : ''}}{{ property('nlBreadcrumbHideHomeLabel') ? ' hide-label' : ''}}"
            itemscope itemtype="https://schema.org/BreadcrumbList">
        <xf:contentcheck>
Try it for this one
don't forget to take a copy
 
First of all really thanks for your help. Really appreciated.
Then I have tested as you told me and the breadcrumb was been found, but it ruin a bit the upside of the pages of the threads, so by testing I have tried this code and seems to works on the threads and for the bredcrumb, but I don't know if it is wrote good because I don't know the code.
Is good like this?

Code:
<xf:macro name="breadcrumbs" arg-breadcrumbs="!" arg-navTree="!" arg-selectedNavEntry="{{ null }}" arg-variant="">
    <xf:if contentcheck="true">
        <ul class="p-breadcrumbs {{ $variant ? 'p-breadcrumbs--' . $variant : '' }}{{ property('nlUseXF1Breadcrumb') ? ' block-container p-breadcrumbs--xf1' : '' }}{{ property('nlBreadcrumbHomeIcon') ? ' with-icon' : ''}}{{ property('nlBreadcrumbHideHomeLabel') ? ' hide-label' : ''}}"
        itemscope itemtype="https://schema.org/BreadcrumbList">
            <li itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
        <a href="https://www.mysite.com/" itemprop="item">
            <span itemprop="name">Home</span>
        </a>
 
Great Abu, many thanks again.

Yes too me I hope, because I don't want make damages seeing that I don't know the code. I make changes by suggestions and testing.
Now I have correct it in this way because there where wrote 2 times
Code:
itemscope itemtype


So I have tested in this way and seems to works but I hope some one expert can confirm it

Code:
<xf:if contentcheck="true">
        <ul class="p-breadcrumbs {{ $variant ? 'p-breadcrumbs--' . $variant : '' }}{{ property('nlUseXF1Breadcrumb') ? ' block-container p-breadcrumbs--xf1' : '' }}{{ property('nlBreadcrumbHomeIcon') ? ' with-icon' : ''}}{{ property('nlBreadcrumbHideHomeLabel') ? ' hide-label' : ''}}">
            <li itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
        <a href="https://www.mysite.com/" itemprop="item">
            <span itemprop="name">Home</span>
        </a>
 
Top Bottom