Fandom Developers Wiki
mNo edit summary
m (Automatic substitution of article type data)
(4 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
{{Languages}}
 
{{Languages}}
 
{{Infobox JavaScript
 
{{Infobox JavaScript
|Image file = ShowUserGroups screenshot.png
+
| Image file = ShowUserGroups screenshot.png
|Status = stable
+
| Status = stable
|Description = List all groups a user is in on their user page
+
| Description = List all groups a user is in on their user page
|Author = [[User:OneTwoThreeFall|OneTwoThreeFall]]
+
| Author = [[User:OneTwoThreeFall|OneTwoThreeFall]]
|Scope = ps
+
| Scope = ps
|Updated = {{updated|MediaWiki:ShowUserGroups.js}}
+
| Updated = {{updated|MediaWiki:ShowUserGroups.js}}
|Code = [[MediaWiki:ShowUserGroups.js|ShowUserGroups.js]]
+
| Code = [[MediaWiki:ShowUserGroups.js|ShowUserGroups.js]]
|Languages = {{language list|source-js=MediaWiki:ShowUserGroups.js}}
+
| Languages = auto
  +
| Type = site
 
}}
 
}}
   
 
When viewing user pages, '''ShowUserGroups''' adds a list of the user groups in which the user is a member.
 
When viewing user pages, '''ShowUserGroups''' adds a list of the user groups in which the user is a member.
   
In the Oasis skin, the list is added to the user masthead. In the MonoBook and Vector skins, the list is added opposite the page heading. The '<code>*</code>' and '<code>user</code>' groups are not displayed as they are redundant (all users are a member of these groups).
+
On Fandom, the list is added to the user masthead. Elsewhere, the list is added opposite the page heading. The '<code>*</code>' and '<code>user</code>' groups are not displayed as they are redundant (all users are a member of these groups).
   
 
== Usage ==
 
== Usage ==

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().