# Menu de Categorias em 3 Níveis

Snippet para criar um menu de categorias, exibindo os 3 níveis.

```html
{#
# Listagem de categorias com 3 níveis
# elements/snippets/list_categories_thirdlvl.html
#}
<ul class="first-lvl">
    {% for category in categories %}
        {% if loop.index <= limit or not limit %}
            <li>
                <a href="{{ category.link }}">{{ category.name }}</a>
                {% if category.children  %}
                  <ul class="second-lvl">
                    {% for child in category.children %}
                        <li>
                             <a href="{{ child.link }}">{{ child.name }}</a>
                             {% if child.children  %}
                                {% for child in child.children %}
                                    <ul class="third-lvl">
                                        <li>
                                             <a href="{{ child.link }}">{{ child.name }}</a>
                                        </li>
                                    </ul>
                                {% endfor %}
                            {% endif %}
                        </li>
                    {% endfor %}
                  </ul>
                {% endif %}
            </li>
        {% endif %}
    {% endfor %}
</ul>
```

### Como usar <a href="#ir-para" id="ir-para"></a>

Copie o código acima e crie um arquivo separado, ex: `elements/snippets/list_categories_thirdlvl.htmtw`\
\
Faça a chamada desse arquivo onde desejar:

```twig
{% element('snippets/list_categories_thirdlvl') %}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://partners.tray.com.br/themes/construindo-seu-template/referencias/componentes/menu-de-categorias-em-3-niveis.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
