I'm nearly there on this one but could use some help. I want to list all User Groups, with all Users listed under each group. For bonus points, this all needs to be alphabetical (Group, then Users). Something like...
User Group A
- User Name A
- User Name B
- etc...
User Group B
- User Name A
- User Name B
- etc...
Here's what I have so far...
{% set userGroups = craft.userGroups.getAllGroups() %}
{% if userGroups|length %}
{% for userGroup in userGroups %}
<h2>{{ userGroup.name }}</h2>
{# list all users for this group #}
{% endfor %}
{% endif %}
I just can't figure out how to loop through users for a userGroup.