Extension:NamespaceHTMLSCRIPT

From MediaWiki.org
Jump to navigation Jump to search
MediaWiki extensions manual
OOjs UI icon advanced.svg
NamespaceHTMLSCRIPT
Release status: experimental
Implementation Tag
Description Allows raw HTML & PHP include in specified namespaces
Author(s) Ike Hecht, modified by François Zajéga (frankiezafetalk)
Latest version 0.2 (January 2016)
MediaWiki 1.23+, likely earlier versions as well
PHP 5.3+
Database changes No
License GNU General Public License 2.0 or later
Download NamespaceHTMLSCRIPT on bitbucket
$wgRawHtmlScriptNamespaces
<html>, <script>
Translate the NamespaceHTMLSCRIPT extension if it is available at translatewiki.net
Check usage and version matrix.

The NamespaceHTMLSCRIPT extension allows raw HTML & PHP includes in specified namespaces. It is based on the NamespaceHTML extension.

WARNING:
This extension allows editors to add plain PHP calls in content! Use carefully!

Usage[edit]

  • Embed raw html within <html>...</html> tags. See this page for more information.
  • Embed php code within <script>...</script> tags.
Example

<script> echo "NamespaceHTMLSCRIPT is activated"; </script>

Installation[edit]

  • Download, extract and place the file(s) in a directory called NamespaceHTMLSCRIPT in your extensions/ folder.

Note Note: $wgRawHtmlScriptNamespaces= array(); must be set!

  • Yes Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.tt

Configuration[edit]

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

Todo[edit]

  • Convert PHP output to HTML on save.
  • Disable tag depending on usergroups

See also[edit]