Skin:Minerva Neue/Hooks/SkinMinervaDefaultModules
Appearance
For more information about attaching hooks, see Manual:Hooks.
For examples of other extensions using this hook, see Category:SkinMinervaDefaultModules extensions.
Details
[edit]The array $modules, submitted with this hook, contains a bunch of JavaScript modules which will be loaded. You can change, remove or add modules with this hook.
Usage
[edit]To add the module test23 to MobileFrontend, you can use the following code:
// Define the module to load and add a dependency to mobile.stable
$wgResourceModules = array_merge( $wgResourceModules, array(
'mobile.test23' => $wgMFMobileResourceBoilerplate + array(
'dependencies' => array(
'mobile.stable',
),
'scripts' => array(
'javascripts/test23.js',
),
'targets' => array( 'mobile' ),
)
) );
// Hook definition
$wgHooks['SkinMinervaDefaultModules'][] = 'onSkinMinervaDefaultModules';
// add the module to MobileFrontend
function onSkinMinervaDefaultModules( $skin, &$modules ) {
$modules['test23'] = array( 'mobile.test23' );
}