<p>Take a look at the sections documentation: <a href="https://craftcms.com/docs/templating/craft.sections" rel="noreferrer">https://craftcms.com/docs/templating/craft.sections</a></p>

<p>The following code lists all entrytypes of all sections.</p>

<pre><code>{% set sections = craft.sections.getAllSections() %}

{% for section in sections %}

    &lt;h2&gt;{{ section.name }}&lt;/h2&gt;

    {% set entryTypes = section.getEntryTypes() %}
    &lt;ul&gt;
        {% for entryType in entryTypes %}

            &lt;li&gt;{{ entryType.name }}&lt;/li&gt;

        {% endfor %}

    &lt;/ul&gt;
{% endfor %}
</code></pre>

<p>If you like only to show used entry types:</p>

<ul>
<li>Loop trough all entries</li>
<li>Collect all entry types in a array</li>
<li>Now, you can loop trough the entry types array</li>
</ul>

CC BY-SA 3.0
2016-04-22T04:48:36.140Z
2016-04-22T04:48:36.140Z
Tom Bauer
<p>Something like <code>craft.entrytypes.section('sectionHandle')</code> and then loop through them to list out their names.  I'm looking through the docs and can't see how to do this with just the <code>craft.entries</code> code.</p>

<entry-type>
How to list out entry types in a section
# How to list out entry types in a section

(Asked by: username_0 on 2016-04-21)

Something like `craft.entrytypes.section('sectionHandle')` and then loop through them to list out their names. I'm looking through the docs and can't see how to do this with just the `craft.entries` code.

**Tags:** entry-type

---

## 1 answers

### Answer by username_1 on 2016-04-22. Score: 5 | Accepted answer

Take a look at the sections documentation: https://craftcms.com/docs/templating/craft.sections
The following code lists all entrytypes of all sections.
{% set sections = craft.sections.getAllSections() %}

{% for section in sections %}

    {{ section.name }}

    {% set entryTypes = section.getEntryTypes() %}
    
        {% for entryType in entryTypes %}

            {{ entryType.name }}

        {% endfor %}

    
{% endfor %}

If you like only to show used entry types:

Loop trough all entries
Collect all entry types in a array
Now, you can loop trough the entry types array


---

