Hello! I have a list of pages:
{% set items = page.evaluate({'@page.children': '/items'}) %}
How can I get a list of categories for these pages?
Community guidelines
Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.
Hello! I have a list of pages:
{% set items = page.evaluate({'@page.children': '/items'}) %}
How can I get a list of categories for these pages?
My decision now:
{% set items = page.evaluate({'@page.children': '/items'}) %}
{% set catlist = [] %}
{% for item in items %}
{% for cat in item.taxonomy.category %}
{% if cat not in catlist %}
{% set catlist = catlist|merge([cat]) %}
{% endif %}
{% endfor %}
{% endfor %}
Log in to reply.
| Topic | Participants | Replies | Views | Activity |
|---|---|---|---|---|
| 2 | 82 | 12 hours ago | ||
| 1 | 55 | 16 hours ago | ||
| 0 | 45 | 1 day ago | ||
| 6 | 348 | 5 days ago | ||
| 3 | 43 | 5 days ago |