New answers tagged categories
3
votes
Accepted
Batch retrieve the entry count per category item in facet filter
Good question. Try this.
...
{% set productIds = craft.products.relatedTo(category).ids() %}
{% set brandsFilterOptions = craft.categories.group('brandCategories').relatedTo({ sourceElement: ...
- 4,289
2
votes
Convert Categories into Structure entries
Craft 4.4 (which is due to release in Q1 2023) will include a native CLI command that will "aid in migrating existing categories, tags, and global sets over to entries". Full details here: ...
- 21.4k
2
votes
How to display a category on the site?
This is solution:
{% set categories = craft.categories().descendantOf(222).descendantDist(3).all() %}
- 253
Top 50 recent answers are included
Related Tags
categories × 512entries × 92
templating × 65
relations × 58
craft3 × 49
category × 40
relatedto × 39
filter × 26
search × 21
structure × 21
plugin-development × 18
matrix × 18
field × 14
tags × 14
plugin-craftcommerce × 13
url × 13
navigation × 11
control-panel × 10
entry × 10
query × 10
ordering × 10
assets × 9
sections × 9
fieldtypes × 9
group × 9