Extension:BrowserHistoryLink

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

Release status: stable

Implementation Tag
Description Adds a tag to create a link with a JavaScript event to go forward or back in the client's web browser.
Author(s) Techjartalk
Latest version 1.1 (8-02-2009)
MediaWiki 1.5+
PHP 5.2.3+
License Public domain
Download .zip .tar.gz
README
ChangeLog
Tags
<historylink>
Hooks used
ParserFirstCallInit

Translate the BrowserHistoryLink extension if possible

Check usage and version matrix; code metrics

The BrowserHistoryLink extension adds a <historylink> tag to create a link with a JavaScript event that takes the client forward or back in the browser history.

Installation[edit | edit source]

You must have PHP 5.2.3 or above for this extension to work correctly!

  1. Create the directory "BrowserHistoryLink" in your extensions directory.
  2. Download and extract the files to this new directory.
  3. Add the following line to LocalSettings.php:
    require_once("$IP/extensions/BrowserHistoryLink/BrowserHistoryLink.php");
    
  4. Check Special:Version to make sure the extension was registered correctly.

Usage[edit | edit source]

Basic[edit | edit source]

To add the link, add a <historylink> with type parameter set to "forward" or "back" on a wiki page. Example:

<historylink type="back" />

This outputs the default link text "« Go Back".

Custom Text[edit | edit source]

For custom link text, use this code (link text can be anything):

<historylink type="back">Go Back 1 Page</historylink>

This outputs the link text "Go Back 1 Page", or whatever is between the opening and closing tags.

The "go" Paramater[edit | edit source]

Use this code to go back 3 pages, or whatever "go" is set to:

<historylink type="back" go="3" />

Note: The "go" paramater can not be less than 1!

CSS Styles[edit | edit source]

The tag also has a "style" paramater that can contain CSS style information. Example:

<historylink type="back" style="font-weight:bold; font-size:13pt;" />

This will output a link that looks like « Go Back.

Going Forward[edit | edit source]

To go forward instead of back, use this code:

<historylink type="forward" />

It will output the link text "Go Forward »".
Note: All above parameters are also supported on "forward", including custom link text!
Note 2: Default link text may be different depending on your language.

Translations[edit | edit source]

New translations of the messages are welcome! If you make a new translation, please post the source code for the new translation on the talk page. Here's the list of current translations:

Known Bugs[edit | edit source]

  • Does not allow for HTML character escape codes. (e.g. &lt;, &#171;, ect.) Bug fixed!
  • Won't show messages in other languages. Bug fixed!
  • "go" parameter not working. Bug fixed!

Notes[edit | edit source]

  • Does not parse wikitext.