Manual:User group CSS and Javascript

From MediaWiki.org
Jump to: navigation, search

Other languages:
Deutsch • ‎English • ‎español • ‎français • ‎italiano • ‎日本語 • ‎polski • ‎português • ‎português do Brasil • ‎中文

User group CSS and JavaScript is possible since MediaWiki 1.18MediaWiki 1.18 (specifically r82285). This means that CSS and JavaScript can be loaded per user group. CSS and JavaScript pages take the following form, where example is the user group:

  • [[MediaWiki:Group-example.css]]
  • [[MediaWiki:Group-example.js]]

The special group "*" does not load MediaWiki:Group-*.js or MediaWiki:Group-*.css. To address all users, use MediaWiki:Common.js and MediaWiki:Common.css instead. The special group "user" (for logged-in users) does load MediaWiki:Group-user.js and MediaWiki:Group-user.css (though this was only introduced in MediaWiki 1.23MediaWiki 1.23, Gerrit #I0ef967). See ResourceLoaderUserModule.php for reference.

Examples: