Help:Navigational image
From Wikipedia, the free encyclopedia
This is a copy of the master help page at Meta. Do not edit this copy.
Edits will be lost in the next update from the master page. See below for more information.
Template:Phh:Navigational image
- If you are not reading this in Meta it is advised that you go there to view this page otherwise some links in this page will not work
Although not a 'feature' of the MediaWiki software, an image can be made to link to a specified page if desired.
Some people find trawling through this page understandably confusing, so here is the short version:
- You can use the re-direct feature on an image page, but when used, the target page shows all sorts of unwanted information that gets transcluded from the image page itself.
- For MediaWiki sites that support the embedding of external_images (which is basically all MediaWiki websites except the Wikipedia and Meta) you can use the 'clickpic' template. See that link for information on how to use it.
For website such as Wikipedia that preclude the use of embedding external images you can superimpose hyperlinks onto images.None of the methods outlined below work on Wikipedia as of December 2006.
For more detailed explanations, see below.
Contents |
Method 1: Employing image redirects
One way to do this is by putting a redirect on the image page. For example, on Meta the internal image Image:Catapult.jpg links to the page Help:Redirect. The image from Commons, redirecting on Meta to the Main Page, is not displayed.
If the redirect is within the same project, then a redirect message with a link to the image page (MediaWiki:Redirectedfrom) is inserted on the target page.
To use the same image on another page without a redirect or with a different target, a copy of the image has to be uploaded under another name. However, an image on Commons may have its own image page on each project, e.g. , which could have a redirect on the image page on this project, which would then be accessible by the link http://en.wikipedia.org../../../z/u/i/Image%7EZuid_Holland-Position.png_0ca5.html.
Method 2: Using the external link format
In projects that allow the embedding of external_images (in which case you see images in the lefthand column of the table below) there are the following possibilities:
(The image can be an internally or externally held image, and the target can be an external URL or a wiki page).
What it looks like | What you type |
---|---|
An external image linking to an external page, image, etc.: |
[http://www.google.com http://www.google.com/images/logo.gif] |
An external image linking to an internal page: |
[[Help:Redirect|http://www.google.com/images/logo.gif]] |
An external image linking to an internal page with external link style, with : |
[{{SERVER}}{{localurl:Help:Redirect}} http://www.google.com/images/logo.gif] |
An internal image linking to an internal page with external link style: |
[{{SERVER}}{{localurl:Help:Redirect}} http:../upload/b/bc/Wiki.png] [[:Image:wiki.png]] |
If you don't want the small icon indicating it is an external link to appear, because it is actually an internal link (and looks untidy), you can surround the image link with code to suppress it. This will be most useful to people running their own corporate or independent wikis, rather than Wikimedia sites. |
<span class="plainlinks">[{{SERVER}}{{localurl:Help:Redirect}} http:../upload/b/bc/Wiki.png]</span>
|
To make it easy to create navigational images based on the above method, a template can be employed. In this example a template called 'clickpic' is created that takes two parameters: target page name and image path. ('clickpic' template not to be confused with 'click' template mentioned in Method 3). Template:Clickpic For more info on using this template, see User:CharlesC/Template for navigational images on Mediawiki websites. Now you can easily have proper internal linking with images in MediaWiki sites - hooray! |
<span class="plainlinks">[{{SERVER}}{{localurl:{{{1}}}}} {{{2}}}]</span>
{{clickpic|Main Page|http:../upload/b/bc/Wiki.png}}
|
Thumbnail
One application is linking a small version of an image to a large one. Example where both are external:
[http://pennine.demon.co.uk/photos/seakayak/xga/Lunga-P7-100-3086.jpg http://pennine.demon.co.uk/photos/seakayak/small/Lunga-P7-100-3086.jpg]
gives
http://pennine.demon.co.uk/photos/seakayak/small/Lunga-P7-100-3086.jpg
The alternate text is the name of the image, after the last slash in the URL. If you have control over the image, give it a meaningful name; you could even include a text like "click to enlarge" in the name.
Method 3: Superimposing a linked text onto an image
A linked text can be superimposed onto an image, see Help:Composite images. In particular there can be a dummy text such as an character in a very large font, covering the whole image.
Using m:Template:navimg (talk, backlinks, edit):
top{{navimg|xsize=50|ysize=50|image=Wikimedia-logo.svg|link=MediaWiki}}bottom gives:
topTemplate:Navimgbottom
Similarly with m:Template:navimgx (talk, backlinks, edit) for an external link:
topTemplate:Navimgxbottom
However, if the browser is set to ignore font sizes specified in web pages then only part of the area in the image links to the specified page, and the rest of the image to the image page. Check the hoverbox or status line to see the target at any position of the mouse cursor. Some versions of the template have the same hoverbox for the two areas.
The image cannot be inline. Positioning can be done e.g. with a table.
See also:
See also
- Navigational maps
- Help:Composite images - Allows superimposing a linked text onto an image.
edit |
Wikipedia-specific help
Template:Ph:Navigational image
This page is a copy of the master help page at Meta (for general help information all Wikimedia projects can use), with two Wikipedia-specific templates inserted. To update the main text, edit the master help page for all projects at m:Help:Navigational image. For Wikipedia-specific issues, use Template:Ph:Navigational image (the extra text at the bottom of this page) or Template:Phh:Navigational image for a Wikipedia-specific lead (text appears at the top of this page). You are welcome to copy the exact wikitext from the master page at Meta and paste it into this page at any time. To view this page in other languages see the master page at Meta.
Categories: Editor handbook | Mediawiki Hacks