Skip to content
This repository has been archived by the owner on Oct 18, 2020. It is now read-only.

added Bootstrap 3 with schema.org Microdata view #124

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/start.rst
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ Then open ``config/breadcrumbs.php`` and edit this line:
The possible values are:

- `Bootstrap 3 <http://getbootstrap.com/components/#breadcrumbs>`_: ``breadcrumbs::bootstrap3``
- `Bootstrap 3 with Microdata tags <http://schema.org/docs/gs.html>`_: ``breadcrumbs::bootstrap3-microdata``
- `Bootstrap 2 <http://getbootstrap.com/2.3.2/components.html#breadcrumbs>`_: ``breadcrumbs::bootstrap2``
- The path to a custom view: e.g. ``_partials/breadcrumbs``

Expand Down
6 changes: 6 additions & 0 deletions tests/fixtures/bootstrap3-microdata.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<ol itemscope="itemscope" itemtype="http://schema.org/BreadcrumbList" class="breadcrumb">
<li itemprop="itemListElement" itemscope="itemscope" itemtype="http://schema.org/ListItem"><a itemprop="item" href="/">Home</a></li>
<li itemprop="itemListElement" itemscope="itemscope" itemtype="http://schema.org/ListItem" class="active">Not a link</li>
<li itemprop="itemListElement" itemscope="itemscope" itemtype="http://schema.org/ListItem"><a itemprop="item" href="/blog">Blog &amp; &lt; &gt;</a></li>
<li itemprop="itemListElement" itemscope="itemscope" itemtype="http://schema.org/ListItem" class="active">Sample Post</li>
</ol>
6 changes: 6 additions & 0 deletions tests/unit/ViewTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,10 @@ public function testBootstrap3()
$this->assertXmlStringEqualsXmlFile(__DIR__ . '/../fixtures/bootstrap3.html', $html);
}

public function testBootstrap3Microdata()
{
$html = $this->view->render('breadcrumbs::bootstrap3-microdata', $this->breadcrumbs);
$this->assertXmlStringEqualsXmlFile(__DIR__ . '/../fixtures/bootstrap3-microdata.html', $html);
}

}
11 changes: 11 additions & 0 deletions views/bootstrap3-microdata.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
@if ($breadcrumbs)
<ol itemscope="itemscope" itemtype="http://schema.org/BreadcrumbList" class="breadcrumb">
@foreach ($breadcrumbs as $breadcrumb)
@if ($breadcrumb->url && !$breadcrumb->last)
<li itemprop="itemListElement" itemscope="itemscope" itemtype="http://schema.org/ListItem"><a itemprop="item" href="{{ $breadcrumb->url }}">{{ $breadcrumb->title }}</a></li>
@else
<li itemprop="itemListElement" itemscope="itemscope" itemtype="http://schema.org/ListItem" class="active">{{ $breadcrumb->title }}</li>
@endif
@endforeach
</ol>
@endif