Fandom Developers Wiki
m (lang = auto)
m (Automatic substitution of article type data)
Line 9: Line 9:
 
| Code = [[MediaWiki:ShowUserGroups.js|ShowUserGroups.js]]
 
| Code = [[MediaWiki:ShowUserGroups.js|ShowUserGroups.js]]
 
| Languages = auto
 
| Languages = auto
  +
| Type = site
 
}}
 
}}
   

Revision as of 15:55, 16 November 2018

When viewing user pages, ShowUserGroups adds a list of the user groups in which the user is a member.

On Fandom, the list is added to the user masthead. Elsewhere, the list is added opposite the page heading. The '*' and 'user' groups are not displayed as they are redundant (all users are a member of these groups).

Usage

Advanced

Sorting the groups

An optional function can be defined in a user/site JS page to sort the user groups as you wish. The compare function will be supplied to Array.prototype.sort to be used on the array containing the user groups. It should be defined in the global scope, and be named ShowUserGroups_sorter. For detailed info on how this compare function should work, see the MDN page for Array.prototype.sort().