<p>Unless I'm misunderstanding, it should be as simple as:</p>

<pre><code>{{ entry.section.name }}
</code></pre>

CC BY-SA 3.0
2017-04-27T13:57:57.960Z
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 %}`
curious
CC BY-SA 3.0
2017-04-27T15:02:12.493Z
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 }}`.
Mike Pierce
CC BY-SA 3.0
2017-04-29T11:00:48.557Z
Hey, I just found a solution. It was just `{% if entry.section.name is defined %}{{ entry.section.name }}{% else %}{{ title }}{% endif %}`
curious
CC BY-SA 3.0
2017-04-27T13:24:13.577Z
2017-04-27T13:24:13.577Z
Mike Pierce
<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>

<templating><frontend><channels>
How to output first segment title/channel name of entry?
# 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 %}`  

---

