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
Last 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

Check usage (experimental)

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.

Contents

[edit] Installation

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.

[edit] Usage

[edit] Basic

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".

[edit] Custom Text

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.

[edit] The "go" Paramater

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!

[edit] CSS Styles

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.

[edit] Going Forward

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.

[edit] Translations

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:

[edit] Known Bugs

  • 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!

[edit] Notes

  • Does not parse wikitext.
Personal tools
Namespaces

Variants
Actions
Navigation
Support
Download
Development
Communication
Print/export
Toolbox