Answers.Body: <p>Got it!</p>
  
  <pre><code>{% if craft.request.segments %}
  &lt;nav class="breadcrubs"&gt;
      &lt;div class="container"&gt;
          &lt;div class="row"&gt;
              &lt;ol class="breadcrumb"&gt;
                  &lt;li&gt;&lt;a href="{{ siteUrl }}"&gt;Home&lt;/a&gt;&lt;/li&gt;
                  {% for crumb in entry.getAncestors() %}
                      &lt;li&gt;{{ crumb.getLink() }}&lt;/li&gt;
                  {% endfor %}
                  &lt;li&gt;{{ entry.title }}&lt;/li&gt;
              &lt;/ol&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/nav&gt;
  {% endif %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2014-08-06T15:11:36.480Z
Answers.LastActivityDate: 2019-07-25T11:50:00.083Z
Answers.LastEditDate: 2019-07-25T11:50:00.083Z
Answers.UserDisplayName: Johannes Lamers
Body: <p>How do you create breadcrumbs based on a structure?</p>
  
  <p><strong>My structure:</strong></p>
  
  <ul>
  <li>Parent
  <ul>
  <li>Child (active)</li>
  <li>Other Child</li>
  </ul></li>
  </ul>
  
  <p>Child</p>
  
  <p><strong>My url:</strong></p>
  
  <p>site.com/parent/child</p>
  
  <p><strong>So my breadcrumb need to be:</strong></p>
  
  <p>home (url) / parent (url) / child</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-08-01T05:44:14.997Z
Comments.Text: The official method is described in this Craft support doc: https://craftcms.com/support/breadcrumbs
Comments.UserDisplayName: Simon East
Tags: <navigation><structure>
Title: What is the best way to create breadcrumbs based on a structure?
ThreadText: # What is the best way to create breadcrumbs based on a structure?
  
  (Asked by: username_0 on 2014-08-06)
  
  How do you create breadcrumbs based on a structure?
  
  **My structure:**
  
  * Parent
    + Child (active)
    + Other Child
  
  Child
  
  **My url:**
  
  site.com/parent/child
  
  **So my breadcrumb need to be:**
  
  home (url) / parent (url) / child
  
  **Tags:** navigation, structure
  
  > **Comments:**
  > **username_1**: The official method is described in this Craft support doc: https://craftcms.com/support/breadcrumbs  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2014-08-06. Score: 13 | Accepted answer
  
  Got it!
  
  ```
  {% if craft.request.segments %}
  <nav class="breadcrubs">
      <div class="container">
          <div class="row">
              <ol class="breadcrumb">
                  <li><a href="{{ siteUrl }}">Home</a></li>
                  {% for crumb in entry.getAncestors() %}
                      <li>{{ crumb.getLink() }}</li>
                  {% endfor %}
                  <li>{{ entry.title }}</li>
              </ol>
          </div>
      </div>
  </nav>
  {% endif %}
  
  ```
  
  
  ---
  
  