The Back Story
To sort tags in alphabetical order, use
{% for tag in tag_cloud|sort) %} <button type="button" class="btn btn-primary btn-xs"> <a class="tag-{{ tag.1 }}" href="{{ SITEURL }}/{{ tag.0.url }}"> {{ tag.0 }} </a> </button> {% if not loop.last %} {% endif %} {% endfor %}
{% for tag in tag_cloud|sort) %} {% if not loop.last %} {% endif %}
To sort by number of articles in tag
{% for tag in tag_cloud|sort(attribute='1') %} <button type="button" class="btn btn-primary btn-xs"> <a class="tag-{{ tag.1 }}" href="{{ SITEURL }}/{{ tag.0.url }}"> {{ tag.0 }} </a> </button> {% if not loop.last %} {% endif %} {% endfor %}
{% for tag in tag_cloud|sort(attribute='1') %} {% if not loop.last %} {% endif %}