Answers.Body: <p>Since you already have an <code>entry</code> in the same <code>structure</code>, the simplest method is probably to use the <code>parent</code> and <code>descendants</code> properties of the <a href="https://buildwithcraft.com/classreference/models/EntryModel" rel="nofollow">EntryModel</a>.</p>
  
  <pre><code>{% set entries = entry.parent.descendants %}
  &lt;ul&gt;
      {% for entry in entries %}
          &lt;li&gt;&lt;a href="{{ entry.url }}"&gt;{{ entry.title }}&lt;/a&gt;&lt;/li&gt;
      {% endfor %}
  &lt;/ul&gt;
  </code></pre>
  
  <p>A more round about way would be to get the segment through <code>craft.request.segment</code>, use that to get the entry, and use <code>descendants</code> to get the children.</p>
  
  <pre><code>{% set segment = craft.request.segment(1) %}
  {% set entries = craft.entries.section('myStructureHandle').slug(segment).first.descendants %}
  &lt;ul&gt;
      {% for entry in entries %}
          &lt;li&gt;&lt;a href="{{ entry.url }}"&gt;{{ entry.title }}&lt;/a&gt;&lt;/li&gt;
      {% endfor %}
  &lt;/ul&gt;
  </code></pre>
  
  <p>Or, if you only want the <code>siblings</code> without the current entry, you could use:</p>
  
  <pre><code>{% set entries = entry.siblings %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-01-27T07:42:41.870Z
Answers.LastActivityDate: 2015-01-27T07:49:34.693Z
Answers.LastEditDate: 2015-01-27T07:49:34.693Z
Answers.UserDisplayName: Douglas McDonald
Body: <p>I have a Structure that has the URL setup like this..</p>
  
  <p>Top-Level Entries - {slug}<br/>
  Nested Entries - {parent.uri}/{slug}</p>
  
  <p>How do I list all entries that have the same segment1 of their URL as to what is on the current page the user is on. </p>
  
  <p>i.e if I am on page  <a href="http://example.com/vacation" rel="nofollow">http://example.com/vacation</a></p>
  
  <p>I want to list all structure entries that have 'vacation' as the first segment of the URL. </p>
  
  <p>i.e </p>
  
  <p>/vacation/snow<br/>
  /vacation/coastal</p>
  
  <p>but it would not show any entries from the structure that are like this:</p>
  
  <p>/advice/what-to-bring<br/>
  /advice/weather-warnings<br/>
  /contact</p>
  
  <p>So basically I want to do this...</p>
  
  <p>if segment1 = entry url segment1 display entries.  </p>
  
Tags: <url>
Title: if entry has same url segment
ThreadText: # if entry has same url segment
  
  (Asked by: username_0 on 2015-01-27)
  
  I have a Structure that has the URL setup like this..
  
  Top-Level Entries - {slug}  
  Nested Entries - {parent.uri}/{slug}
  
  How do I list all entries that have the same segment1 of their URL as to what is on the current page the user is on.
  
  i.e if I am on page <http://example.com/vacation>
  
  I want to list all structure entries that have 'vacation' as the first segment of the URL.
  
  i.e
  
  /vacation/snow  
  /vacation/coastal
  
  but it would not show any entries from the structure that are like this:
  
  /advice/what-to-bring  
  /advice/weather-warnings  
  /contact
  
  So basically I want to do this...
  
  if segment1 = entry url segment1 display entries.
  
  **Tags:** url
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2015-01-27. Score: 3 | Accepted answer
  
  Since you already have an `entry` in the same `structure`, the simplest method is probably to use the `parent` and `descendants` properties of the [EntryModel](https://buildwithcraft.com/classreference/models/EntryModel).
  
  ```
  {% set entries = entry.parent.descendants %}
  <ul>
      {% for entry in entries %}
          <li><a href="{{ entry.url }}">{{ entry.title }}</a></li>
      {% endfor %}
  </ul>
  
  ```
  
  A more round about way would be to get the segment through `craft.request.segment`, use that to get the entry, and use `descendants` to get the children.
  
  ```
  {% set segment = craft.request.segment(1) %}
  {% set entries = craft.entries.section('myStructureHandle').slug(segment).first.descendants %}
  <ul>
      {% for entry in entries %}
          <li><a href="{{ entry.url }}">{{ entry.title }}</a></li>
      {% endfor %}
  </ul>
  
  ```
  
  Or, if you only want the `siblings` without the current entry, you could use:
  
  ```
  {% set entries = entry.siblings %}
  
  ```
  
  
  ---
  
  