Extension:AddBodyClass

From MediaWiki.org
Jump to: navigation, search
MediaWiki extensions manual - list
Crystal Clear action run.png
AddBodyClass

Release status: stable

Implementation Parser function
Description Add custom classes to the <body> tag
Author(s) P12talk
Last version 1.1
MediaWiki 1.18 - 1.20
License GPLv2+
Download GitHub
Hooks used
ParserFirstCallInit

OutputPageBodyAttributes
OutputPageBeforeHTML

Check usage and version matrix

This extension allows one to add custom classes to the body html tag.

Usage [edit]

{{#addbodyclass:your_class}}

This will append 'your_class' to the contents of the `class' attribute of <body> class. You can append multiple classes using {{#addbodyclass:your_class1 your_class2 your_class3}}

Download instructions [edit]

Download the extension tarball and copy all files into $IP/extensions/AddBodyClass/ directory. Note: $IP stands for the root directory of your MediaWiki installation, the same directory that holds LocalSettings.php.

Installation [edit]

No configuration is required, just add the following to your LocalSettings.php:

require_once("$IP/extensions/AddBodyClass/AddBodyClass.php");

require_once("$IP/extensions/AddBodyClass/AddBodyClass.php");