Open main menu

Extension:AnchorHandler

MediaWiki extensions manual
OOjs UI icon advanced.svg
AnchorHandler
Release status: beta
Implementation Tag
Description Allows inserting <a> anchor tags into wikitext
Author(s) Ike Hecht (tosfostalk)
Latest version 0.2 (February 2018)
MediaWiki 1.29+
PHP 5.3+
Database changes No
License GNU General Public License 2.0 or later
Download
Parameters
$egAnchorNamespaces
Hooks used
ParserFirstCallInit
Translate the AnchorHandler extension if it is available at translatewiki.net
Check usage and version matrix.

The AnchorHandler extension allows inserting <a> anchor tags into wikitext. By default, it simply passes through the text within the <a>...</a> tags. It can be configured to actually parse and convert the anchor tags to working links in certain namespaces. This is especially helpful when importing raw HTML into a wiki.

InstallationEdit

  • Download and place the file(s) in a directory called AnchorHandler in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php:
    wfLoadExtension( 'AnchorHandler' );
    
  •   Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

To users running MediaWiki 1.24 or earlier:

The instructions above describe the new way of installing this extension using wfLoadExtension() If you need to install this extension on these earlier versions (MediaWiki 1.24 and earlier), instead of wfLoadExtension( 'AnchorHandler' );, you need to use:

require_once "$IP/extensions/AnchorHandler/AnchorHandler.php";

Configuration parametersEdit

$egAnchorNamespaces
Tells the extension to actually convert the anchor tags to links in the specified namespaces. Example:
$egAnchorNamespaces = array ( NS_MAIN );
See this list of namespace constants.

See alsoEdit