Example MediaWiki extension to show how to define extra components for the Chameleon skin.
This extension is not meant to be used directly. It should be forked or downloaded and then modified to suit your own requirements.
To load this extension, add the following in LocalSettings.php
:
wfLoadExtension( 'ChameleonComponentsExample' );
If you want to use your own name for the extension, rename the folder and the name in extension.json
.
The HelloWorld
component simply prints "Hello World!".
To use the HelloWorld
component in a layout, add the following:
<component type="HelloWorld" />
The Sidebar
component displays a system message MyMenu
and also loads the SimpleBatchUpload ResourceLoader module.
To use the Sidebar
component in a layout, add the following:
<component type="Sidebar" />
Add a new PHP class in src/Components
. Make sure the filename and the class name match.
Add another line in extension.json
under AutoloadClasses
and reference your new class:
"AutoloadClasses": {
"Skins\\Chameleon\\Components\\MyComponent": "src/Components/MyComponent.php"
},