Template:Image label begin/doc: Difference between revisions

i don't think miraheze will let me import it so here's copy-paste instead
(Document link= and alt=.)
(i don't think miraheze will let me import it so here's copy-paste instead)
 
(23 intermediate revisions by 14 users not shown)
Line 1:
{{Documentation subpage}}
<!-- Explicit new line here -->
{{notice|Please keep both widths and scales greater than zero and exactly the same in each template. For example, if width is 300, then all the scales must also be 300. Thanks.<!-- See http://en.wikipedia.org/w/index.php?title=Template_talk%3ALanarkshire_and_Ayrshire_Railway_Map&diff=165876967&oldid=165872467 -->}}
<includeonly>[[Category:Labelled image map templates|{{PAGENAME}}]]</includeonly>
{{notice|For a simpler and more general alternative to this template, see {{[[Template:annotated image|annotated image]]}}<br />For a different style, simpler, and more general alternative, see {{[[Template:overlay|overlay]]}}.}}
{{notice|There are far too many labelled image templates with widths and scales of -1 or are inconsistent. Please don't do that. Keep both widths and scales greater than zero and exactly the same in each template. For example, if width is 300, then all the scales must also be 300. Thanks.}}
<center><div style="text-align: center; border: 1px dashed black; width: 50px;">[http://en.wikipedia.org/w/index.php?title=Template_talk%3ALanarkshire_and_Ayrshire_Railway_Map&diff=165876967&oldid=165872467 Fix]</div></center>
 
This [[Wikipedia:Templates|template]] is a [[Wikipedia:Manual of Style/Self-references to avoid|self-reference]] and thus is part of the Wikipedia project rather than the encyclopaedic content.
:'''''For a simpler and more general alternative to this template, see {{[[Template:annotated image|annotated image]]}}.'''''
:'''''For a different style, simpler, and more general alternative, see {{[[Template:overlay|overlay]]}}.'''''
 
This template will automatically categorise the current template into: [[:Category:Labelled map templates]].
This [[Wikipedia:Template|template]] is a [[Wikipedia:Avoid self-references|self-reference]] and so is part of the Wikipedia project rather than the encyclopaedic content.
==Usage==
 
This template will automatically categorise the current template into: [[:Category:Labelled image map templates]].
<!--
A div within a div is used to avoid the labels offsetting a little higher than expected when floating left or right:
* <tt><nowiki><div style="float: {{{float|none}}}; clear: {{{float|none}}};"></nowiki></tt>
* <tt><nowiki><div style="position: relative;"></nowiki></tt>
 
Template page may need to be reloaded once to eliminate the slight horizontal offset.
 
Line height style in div distorts label locations
-->
{{usage div}}<div style="float:right; margin-right: 5px; "><span class="plainlinksneverexpand">[[:Template:{{PAGENAME}}|Template:{{ucfirst:{{PAGENAME}}}}]]&#160;<tt>(</tt><small>[{{fullurl:Template:{{PAGENAME}}|action=edit}} edit]&#160;[[:Template talk:{{PAGENAME}}|talk]]&#160;[{{fullurl:Special:Whatlinkshere/Template:{{PAGENAME}}|limit=500}} links]&#160;[{{fullurl:Template:{{PAGENAME}}|action=history}} history]</small><tt>)</tt></span></div>{{-}}<br>
:::<code>''This [[Wikipedia:Template|template]]'s documentation is [[Wikipedia:Template doc page pattern|transcluded]] from [[:en:Template:Image label begin/doc]]'' [<span class="plainlinks">[{{fullurl:Template:Image_label_begin/doc|action=edit}} edit]</span>].</code>
 
<noinclude>
{{#if:
|<!-- reconstruction of original Template:Template doc page pattern (now the redirected to " Template:Documentation subpage") template... ca mid-November 2007 -->
<table class="messagebox" style="line-height:1.1em;" style=" background:#f9f9b7;">
<tr> <td rowspan="3" style="width:60px;text-align:center;" > [[Image:Edit-paste.svg|40px]]</td>
<td> This is the [[Wikipedia:Template documentation|template documentation]]<!--
--> page for [[{{NAMESPACE}}:{{BASEPAGENAME}}]].</td></tr>
<tr><td><small>This page may not be intended to be viewed directly. <br/
>Links using [[Help:Variable|variable]]s may appear broken; do not replace these with [[hardcoded]] page names or URLs.</small></td></tr>
</table>{{#if:x|<!-- skip --->|[[Category:Template documentation|{{PAGENAME}}]]
}}<!-- Please retain the above original template...
 
There are templates formulated to [[WP:DPP]] that need this.
 
Of course, if you all want to start updating all the interwiki exported templates, go on making things more incompatible... queries to User:Fabartus.
 
--->
|{{#ifeq: {{lc:{{SUBPAGENAME}}}} | doc
| <!-- doc page -->
{{
#ifeq: show | show
| <div class="messagebox" id="template_doc_page_viewed_directly" style="padding-left:1ex;">'''This is a [[Wikipedia:Template documentation|documentation]] [[Wikipedia:Subpages|subpage]] for [[{{SUBJECTSPACE}}:{{BASEPAGENAME}}]]''' <small>(see that page for the {{ #if: {{SUBJECTSPACE}} | {{lc:{{SUBJECTSPACE}}}} | article }} itself)</small>.<br />It contains usage information, [[Wikipedia:Categories|categories]] and other content that is not part of the original {{ #if: {{SUBJECTSPACE}} |{{lc:{{SUBJECTSPACE}}}} page|article}}. </div>
}}{{DEFAULTSORT:{{PAGENAME}}}}{{
#if:
| <!-- skip -->
| [[Category:{{
#if: {{SUBJECTSPACE}}
| {{SUBJECTSPACE}}
| Article
}} documentation]]
}}
|<!-- if not on a /doc subpage, do nothing -->
}}}}
</noinclude>
<!-- EDIT TEMPLATE DOCUMENTATION BELOW THIS LINE -->
 
<includeonly>;</includeonly><noinclude>===</noinclude>How to use<noinclude>===</noinclude>
Consider this example, adapted from [[Template:Australia Labelled Map]]:
<pre style="overflow:auto;">
{{Image label begin|image=Australia location map recolored.png|width=400|float=none
|alt=Australia map. Western Australia in the west third with capital Perth, Northern Territory in the north center with capital Darwin, Queensland in the northeast with capital Brisbane, South Australia in the south with capital Adelaide, New South Wales in the northern southeast with capital Sydney, and Victoria in the far southeast with capital Melbourne. Tasmania, with capital Hobart, is off the coast of Victoria, across the Bass Strait. The Indian Ocean is to the west and northwest, the South Pacific Ocean to the east, the Southern Ocean to the south, and the Tasman Sea to the southeast. The Great Australian Bight to the south and the Gulf of Carpentaria to the north are the major bays. The Timor and Arafura Seas are off the north coast, and the Great Barrier Reef guards the northeast coast from the Coral Sea.}}
|width={{{width|}}}
{{Image label small|x=0.26|y=0.345|scale=400|text=[[Western Australia|Western<br/>Australia]]}}
|font-size=85%}}
{{Image label small|x=0.46|y=0.20|scale=400|text=[[Northern Territory|Northern<br/>Territory]]}}
{{Image label small|scale={{{width|}}}|x=0.50526 |y=0.4025|scale=400345 |text=[[SouthWestern Australia|SouthWestern<br/>Australia]]}}
{{Image label|scale={{{width|}}}|x=0.46 |y=0.20 |text=[[Northern Territory|Northern<br/>Territory]]}}
{{Image label|scale={{{width|}}}|x=0.505|y=0.4025|text=[[South Australia|South<br/>Australia]]}}
...
{{Image label end}}
</pre>
 
==Parameters==
<div style="float:right;">__TOC__</div>
===width/scale===
 
A number of pixels. Default is 400.
;Width/Scale
In this example, '''all widths must be set to the same number''' of 400 as the default width.
They must all be the same number of 400 for the template to be <u>functionally scalable</u>.
This means they can be displayed at a different size by supplying a width parameter to the template when in use.
For example, ''&#123;{Australia Labelled Map|width=500}}'' will display the labelled image as a larger one of 500 pixels in width instead of 400.
 
If {{para|width}} is given for <nowiki>{{image label begin}}</nowiki>, '''the same value must be given as {{para|scale}}''' for <nowiki>{{image label}}</nowiki>, or the labels will become misaligned if the image is resized. When used in a template, the simplest way to ensure this is by passing through the same parameter, as in the example. For example, ''&#123;{Australia Labelled Map|width=500}}'' displays the labelled image as a larger one of 500 pixels in width instead of the default, 400.
To change the default size, search and replace
"<tt><span style="color: red;">{&#123;{width|400}}}</span></tt>"
with
"<tt><span style="color: red;">{&#123;{width|500}}}</span></tt>".
 
For earthly geographic maps, conforming to these specifications can allow easier conversion to for any other purposes such as for the use of {{tl|Location map+}}.
 
===x/y===
<includeonly>;</includeonly><noinclude>===</noinclude>X/Y<noinclude>===</noinclude>
 
X values are always between 0 and 1. For square images, Y values are also between 0 and 1. The maximum Y value is higher for tall images, lower for wide images. The X and Y values represent the fraction of the width where the label will be placed. The exact point is the top-left corner of the image label.
X and Y values are always between 0 and 1.
x=0 |y=0 will place the top-left corner of the label at the top-left of a square image
They represent the percentages of the width and height respectively where the label will be placed.
The x=0 exact point|y=1 is will place the top-left corner of the image label. at the bottom-left of a square image
x=01 |y=01 will place the top-left corner of the label at the topbottom-leftright of a of thesquare image
x=01 |y=10 will place the top-left corner of the label at the bottomtop-leftright of thea square image
x=1 0.5|y=1 0.5 will place the top-left corner of the label at the bottom-rightcentre of thea square image
x=1 |y=0 will place the top-left corner of the label at the top-right of the image
x=0.5|y=0.5 will place the top-left corner of the label at the centre of the image
 
===image===
<includeonly>;</includeonly><noinclude>===</noinclude>Image<noinclude>===</noinclude>
 
The title of the wiki page of the image without the "Image:" prefix.
 
===text===
<includeonly>;</includeonly><noinclude>===</noinclude>Text<noinclude>===</noinclude>
 
The text label to display as wiki markup.
 
===float===
<includeonly>;</includeonly><noinclude>===</noinclude>Float<noinclude>===</noinclude>
 
Three options:
{&#123;{float|=none}}} makes the image sit on its own line of the page by (default)
{&#123;{float|=left}}} makes the image pushed to the left of the page by default
{&#123;{float|=right}}} makes the image pushed to the right of the page by default
 
===font-size===
<includeonly>;</includeonly><noinclude>===</noinclude>link<noinclude>===</noinclude>
 
Optional. If given, specifies a font size for the labels. For example, {{para|font-size|85%}} displays labels in a smaller font size. If omitted, font size will inherit from surrounding content.
Specifies where the image should link to. If <code>File:</code> (the default), the image links to its file page. If empty, the image does not link to anything; this is appropriate for [[WP:ALT #Purely decorative images|purely decorative images]].
 
{{para|font-size}} can also be set on each individual <nowiki>{{image label}}</nowiki> to adjust the font size for that label.
<includeonly>;</includeonly><noinclude>===</noinclude>alt<noinclude>===</noinclude>
 
===text-align===
Specifies text to be used in the image's "alt" attribute. If {{para|link}} is empty, this should be empty; if {{para|link}} is <code>File:</code> or is not given, this should describe the image; if {{para|link}} points to some other page this should describe the action that will be taken if you click on the image. See ''[[Wikipedia:Alternative text for images]]''.
 
Optional. If given, affects the line-by-line alignment within labels with line breaks. If omitted, the default text alignment is centered.
<includeonly>;</includeonly><noinclude>===</noinclude>caption<noinclude>===</noinclude>
 
===link===
 
Specifies where the image should link to. If <code>File:</code> (the default), the image links to its file page. If empty, the image does not link to anything; this is appropriate for [[MOS:PDI|purely decorative images]].
 
===alt===
 
Specifies text to be used in the image's "alt" attribute. If {{para|link}} is empty, this should be empty; if {{para|link}} is <code>File:</code> or is not given, this should describe the image; if {{para|link}} points to some other page this should describe the action that will be taken if you click on the image. See [[Wikipedia:Manual of Style/Accessibility/Alternative text for images]].
 
===caption===
 
Specifies text to be used in the image's "title" attribute.
In certain browsers, this text will appear in a tooltip when the mouse pointer is rolled over it.
</div>
 
==Template set==
* &#123;{[[Template:Image label begin{tlx|Image label begin]]|image{{=}}Example.png|width{{=}}400|float{{=}}right}}
** {{tl|Image label start}} (template redirect to <nowiki>{{Image label begin}}</nowiki>)
* &#123;{[[Template:Image label{tlx|Image label]]|x{{=}}0.25|y{{=}}0.75|scale{{=}}400|text{{=}}&#91;[Wikipedia]]}}
** {{tl|Image label small}} (deprecated, use {{para|font-size|85%}} on <nowiki>{{Image label begin}}</nowiki> or <nowiki>{{Image label}}</nowiki> instead)
* &#123;{[[Template:Image label small|Image label small]]|x=0.25|y=0.75|scale=400|text=&#91;[Wikipedia]]}}
* {{tltlx|Image label end}}
 
==Tool==
* [http://mujibab.googlepages.com/labelledimageeditor Labelled Image Editor]
** '''Labelled Image Editor 2''' - ''Coming Soon'' -- [[User:Zondor|Zondor]] 07:38, 24 October 2007 (UTC)
 
==Sample labelled images==
{{hidden begin|titlestyle=text-align:center|border=#aaa 1px solid|title = list}}
{{Silent|
{{div col|colwidth=30em}}
<div style="font-size: 8pt;">
{{Col-begin}}
{{Col-1-of-3}}
* {{tl|Africa Labelled Map}}
* {{tl|Armenia Labelled Map}}
* {{t1tl|Asia Labelled Map}}
* {{tl|AtL Labelled Map}}
* {{tl|Australia Labelled Map}}
** {{tl|Australian Capitals Labelled Map}}
Line 150 ⟶ 97:
* {{tl|Bulgaria Provinces}}
* {{tl|Brazil Labelled Map}}
* {{tl|CaribbeanBrunei Labelled Map}}
* {{tl|CaucasusCambodia Labelled Map}}
* {{tl|Chile Labelled Map}}
* {{tl|Colombia Labelled Map}}
* {{tl|Dhaka City Labelled Map}}
Line 159 ⟶ 105:
** {{tl|Cornwall Labelled Map}}
** {{tl|England Ceremonial Counties Labelled Map}}
** {{tl|Leicestershire Labelled Map}}
* {{tl|Europe Labelled Map}}
* {{tl|European Union Labelled Map (blue)}}
* {{tl|European Union Labelled Map (brown)}}
* {{tl|EurovisionEurozone Labelledlabelled Mapmap}}
* {{tl|Eurozone Labelled Map}}
* {{tl|France Regions Labelled Map}}
* {{tl|Fußball-BundesligaGaza teamsStrip 07-08labelled Labelled Mapmap}}
* {{tl|Gaza Strip Labelled Map}}
{{Col-2-of-3}}
* {{tl|Georgia Labelled Map}}
* {{tl|IBL}}
* {{tl|India States and Territories Labelled Map}}
* {{tl|Indonesia provinces labelled map}}
* {{tl|IraqIsrael footballLabelled labelled mapMap}}
** {{tl|IranIsrael footballGeographical labelled mapMap}}
* {{tl|Jericho TV series map}}
* {{tl|La Liga teams map 2006-07}}
* {{tl|La Liga teams map 2007-08}}
* {{tl|La Liga teams map 2008-09}}
* {{tl|Lebanon Labelled Map}}
* {{tl|Middle-earthMalaysia Labelled Map}}
** {{tl|PeruJohor Labelled Map}}
** {{tl|PolandPahang Labelled Map}}
** {{tl|Penang district level labelled map}}
** {{tl|Perak Labelled Map}}
** {{tl|Selangor Labelled Map}}
** {{tl|Sabah Labelled Map}}
** {{tl|Sarawak Labelled Map}}
** {{tl|Terengganu Labelled Map}}
* {{tl|Nepal province labelled map}}
* {{tl|Peru Labelled Area Map}}
* {{tl|Poland Labelled Map Small}}
* {{tl|Provinces of Iran Labelled Map}}
** {{tl|Mazandaran Labelledlabelled Mapmap}}
** {{tl|Hamedan Labelled Map}}
** {{tl|Chahar Mahal and Bakhtiari Labelled Map}}
** {{t1tl|Neighborhoods of Tehran metropolis Labelled Map}}
** {{t1tl|Persian Gulf Cup 2007-08 Labelled Map}}
** {{t1tl|Iran Ethnic Groups Labelled Map}}
* [[Qingzang railway/Map]]
* {{tl|Schengen Agreement Labelled Map}}
* {{tl|Shanghai Labelled Map}}
* {{tl|Singapore Urban Planning Areas Labelled Map}}
* {{tl|South America Labelled Map}}
{{Col-3-of-3}}
* {{tl|Switzerland Cantons Labelled Map}}
* {{tl|Sydney Urban Areas Labelled Map}}
* {{tl|Syria Labelled Map}}
** {{tl|Al-Hasakah Labelled Map}}
** {{tl|Aleppo Labelled Map}}
** {{tl|Ar-RaqqahRaqqa Labelled Map}}
** {{tl|AsAl-Suwayda Labelled Map}}
** {{tl|Daraa Labelled Map}}
** {{tl|Deir ez-Zor Labelled Map}}
Line 216 ⟶ 158:
** {{tl|Crimea Labelled Map}}
* {{tl|United States Labelled Map}}
** {{tl|New York City Labelled Map}}
**[[User:ComputerGuy890100/Western US Map]]
* [[User:Henry Flower/Map]]
* {{tl|West Bank Labelled Map}}
* {{tl|World Labelled Map}}
{{div col end}}
* {{tl|Yugoslavia Labelled Map}}
{{Col-hidden end}}
 
Silent ends|}}
== Tracking categories ==
</div>
* {{Category link with count|Pages using image label with a wide image}}
* {{Category link with count|Pages using image label with a tall image}}
<includeonly>
{{#ifeq:{{FULLPAGENAME}} |Template:Image label begin |[[Category:Map formatting and function templates]]}}
</includeonly>
Administrators, verified
2,599

edits