Working With MediaWiki

Read Online Working With MediaWiki by Yaron Koren - Free Book Online Page B

Book: Working With MediaWiki by Yaron Koren Read Free Book Online
Authors: Yaron Koren
Ads: Link
useful:
https://www.mediawiki.org/wiki/Extension:MultiUpload
    Finally, uploads are possible via Semantic Forms. Uploading from within a form has the advantage that the name of the file gets automatically placed on the page after it’s uploaded, so that users don’t need to do the second step of inserting a tag to display the image/file on the wiki page after they’ve uploaded it. For more on this option, see Chapter 17 .

Displaying images
    Images are generally displayed by simply linking to the image — which is a somewhat unexpected syntax. Let’s say there’s an image on the wiki called “Easter Island.png”. The simplest way to display it is to just have the following:
[[Image:Easter Island.png]]
    Alternatively, you could have this instead, since “Image” and “File” are aliases for the same namespace:
[[File:Easter Island.png]]
    For the rest of this example, we’ll just use “Image”.
    There are various additional settings you can apply to images: the height and width, the horizontal and vertical alignment, the caption, where the image links to, whether to place a border, etc. These are all parameters that can be added to the image tag, separated by pipes. Some are named, while others are unnamed.
    Here’s an example of an image display with more parameters set:
[[Image:Easter Island.png|100px|x150px|right|link=Easter Island info|This is Easter Island.]]
    The parameters can be passed in in any order, so the parser determines what parameter each value corresponds to, based on the specific text in each (except for a few named parameters like “link=”). A “px” value without an “x” at the beginning sets the width, while one with an “x” at the beginning sets the height. “
right
” here controls the horizontal alignment of the image — the other options are “
left
”, “
center
” and “
none
”.
    The “
link=
” parameter sets the location that the image links to — it can be either a wiki page or a URL. By default, an image links to its own page.
    The last parameter, unless it’s obviously something else, sets the caption for the image.
    The only other very important setting for images is being able to display a thumbnail— most of the time, when images are displayed, it’s actually a thumbnail that’s shown, rather than the full-size image. To display an image as a thumbnail, just add the parameter “
|thumb
” to the image tag.
    What if you just want to link to an image, rather than display it? You can either link to the wiki page for the image, or to the image itself. To link to the image’s wiki page, just add a colon at the beginning of the link, so it looks like:
[[:Image:Easter Island.png]]
    If instead you want to link directly to the image, use the “Media” namespace instead, which exists just for this purpose. You could do:
[[Media:Easter Island.png|Click here to see a great picture.]]
    There’s more customization that can be done of image display. This page has all the details, as well as a lot of helpful demos:
https://www.mediawiki.org/wiki/Help:Images

Image galleries
    The built-in MediaWiki tag lets you display a group of images in one place. It takes in a group of image names and, optionally, their captions (which can include wikitext); a call to it would look like the following:

Image:Monkey.png
Image:Rhesus monkey.jpg|This is a [[rhesus monkey]]
Image:Large monkey.gif|This is a ''large'' monkey

    Newlines here separate the names of the images.
    In addition, if you’re using Semantic MediaWiki, the “gallery” query format defined in the extension Semantic Result Formats lets you display a similar result via a semantic query, so that you don’t have to hard-code the image names; see here .

Displaying outside images
    By default, images from outside the wiki cannot be displayed. That’s for several reasons, the most important of which is that a malicious user can place an external image on a wiki page, then collect

Similar Books

Southland

Nina Revoyr

REAPER'S KISS

Jaxson Kidman

The Night People

Edward D. Hoch

Black Knight in Red Square

Stuart M. Kaminsky

Strike Back

Chris Ryan

Autumn Calling

T. Lynne Tolles

The Wicked Girls

Alex Marwood