Answers.Body: <p>As @Robin Schambach said, you need to loop through the ancestors.</p>
  
  <pre><code>{% set parent = craft.entries.section('pages').slug('phone-directory') %}
  {% for ancestor in parent.getAncestors() %}
      {{ ancestor.title }}
  {% endfor %}
  </code></pre>
  
  <p>This won't output the Phone Directory entry since you're just looping through its ancestors. So to complete the breadcrumbs you'll need to add 
  <code>{{ parent.title }}</code> after the loop.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-06-06T12:54:52.337Z
Answers.Text: Thanks for this but I am still a little confused as to why this isn't working like I expect. I have updated my answer to hopefully explain better.
Answers.UserDisplayName: Terry Upton
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-06-05T18:24:59.543Z
Answers.LastActivityDate: 2018-06-05T18:24:59.543Z
Answers.UserDisplayName: Simon Kuran
Answers.Body: <p>After much help and direction form @RobinSchambach (much appreciated). I have resolved this as follows;</p>
  
  <pre><code>{% set currentPage = craft.entries.section('pages').slug('archive').first() %}
  {% set currentAncestors = currentPage.getAncestors.find() %}
  {% set crumbs = currentAncestors|merge([currentPage]) %}
  
  {% if entry is defined and entry.section.handle != 'homepage' %}
  {% set object = crumbs ?? entry.ancestors  %}
  {% set crumbs =  object %}
  {% set crumbDivider = '&lt;li&gt;&lt;span class="mx-3 text-grey text-xs"&gt;/&lt;/span&gt;&lt;/li&gt;' %}
  &lt;nav class="mb-8 mx-6"&gt;
    &lt;ul class="list-reset flex flex-wrap items-center text-grey-dark text-sm"&gt;
      &lt;li class="mr-3 text-xs text-grey-light"&gt;You are in:&lt;/li&gt;
      &lt;li&gt;&lt;a href="{{ siteUrl }}"&gt;Home&lt;/a&gt;&lt;/li&gt;
      {% for crumb in crumbs %}
      {{ crumbDivider|raw }}
      &lt;li&gt;{{ crumb.getLink() }}&lt;/li&gt;
      {% endfor %}
      {{ crumbDivider|raw }}
      &lt;li class="text-grey-darker"&gt;{{ entry.title ?? category.title }}&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/nav&gt;
  {% endif %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-06-06T14:45:31.510Z
Answers.LastActivityDate: 2018-06-06T14:45:31.510Z
Answers.UserDisplayName: Terry Upton
Body: <p>I have a a few pages outside of a structure but I want to display a breadcrumb for it as part of a structure. I am currently setting the parent page like so:
  <code>{% set parent = craft.entries.section('pages').slug('phone-directory')</code> %}</p>
  
  <p><code>{{ parent.ancestors }}</code></p>
  
  <p>But when I loop through to get the ancestors it is only getting the current parent not all ancestors? Any idea how to achieve this?</p>
  
  <p>The structure is<br>
  Staff<br>
   &nbsp;&nbsp;&nbsp;&nbsp;Phone Directory</p>
  
  <p>The reason I am trying to do this, is the 3rd level pages are either category pages or is a single with some specific routes. I want to manually set the real parent in the template, so I can get the ancestors for the breadcrumb trail as though it is part of the same section.</p>
  
  <p>How can I manually set the parent entry in the template and get the ancestors from this entry?</p>
  
  <p>**** <strong>UPDATED</strong> ****<br>
  This is an update on the above to show my exact code and what isn't working and How I expect it work...If anyone ca shed some light?</p>
  
  <p>So by default I am getting my breadcrumbs like so;</p>
  
  <pre><code>{% if entry is defined and entry.section.handle != 'homepage' %}
  {% set crumbs =  parent.ancetors ?? entry.ancestors|default([]) %}
  {% set crumbDivider = '&lt;li&gt;&lt;span class="mx-3 text-grey text-xs"&gt;/&lt;/span&gt;&lt;/li&gt;' %}
  &lt;nav class="mb-8 mx-6"&gt;
    &lt;ul class="list-reset flex flex-wrap items-center text-grey-dark text-sm"&gt;
      &lt;li class="mr-3 text-xs text-grey-light"&gt;You are in:&lt;/li&gt;
      &lt;li&gt;&lt;a href="{{ siteUrl }}"&gt;Home&lt;/a&gt;&lt;/li&gt;
      {% for crumb in crumbs %}
      {{ crumbDivider|raw }}
      &lt;li&gt;{{ crumb.getLink() }}&lt;/li&gt;
      {% endfor %}
      {{ crumbDivider|raw }}
      &lt;li class="text-grey-darker"&gt;{{ entry.title ?? category.title }}&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/nav&gt;
  {% endif %}
  </code></pre>
  
  <p>This works as expect for normal standard entries. For example, within my Pages structure I have a parent of News with a Child of Internal News and on the Internal News page, the breadcrumb is reflected as;
  <code>Home / News / SWH Internal News</code></p>
  
  <p>Now on the news entry pages I want the breadcrumb to read as follows;
  <code>Home / News / SWH Internal News / {{ Entry Title }}</code></p>
  
  <p>I thought by setting the parent on the news/_entry.html template to the SWH Internal News page like so;
  <code>{% set parent = craft.entries.section('pages').slug('archive') %}</code></p>
  
  <p>Would then give me the ancestors of <code>News / SWH Internal News</code> but instead it only outputs SWH Internal News.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-06-04T20:30:19.577Z
Comments.Text: Can you add the breadcrumb loop code? It's hard to debug this without seeing the code that isn't working.
Comments.UserDisplayName: Simon Kuran
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-06-05T06:56:51.407Z
Comments.Text: even just using `{% set parent = craft.entries.section('pages').slug('phone-directory') %}`
  
  `{{ parent.ancestors }}` only returns the one level though (Phone Directory). If I try {{ parent.first.ancestors }} I get the parent of the parent (Staff).  
  
  The structure is:  
  > Staff  
      >>Phone Directory and this is the entry I am setting.
    
  I would expect this to then show the ancestors as Staff > Phone Directory
Comments.UserDisplayName: Terry Upton
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-06-05T07:07:54.820Z
Comments.Text: @TerryUpton You'll need to iterate the parents of course
Comments.UserDisplayName: Robin Schambach
Tags: <templating><parents>
Title: Getting ancestors for manually set parent in template
ThreadText: # Getting ancestors for manually set parent in template
  
  (Asked by: username_0 on 2018-06-04)
  
  I have a a few pages outside of a structure but I want to display a breadcrumb for it as part of a structure. I am currently setting the parent page like so:
  `{% set parent = craft.entries.section('pages').slug('phone-directory')` %}
  
  `{{ parent.ancestors }}`
  
  But when I loop through to get the ancestors it is only getting the current parent not all ancestors? Any idea how to achieve this?
  
  The structure is  
  Staff  
      Phone Directory
  
  The reason I am trying to do this, is the 3rd level pages are either category pages or is a single with some specific routes. I want to manually set the real parent in the template, so I can get the ancestors for the breadcrumb trail as though it is part of the same section.
  
  How can I manually set the parent entry in the template and get the ancestors from this entry?
  
  \*\*\*\* **UPDATED** \*\*\*\*  
  This is an update on the above to show my exact code and what isn't working and How I expect it work...If anyone ca shed some light?
  
  So by default I am getting my breadcrumbs like so;
  
  ```
  {% if entry is defined and entry.section.handle != 'homepage' %}
  {% set crumbs =  parent.ancetors ?? entry.ancestors|default([]) %}
  {% set crumbDivider = '<li><span class="mx-3 text-grey text-xs">/</span></li>' %}
  <nav class="mb-8 mx-6">
    <ul class="list-reset flex flex-wrap items-center text-grey-dark text-sm">
      <li class="mr-3 text-xs text-grey-light">You are in:</li>
      <li><a href="{{ siteUrl }}">Home</a></li>
      {% for crumb in crumbs %}
      {{ crumbDivider|raw }}
      <li>{{ crumb.getLink() }}</li>
      {% endfor %}
      {{ crumbDivider|raw }}
      <li class="text-grey-darker">{{ entry.title ?? category.title }}</li>
    </ul>
  </nav>
  {% endif %}
  
  ```
  
  This works as expect for normal standard entries. For example, within my Pages structure I have a parent of News with a Child of Internal News and on the Internal News page, the breadcrumb is reflected as;
  `Home / News / SWH Internal News`
  
  Now on the news entry pages I want the breadcrumb to read as follows;
  `Home / News / SWH Internal News / {{ Entry Title }}`
  
  I thought by setting the parent on the news/\_entry.html template to the SWH Internal News page like so;
  `{% set parent = craft.entries.section('pages').slug('archive') %}`
  
  Would then give me the ancestors of `News / SWH Internal News` but instead it only outputs SWH Internal News.
  
  **Tags:** templating, parents
  
  > **Comments:**
  > **username_1**: Can you add the breadcrumb loop code? It's hard to debug this without seeing the code that isn't working.  
  > **username_0**: even just using `{% set parent = craft.entries.section('pages').slug('phone-directory') %}`  `{{ parent.ancestors }}` only returns the one level though (Phone Directory). If I try {{ parent.first.ancestors }} I get the parent of the parent (Staff).    The structure is:   > Staff       >>Phone Directory and this is the entry I am setting.    I would expect this to then show the ancestors as Staff > Phone Directory  
  > **username_2**: @username_0 You'll need to iterate the parents of course  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2018-06-05. Score: 2
  
  As @username_2 said, you need to loop through the ancestors.
  
  ```
  {% set parent = craft.entries.section('pages').slug('phone-directory') %}
  {% for ancestor in parent.getAncestors() %}
      {{ ancestor.title }}
  {% endfor %}
  
  ```
  
  This won't output the Phone Directory entry since you're just looping through its ancestors. So to complete the breadcrumbs you'll need to add
  `{{ parent.title }}` after the loop.
  
  > **Comments:**
  > **username_0**: Thanks for this but I am still a little confused as to why this isn't working like I expect. I have updated my answer to hopefully explain better.  
  
  ---
  
  ### Answer by username_0 on 2018-06-06. Score: 2
  
  After much help and direction form @username_2 (much appreciated). I have resolved this as follows;
  
  ```
  {% set currentPage = craft.entries.section('pages').slug('archive').first() %}
  {% set currentAncestors = currentPage.getAncestors.find() %}
  {% set crumbs = currentAncestors|merge([currentPage]) %}
  
  {% if entry is defined and entry.section.handle != 'homepage' %}
  {% set object = crumbs ?? entry.ancestors  %}
  {% set crumbs =  object %}
  {% set crumbDivider = '<li><span class="mx-3 text-grey text-xs">/</span></li>' %}
  <nav class="mb-8 mx-6">
    <ul class="list-reset flex flex-wrap items-center text-grey-dark text-sm">
      <li class="mr-3 text-xs text-grey-light">You are in:</li>
      <li><a href="{{ siteUrl }}">Home</a></li>
      {% for crumb in crumbs %}
      {{ crumbDivider|raw }}
      <li>{{ crumb.getLink() }}</li>
      {% endfor %}
      {{ crumbDivider|raw }}
      <li class="text-grey-darker">{{ entry.title ?? category.title }}</li>
    </ul>
  </nav>
  {% endif %}
  
  ```
  
  
  ---
  
  