I'd like to set a user defined order for a Categories field. For example, categories are:
Cat A Cat B Cat C
I'd like to give the ability for users to drag and drop the order, to say:
Cat B Cat A Cat C
What is the best way to handle this?
You can do this in the CP by default.
If you have a category field "categories", the user can select one or more categories and then drag them into the order they want.
On the frontend you just loop over them like this to show them in the order they selected.
{% for category in entry.categories %}
<a href="{{ category.url }}">{{ category.title }}</a>
{% endfor %}
Same goes if you want to just show all categories from a category group, you can drag and drop them in the CP and then print them out in your code.
{% for category in craft.categories.group('cats') %}
<a href="{{ category.url }}">{{ category.title }}</a>
{% endfor %}
I ended up finding this code snipped, which worked for me: