Skip to content

Commit

Permalink
Categories cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
AugustMiller committed Dec 17, 2024
1 parent 60c56d6 commit b3779b5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/5.x/reference/element-types/categories.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,11 @@ We can display a navigation for all the categories in a _Flavors_ category group
</ul>
```

Keep in mind that this only holds value for category groups with multiple hierarchical levels. If you were working with a “flat” taxonomy, the template above can use a `{% for %}` tag in lieu of Craft’s `{% nav %}` tag.
Keep in mind that this only holds value for category groups with multiple hierarchical levels. If you were working with a “flat” taxonomy, the template above should use a regular `{% for %}` tag in lieu of Craft’s `{% nav %}` tag.

::: tip
To maintain the exact order you see in the control panel, add `orderBy('lft ASC')` to your query:

```twig
{% set myCategoryQuery = craft.categories()
.group('flavors')
Expand Down

0 comments on commit b3779b5

Please sign in to comment.