Skip to content

Example MediaWiki extension to define extra Chameleon components

License

Notifications You must be signed in to change notification settings

ProfessionalWiki/ChameleonComponentsExample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ChameleonComponentsExample

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.

Example: Hello World

The HelloWorld component simply prints "Hello World!".

To use the HelloWorld component in a layout, add the following:

<component type="HelloWorld" />

Example: System message with additional ResourceLoader modules

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" />

Adding more components

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"
},

About

Example MediaWiki extension to define extra Chameleon components

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages