Answers.Body: <p>I think you've made this more complicated that it needs to be for yourself. Reading the Craft docs on <a href="https://craftcms.com/support/breadcrumbs#outputting-the-entrys-ancestors-in-a-structure-section" rel="nofollow">Outputting the Entry’s Ancestors in a Structure Section</a> it looks like you can use the handle <code>.getAncestors()</code> method to output the entries leading up to the currently viewed entry automatically, and have access to their URLs.</p>
  
  <p>Give the example a go.</p>
  
  <pre><code>{% if entry.level &gt; 1 %}
    &lt;ul class="crumbs"&gt;
      {% for crumb in entry.getAncestors() %}
        &lt;li&gt;{{ crumb.getLink() }}&lt;/li&gt;
      {% endfor %}
    &lt;/ul&gt;
  {% endif %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-07-22T11:09:45.573Z
Answers.LastActivityDate: 2016-07-22T11:09:45.573Z
Answers.UserDisplayName: Luke Pearce
Body: <p>I have a structure set up like:</p>
  
  <p><strong>What we do (set as a structure)</strong></p>
  
  <ul>
  <li><p>2nd level page A</p>
  
  <pre><code>* 3rd level page A
  * 3rd level page A
  </code></pre></li>
  <li><p>2nd level page B</p>
  
  <pre><code>* 3rd level page B
  </code></pre></li>
  </ul>
  
  <p>I'm setting up breadcrumbs for this so it's</p>
  
  <p>Home / What we do / 2nd level page A / 3rd level page A</p>
  
  <p>This is what I have so far but I can't figure out how to get the entry section url working (what-we-do) which is set in the Entry Url format.</p>
  
  <pre><code>{% set crumbs = entry.ancestors|default([]) %}
  {% if crumbs|length %}
  &lt;ul class="breadcrumbs"&gt;
      &lt;li&gt;&lt;a href="{{ siteUrl }}"&gt;Home&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="{{ NEED HELP }}"&gt; {{ entry.section.name }}&lt;/a&gt;&lt;/li&gt;
      {% for crumb in crumbs %}
          &lt;li&gt;&lt;a href="{{ crumb.url }}"&gt;{{ crumb.title }}&lt;/a&gt;&lt;/li&gt;
      {% endfor %}
      &lt;li&gt;{{ entry.title }}&lt;/li&gt;
  &lt;/ul&gt;
  {% endif %}
  </code></pre>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-07-21T16:12:06.187Z
Comments.Text: What does `entry.url` give you?
Comments.UserDisplayName: Luke Pearce
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-07-22T09:44:07.047Z
Comments.Text: The whole URL. I'm after the url that the structure adds to the level above the entry.
Comments.UserDisplayName: sarah3585
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-07-22T09:49:22.037Z
Comments.Text: I'm not sure what you mean? Using `{{ entry.url }}` will link to the section name you output with `{{ entry.section.name }}`.
Comments.UserDisplayName: Luke Pearce
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-07-22T10:47:11.030Z
Comments.Text: {{ entry.url }} gives you the url of the current entry. ie /what-we-do/2nd-level/3rd-level I need just the /what-we-do part for the breadcrumb
Comments.UserDisplayName: sarah3585
Tags: <structure><sections>
Title: Get structure url
ThreadText: # Get structure url
  
  (Asked by: username_0 on 2016-07-21)
  
  I have a structure set up like:
  
  **What we do (set as a structure)**
  
  * 2nd level page A
  
    ```
    * 3rd level page A
    * 3rd level page A
  
    ```
  * 2nd level page B
  
    ```
    * 3rd level page B
  
    ```
  
  I'm setting up breadcrumbs for this so it's
  
  Home / What we do / 2nd level page A / 3rd level page A
  
  This is what I have so far but I can't figure out how to get the entry section url working (what-we-do) which is set in the Entry Url format.
  
  ```
  {% set crumbs = entry.ancestors|default([]) %}
  {% if crumbs|length %}
  <ul class="breadcrumbs">
      <li><a href="{{ siteUrl }}">Home</a></li>
      <li><a href="{{ NEED HELP }}"> {{ entry.section.name }}</a></li>
      {% for crumb in crumbs %}
          <li><a href="{{ crumb.url }}">{{ crumb.title }}</a></li>
      {% endfor %}
      <li>{{ entry.title }}</li>
  </ul>
  {% endif %}
  
  ```
  
  **Tags:** structure, sections
  
  > **Comments:**
  > **username_1**: What does `entry.url` give you?  
  > **username_0**: The whole URL. I'm after the url that the structure adds to the level above the entry.  
  > **username_1**: I'm not sure what you mean? Using `{{ entry.url }}` will link to the section name you output with `{{ entry.section.name }}`.  
  > **username_0**: {{ entry.url }} gives you the url of the current entry. ie /what-we-do/2nd-level/3rd-level I need just the /what-we-do part for the breadcrumb  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2016-07-22. Score: 3 | Accepted answer
  
  I think you've made this more complicated that it needs to be for yourself. Reading the Craft docs on [Outputting the Entry’s Ancestors in a Structure Section](https://craftcms.com/support/breadcrumbs#outputting-the-entrys-ancestors-in-a-structure-section) it looks like you can use the handle `.getAncestors()` method to output the entries leading up to the currently viewed entry automatically, and have access to their URLs.
  
  Give the example a go.
  
  ```
  {% if entry.level > 1 %}
    <ul class="crumbs">
      {% for crumb in entry.getAncestors() %}
        <li>{{ crumb.getLink() }}</li>
      {% endfor %}
    </ul>
  {% endif %}
  
  ```
  
  
  ---
  
  