Answers.Body: <p>The lastSegment will always have length whether it's 2, 3, 4 etc. I am unclear about your Structure setup, but if there is nothing after "modules", "modules" is the last segment and therefore exists.</p>
  
  <p>So maybe something like:</p>
  
  <pre><code>{% if craft.request.getSegment(2) == 'modules' and not craft.request.getSegment(3)|length %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-06-15T13:12:20.900Z
Answers.Text: Thank you for setting me on the right track. I was able to accomplish what I wanted with the following.
  `{% if craft.request.getSegment(2) == 'modules' and not craft.request.getSegment(3)|length %}`
Answers.UserDisplayName: julzmon
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-06-16T07:23:46.650Z
Answers.Text: I added "not" to the answer above that I had originally left out.
Answers.UserDisplayName: AbbeyDesign
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-06-15T09:14:24.377Z
Answers.LastActivityDate: 2016-06-16T07:20:39.633Z
Answers.LastEditDate: 2016-06-16T07:20:39.633Z
Answers.UserDisplayName: AbbeyDesign
Body: <p>How do I display something only for one of the parent Structure sections and not others or this sections children?
  I was thinking of using</p>
  
  <pre><code>{% if craft.request.segment(2) == 'modules' and craft.request.lastSegment|length %}''
  </code></pre>
  
  <p>but that still shows for its children.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-06-15T09:43:31.290Z
Comments.Text: Is this being output inside a nav of your structure or on a structure entry page?
Comments.UserDisplayName: Luke Pearce
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-06-15T13:11:59.443Z
Comments.Text: Yes Luke this is basically a nav for a structure where I wan't to display something differently only when on one of the parents url.
Comments.UserDisplayName: julzmon
Tags: <conditional>
Title: How do I show something only for a parent segment and not it's children?
ThreadText: # How do I show something only for a parent segment and not it's children?
  
  (Asked by: username_0 on 2016-06-15)
  
  How do I display something only for one of the parent Structure sections and not others or this sections children?
  I was thinking of using
  
  ```
  {% if craft.request.segment(2) == 'modules' and craft.request.lastSegment|length %}''
  
  ```
  
  but that still shows for its children.
  
  **Tags:** conditional
  
  > **Comments:**
  > **username_1**: Is this being output inside a nav of your structure or on a structure entry page?  
  > **username_0**: Yes username_1 this is basically a nav for a structure where I wan't to display something differently only when on one of the parents url.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2016-06-15. Score: 2 | Accepted answer
  
  The lastSegment will always have length whether it's 2, 3, 4 etc. I am unclear about your Structure setup, but if there is nothing after "modules", "modules" is the last segment and therefore exists.
  
  So maybe something like:
  
  ```
  {% if craft.request.getSegment(2) == 'modules' and not craft.request.getSegment(3)|length %}
  
  ```
  
  > **Comments:**
  > **username_0**: Thank you for setting me on the right track. I was able to accomplish what I wanted with the following. `{% if craft.request.getSegment(2) == 'modules' and not craft.request.getSegment(3)|length %}`  
  > **username_2**: I added "not" to the answer above that I had originally left out.  
  
  ---
  
  