Browse Source

Stop first breadcrumb item being tied to homepage title

Edd Baldry 8 years ago
parent
commit
e10a76df18
1 changed files with 7 additions and 6 deletions
  1. 7 6
      bakerydemo/templates/tags/breadcrumbs.html

+ 7 - 6
bakerydemo/templates/tags/breadcrumbs.html

@@ -1,19 +1,20 @@
 {% load wagtailcore_tags %}
 
 
-<div class="breadcrumb-container">
+<nav class="breadcrumb-container" aria-label="breadcrumb" role="navigation">
   <div class="container">
       <div class="row">
           <div class="col-lg-12">
             {% if ancestors %}
-              <ol class="breadcrumb" aria-label="You are here:" role="navigation">
-                  {% for ancestor in ancestors %}
+              <ol class="breadcrumb">
+                <li><a href="/"><i class="fa fa-home" aria-hidden="true"></i><span class="hidden" aria-hidden="false">Home</span></a></li>
+                  {% for ancestor in ancestors|slice:"1:" %}
                     {% if forloop.last %}
-                      <li class="active">
+                      <li class="active" aria-level="{{ancestors|length}}">
                         {{ ancestor }}
                       </li>
                     {% else %}
-                      <li><a href="{% pageurl ancestor %}">{{ ancestor }}</a></li>
+                      <li><a href="{% pageurl ancestor %}" aria-level="{% cycle 1 2 3 4 5 %}">{{ ancestor }}</a></li>  
                     {% endif %}
                   {% endfor %}
               </ol>
@@ -21,4 +22,4 @@
           </div>
       </div>
   </div>
-</div>
+</nav>