![]() Release status: unmaintained |
|
---|---|
Implementation | Parser function | , Skin
Description | Allows to move content from a page to the skin |
Author(s) | Andru Vallance (andrujhontalk) |
Latest version | 0.1.2 (2012-11-05) |
MediaWiki | 1.19+ |
PHP | 5.3+ |
Database changes | No |
License | GNU General Public License 3.0 or later |
Download | GitHub: Note: README |
Tags
mywiki |
|
Hooks used
|
|
The MoveToSkin extension allows skin designers to specify areas of the skin which can hold content defined within the Wiki article. By using the parser function {{#movetoskin}}
, content defined in the article body can be moved to anywhere in the skin without relying on clientside JavaScript.
Installation
- Download and place the file(s) in a directory called
MoveToSkin
in yourextensions/
folder. - Add the following code at the bottom of your LocalSettings.php
require_once "$IP/extensions/MoveToSkin/MoveToSkin.php";
file: Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.
Usage
Wiki page
In your articles, use the parser function {{#movetoskin:target|content}}.
- The first argument, *target* is a unique name you can use in the skin to show this content.
- The second argument *content* is the content you want to move.
You can use the same target multiple times.
Skin code
Use the static method MoveToSkin::getContent()
in your skin to grab an array of all the content, indexed by target name. You can then use this to output the content wherever you choose.
Eg.
$content = MoveToSkin::getContent();
if(isset($content['target name'])){
foreach($content['target name'] as $c){
echo '<div class="something">'.$c.'</div>';
}
}
This article is issued from Mediawiki. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.