Answers.Body: <p>Unless I'm misunderstanding, it should be as simple as:</p>
  
  <pre><code>{{ entry.section.name }}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-27T13:57:57.960Z
Answers.Text: Thanks. It was so simple. Do you have an idea how can I list section name also at section index page? Tried something like this but without effect `{% if craft.request.getSegment(2) is defined %}{{ entry.section.name }}{% else %}{{ title }}{% endif %}`
Answers.UserDisplayName: curious
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-27T15:02:12.493Z
Answers.Text: Depends if you have an entry associated with your index page, or just a template file? You might need something like `{{ craft.entries.section('slug').first().name }}`.
Answers.UserDisplayName: Mike Pierce
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-29T11:00:48.557Z
Answers.Text: Hey, I just found a solution. It was just `{% if entry.section.name is defined %}{{ entry.section.name }}{% else %}{{ title }}{% endif %}`
Answers.UserDisplayName: curious
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-27T13:24:13.577Z
Answers.LastActivityDate: 2017-04-27T13:24:13.577Z
Answers.UserDisplayName: Mike Pierce
Body: <p>For example, I have channel entry <a href="https://site.dev/news/2017/test" rel="nofollow noreferrer">https://site.dev/news/2017/test</a> and I would like to output "News" section name on entry page. </p>
  
Tags: <templating><frontend><channels>
Title: How to output first segment title/channel name of entry?
ThreadText: # How to output first segment title/channel name of entry?
  
  (Asked by: username_0 on 2017-04-27)
  
  For example, I have channel entry <https://site.dev/news/2017/test> and I would like to output "News" section name on entry page.
  
  **Tags:** templating, frontend, channels
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2017-04-27. Score: 5 | Accepted answer
  
  Unless I'm misunderstanding, it should be as simple as:
  
  ```
  {{ entry.section.name }}
  
  ```
  
  > **Comments:**
  > **username_0**: Thanks. It was so simple. Do you have an idea how can I list section name also at section index page? Tried something like this but without effect `{% if craft.request.getSegment(2) is defined %}{{ entry.section.name }}{% else %}{{ title }}{% endif %}`  
  > **username_1**: Depends if you have an entry associated with your index page, or just a template file? You might need something like `{{ craft.entries.section('slug').first().name }}`.  
  > **username_0**: Hey, I just found a solution. It was just `{% if entry.section.name is defined %}{{ entry.section.name }}{% else %}{{ title }}{% endif %}`  
  
  ---
  
  