Extension:Call

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

Release status: unmaintained

Implementation Special page
Description Allows to create a hyperlink to a template (or to a normal wiki page) with parameter passing
Author(s) Gero Scholz (Algorithmixtalk)
Latest version 1.2 (2009-05-27)
MediaWiki 1.18+
Database changes No
License No license specified
Download Template:WikimediaDownload/svn
Example dpldemo website

Translate the Call extension if it is available at translatewiki.net

Check usage and version matrix; code metrics

The Call extension allows to create dynamic wiki pages by passing parameters. It can be used at the browser's command line or within wiki text.

Installation[edit | edit source]

  • Copy the code into files and extract the file(s) in a directory called Call in your extensions/ folder. If you're a developer and this extension is in a Git repository, then instead you should clone the repository.
  • Add the following code at the bottom of your LocalSettings.php:
require_once "$IP/extensions/Call/Call.php";
  • Done! Navigate to "Special:Version" on your wiki to verify that the extension is successfully installed.

Usage[edit | edit source]

Write something like

 [[Special:Call/MyTemplate,size=big,color=green,good morning!]]
 [[Special:Call/:MyArticle,size=big,color=green]]

in a wiki article or type

 http://mywiki/index.php?title=Special:Call/MyTemplate,size=big,color=green,hello!
 http://mywiki/index.php?title=Special:Call/MyTemplate&size=big&color=green,nice day
 http://mywiki/index.php?title=Special:Call/:MyArticle,size=big,color=green,see you later.
 http://mywiki/index.php?title=Special:Call/:MyArticle&size=big&color=blue&good night!

Within template 'MyTemplate' or within article 'MyArticle' you reference parameters (by name or number) in the normal way:

 ... arbitrary text ...
                 {{{1|}}}
                 Size is {{{size}}}, using {{{color}}} color.
 ... arbitrary text ...
Why should one do this?
  • Think of a 'menu page' where the user selects an option and you want to forward him to a wiki page depending on that option.
  • Did you develop a wiki template? Call it directly from the browser command line and pass parameters to test it.
  • Think of an article which contains a form (combo boxes, user input fields). Once the user has filled in the form you perform the desired action and then call the same article again so that the user can modify his input and try a second time (a good example for this technique can be found on the dpldemo website.

See also[edit | edit source]