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 | 80 | 9 hours ago | ||
| 1 | 51 | 14 hours ago | ||
| 0 | 44 | 1 day ago | ||
| 6 | 346 | 5 days ago | ||
| 3 | 40 | 5 days ago |