# Get\_taxonomy return value

**URL:** <https://zola.discourse.group/t/get-taxonomy-return-value/501>\
**Category:** Support\
**Created:** [July 20, 2020, 8:16pm UTC](https://zola.discourse.group/t/get-taxonomy-return-value/501 "2020-07-20T20:16:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![HugoTrentesaux](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/hugotrentesaux/32/105_2.png) [@HugoTrentesaux](https://zola.discourse.group/u/HugoTrentesaux)\
**Post date:** [July 20, 2020, 8:16pm UTC](https://zola.discourse.group/t/get-taxonomy-return-value/501/1 "2020-07-20T20:16:44Z")

</div>

It is not clear in the documentation what the `get_taxonomy` function returns.

We might want to add that it returns an object with `kind` and `items`.

Here is some code I used to find it out:

```auto
{% for t in config.taxonomies %}
<div>
    Taxonomy<br>
    Name: {{t.name}}<br>
    {% set taxonomy = get_taxonomy(kind=t.name) %}
    get_taxonomy: {{taxonomy}}<br>
    kind (taxonomy config): {{taxonomy.kind}}<br>
    items: {{taxonomy.items}}, length: {% set length = taxonomy.items | length %}{{length}}<br>
    {% for item in taxonomy.items %}
        {{ item.name }}
        <br>
    {% endfor %}
</div><br>
{% endfor %}

```

---

<div class="post-metadata">

**Author:** ![HugoTrentesaux](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/hugotrentesaux/32/105_2.png) [@HugoTrentesaux](https://zola.discourse.group/u/HugoTrentesaux)\
**Post date:** [July 20, 2020, 8:27pm UTC](https://zola.discourse.group/t/get-taxonomy-return-value/501/2 "2020-07-20T20:27:03Z")

</div>

If someone wants to browse the whole taxonomy tree:

```auto
{% for t in config.taxonomies %}
<ul>
    {% set taxonomy = get_taxonomy(kind=t.name) %}
    <li>{{taxonomy.kind.name}} ({{ taxonomy.items | length }})</li>
    <ul>
    {% for item in taxonomy.items %}
        {% set url = get_taxonomy_url(kind=taxonomy.kind.name, name=item.name) %}
        <li><a href="{{url}}">{{ item.name }}</a> ({{ item.pages | length }})</li>
        <ul>
            {% for p in item.pages %}
                <li><a href="{{p.permalink}}">{{p.title}}</a></li>
            {% endfor %}
        </ul>
    {% endfor %}
    </ul>
</ul>
{% endfor %}

```

---

<div class="post-metadata">

**Author:** ![keats](https://avatars.discourse-cdn.com/v4/letter/k/34f0e0/32.png) [@keats](https://zola.discourse.group/u/keats)\
**Post date:** [July 21, 2020, 9:08am UTC](https://zola.discourse.group/t/get-taxonomy-return-value/501/3 "2020-07-21T09:08:06Z")

</div>

I’ve already added [https://github.com/getzola/zola/pull/1038/commits/cb198ab597de787f4cf8b313df19cb57d5bf4859](https://github.com/getzola/zola/pull/1038/commits/cb198ab597de787f4cf8b313df19cb57d5bf4859) to the next branch

---

<div class="post-metadata">

**Author:** ![HugoTrentesaux](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/hugotrentesaux/32/105_2.png) [@HugoTrentesaux](https://zola.discourse.group/u/HugoTrentesaux)\
**Post date:** [July 22, 2020, 3:39pm UTC](https://zola.discourse.group/t/get-taxonomy-return-value/501/4 "2020-07-22T15:39:43Z")

</div>

Sorry, I’m usually reading the documentation from the website, thanks for your answer 🙂
