Skip to content

Commit a812779

Browse files
authored
Merge pull request #919 from ExpressionEngine/feature/7.x/categories-orderby
Added `orderby` parameter to `exp:channel:categories` tag
2 parents ab8507b + c629926 commit a812779

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

docs/channels/categories.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,20 @@ You may alternatively specify which categories to not show
128128

129129
If you specify that a parent category is not shown, then any children of that parent category are then unable to be shown by the tag. The parent category is required for any and all children categories.
130130

131+
### `orderby=`
132+
133+
This parameter allows you to specify the order in which the categories are displayed. Only applicable when using the "[linear](#style)" style. The default is to display the categories in the order they are displayed in the CP, where also they can be reordered. You can order by any of the following:
134+
135+
orderby="category_name"
136+
137+
orderby="category_url_title"
138+
139+
orderby="category_description"
140+
141+
You can also the name of the custom field as the parameter value. If you have a custom field called "my_custom_field" you would use
142+
143+
orderby="my_custom_field"
144+
131145
### `show_empty=`
132146

133147
show_empty="no"
@@ -152,6 +166,14 @@ Determines whether entries dated in the "future" to are included when calculatin
152166

153167
By default, future dated entries will **not** count when determining whether a category is empty.
154168

169+
### `sort=`
170+
171+
sort="asc"
172+
173+
The sort order can be ascending (asc) or descending (desc). The order will default to “descending” if nothing is specified.
174+
175+
This parameter is only applicable when using the "[orderby](#orderby)" parameter to specify the sort order.
176+
155177
### `status=`
156178

157179
status="open"

0 commit comments

Comments
 (0)