Extension:MoveToSkin
Jump to navigation
Jump to search
![]() | This extension is currently not actively maintained! Although it may still work, any bug reports or feature requests will more than likely be ignored. |
MoveToSkin 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 |
mywiki |
|
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[edit]
- 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";
Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.
Usage[edit]
Wiki page[edit]
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[edit]
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>';
}
}