I am trying to list taxonomy items alphabetically. I pulled the partial from the taxonomy list plugin (user/plugins/taxonomylist/templates/taxonomylist.html.twig) and am using it like this:
{% include ‘partials/taxonomylist.html.twig’ with {‘taxono my’:‘location’} %}
But I’d like to have things ordered alphabetically instead of by # of uses. How can I accomplish this?
if you look in the taxonomylist.html.twig partial (in the plugin) you will see that really its just an associative array. You should be able to use a Twig Sort filter to sort this array alphabetically.
Thanks. Doing {% for tax,value in taxlist[taxonomy]|sort %}
does give me a different order, but not alphabetical. Not sure what that order is — maybe just the order in which the tax list is being built, which seems kind of random. Any other ideas?