Extension:LandingPage

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

Release status: experimental

Implementation Parser function
Description Follows redirections to landing page
Author(s) John Erling Blad
Last version 0.5 (2009-12-17)
License GPL
Download LandingPage.php, LandingPage.i18n.php
Check usage and version matrix

LandingPage is an extension to MediaWiki that includes in the rendered text of a page the title, user name or real name for the landing page of a redirect or a direct link.

Contents

Installation [edit]

  1. Download LandingPage.php and LandingPage.i18n.php, and save them in extensions/LandingPage directory on your wiki.
  2. Insert this line in the LocalSettings.php file:
    include_once('extensions/LandingPage/LandingPage.php');
    

Usage [edit]

{{LANDINGPAGE
[page|redirect]|[alt]}} : Reports the page name of the final landing page.
{{LANDINGSUBPAGE
[page|redirect]|[alt]}} : Reports the page name of the subpage name of the final landing page.
{{LANDINGPREFIXED
[page|redirect]|[alt]}} : Reports the page name of the prefixed name of the landing page.
{{LANDINGUSER
[page|redirect]|[alt]}} : Reports the page name of the user name of the final landing page, reports error if the final page is not a user page.
{{LANDINGREALUSER
[page|redirect]|[alt]}} : Reports the page name of the real user name of final landing page, reports error if the final page is not a user page.

If the name of the parser function is prepended with "LINK", then a link to the page is created instead of the name. The alternate text will not be transformed into a link.

One single level of redirects will be traversed, not more, and it is legal to point directly to the final page. This makes the parser functions somewhat fail proof in a scenario where pages moves around.

Examples [edit]

Assume there is a redirect [[worker]] pointing to the user page [[User:FBar]], with this user having a realname of "Foo Bar".

LANDINGPAGE
 {{LANDINGPAGE:worker}} → FBar
LANDINGPAGE
 {{LINKLANDINGPAGE:worker}} → [[worker|FBar]]
LANDINGREALUSER
 {{LANDINGREALUSER:worker}} → Foo Bar
LANDINGREALUSER
 {{LINKLANDINGREALUSER:worker}} → [[worker|Foo Bar]]

Alternatives [edit]

Not known

See also [edit]

Feedback [edit]

Use the discussion page for feedback, questions, feature requests and bug reports.