Skip to content

Commit 5992acb

Browse files
authored
Merge pull request #2 from knash94/patch-1
Add schema data to breadcrumbs
2 parents 6060e20 + 83a5364 commit 5992acb

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

views/bootstrap3.blade.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
@if($container->count() > 0)
2-
<ol class="breadcrumb">
3-
@foreach($container->getCrumbs() as $crumb)
4-
<li @if($crumb->isCurrent()) class="active" @endif >
2+
<ol class="breadcrumb" itemscope itemtype="http://schema.org/BreadcrumbList">
3+
@foreach($container->getCrumbs() as $key=>$crumb)
4+
<li @if($crumb->isCurrent()) class="active" @endif itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
55
@if( ! $crumb->isCurrent() && $crumb->hasUrl())
6-
<a href="{{ $crumb->getUrl() }}">{!! $crumb->hasLabel() ? $crumb->getLabel() : $crumb->getUrl() !!}</a>
6+
<a itemscope itemtype="http://schema.org/Thing"
7+
itemprop="item" href="{{ $crumb->getUrl() }}"><span itemprop="name">{!! $crumb->hasLabel() ? $crumb->getLabel() : $crumb->getUrl() !!}</span></a>
78
@else
8-
{!! $crumb->hasLabel() ? $crumb->getLabel() : $crumb->getUrl() !!}
9+
<span itemprop="name">{!! $crumb->hasLabel() ? $crumb->getLabel() : $crumb->getUrl() !!}</span>
910
@endif
11+
<meta itemprop="position" content="{{ $key + 1 }}" />
1012
</li>
1113
@endforeach
1214
</ol>
13-
@endif
15+
@endif

0 commit comments

Comments
 (0)