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?
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 |
|---|---|---|---|---|
| 0 | 72 | 2 days ago | ||
| 0 | 111 | 3 days ago | ||
| 0 | 113 | 4 days ago | ||
| 2 | 205 | 1 week ago | ||
| 2 | 462 | 2 weeks ago |