Extension:NamespaceHTML

From MediaWiki.org
Jump to: navigation, search
MediaWiki extensions manualManual:Extensions
Crystal Clear action run.png
NamespaceHTML

Release status:Extension status beta

ImplementationTemplate:Extension#type Tag
DescriptionTemplate:Extension#description Allows raw HTML in specified namespaces
Author(s)Template:Extension#username Ike Hecht (tosfostalk)
Latest versionTemplate:Extension#version 0.2 (July 2014)
MediaWikiTemplate:Extension#mediawiki > 1.23, likely earlier versions as well
PHPTemplate:Extension#php 5.3+
Database changesTemplate:Extension#needs-updatephp No
LicenseTemplate:Extension#license GNU General Public License 2.0 or later
Download
ParametersTemplate:Extension#parameters

$wgRawHtmlNamespaces

TagsTemplate:Extension#tags
<html>

Translate the NamespaceHTML extension if it is available at translatewiki.net

Check usage and version matrix.

The NamespaceHTML extension allows raw HTML in specified namespaces. It is intended to work just like the $wgRawHtml setting. The difference is that this extension allows specifying which namespace(s) should be able to contain raw HTML, which allows administrators to restrict raw HTML to namespaces with sufficient edit protections.

Usage[edit]

Embed raw html within <html>...</html> tags. See this page for more information.

As a template[edit]

The extension allows inclusion from namespaces where HTML is allowed to namespaces where HTML is not. You can create a custom script namespace and allow HTML in that namespace. Then you can create pages in the script namespace that contain safe scripts which can be transcluded into any page.

Technically, you can use the #tag parser function to pass parameters to the template. See here for an example. However, it is a better idea to use the Widgets extension for that.

Widget examples[edit]

Installation[edit]

  • Download and place the file(s) in a directory called NamespaceHTML in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php:
    require_once "$IP/extensions/NamespaceHTML/NamespaceHTML.php";
    
  • Configure as required. Note Note: $wgRawHtmlNamespaces= array(); must be set!
  • YesY Done - Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

Configuration[edit]

$wgRawHtmlNamespaces
An array of namespaces where raw HTML should be enabled. See this page for more information about namespace constants. For example:
$wgRawHtmlNamespaces= array( NS_PROJECT ); # allow raw HTML but only in the Project namespace

See also[edit]