Extension:NewPageCSS

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

Release status: stable

Implementation Tag, Skin
Description Allows the inclusion of CSS style sheets within wiki pages
Author(s) Julian Porter & Ævar Arnfjörð Bjarmason (julianportertalk)
Latest version 1.1 (2012-02-16)
MediaWiki 1.16+
PHP 5.3
Database changes no
License GPLv2 or later
Download Source Code
Tags
<css>
Hooks used
ParserFirstCallInit

Translate the NewPageCSS extension if possible

Check usage and version matrix; code metrics

The NewPageCSS extension uses the tag <css> to include a CSS in the text of the wiki page; that CSS is then put into the header of the resulting HTML, and so formats your page. If you are creating a wiki page that ends up requiring a lot of style modifiers, it's probably simpler to put them into a CSS style sheet.

Usage[edit | edit source]

<css>
table.uc {
    border-collapse: collapse;
}
 
.uc th {
    background-color: #f2f2f2;
    border: 1px solid black;
}
 
.uc td {
    border: 1px solid black;
}
 
.uc td.pm {
    background-color: #ffa0a0;
}
</css>
 
<table class="uc">
 
...
 
</table>

Installation[edit | edit source]

  1. Download the files from here
  2. Create a directory NewPageCSS in your $IP/extensions directory
  3. Extract the files to this $IP/extensions/NewPageCSS directory
  4. Add to the end of LocalSettings.php:
    require_once("$IP/extensions/NewPageCSS/NewPageCSS.php");
  5. Installation can now be verified through Special:Version on your wiki


See also[edit | edit source]

I would like to acknowledge the author of the original extension PageCSS (Ævar Arnfjörð Bjarmason), which I have updated so it will work with current versions of MediaWiki.