Template:Image label begin/doc: Difference between revisions
(Bypass list to eval whatlinkshere on the templates proper) |
(→How to use: try revising formatting to drop out section edit links) |
||
Line 16: | Line 16: | ||
Line height style in div distorts label locations |
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}}}}]] <tt>(</tt><small>[{{fullurl:Template:{{PAGENAME}}|action=edit}} edit] [[:Template talk:{{PAGENAME}}|talk]] [{{fullurl:Special:Whatlinkshere/Template:{{PAGENAME}}|limit=500}} links] [{{fullurl:Template:{{PAGENAME}}|action=history}} history]</small><tt>)</tt></span></div>{{-}}<br> |
|||
==How to use== |
|||
:::<code>''This {{wpd|Wikipedia:Template|Templates}} documentation is [[:{{WPD}}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 for [[Template:Australia Labelled Map]]: |
Consider this example for [[Template:Australia Labelled Map]]: |
||
{{Image label begin|width=<span style="color: red;"> |
{{Image label begin|width=<span style="color: red;">{{{width|400}}}</span>|image=<span style="color: green;">Australia location map recolored.png</span>|float=<span style="color: purple;">{{{float|none}}}</span>}} |
||
{{Image label small|scale=<span style="color: red;"> |
{{Image label small|scale=<span style="color: red;">{{{width|400}}}</span>|x=<span style="color: brown;">0.260</span>|y=<span style="color: brown;">0.3450</span>|text=<span style="color: blue;">[[Western Australia|Western Australia]]</span>}} |
||
{{Image label small|scale=<span style="color: red;"> |
{{Image label small|scale=<span style="color: red;">{{{width|400}}}</span>|x=<span style="color: brown;">0.480</span>|y=<span style="color: brown;">0.2000</span>|text=<span style="color: blue;">[[Northern Territory|Northern Territory]]</span>}} |
||
{{Image label small|scale=<span style="color: red;"> |
{{Image label small|scale=<span style="color: red;">{{{width|400}}}</span>|x=<span style="color: brown;">0.505</span>|y=<span style="color: brown;">0.4025</span>|text=<span style="color: blue;">[[South Australia|South Australia]]</span>}} |
||
... |
... |
||
{{Image label end}} |
{{Image label end}} |
||
<div style="float: right;">__TOC__</div> |
<div style="float: right;">__TOC__</div> |
||
;Width/Scale |
|||
In this example, '''all widths must be set to the same number''' of 400 as the default width. |
In this example, '''all widths must be set to the same number''' of 400 as the default width. |
||
Line 35: | Line 73: | ||
To change the default size, put the wiki markup in [[Notepad]], and search and replace |
To change the default size, put the wiki markup in [[Notepad]], and search and replace |
||
"<tt><span style="color: red;"> |
"<tt><span style="color: red;">{{{width|400}}}</span></tt>" |
||
with |
with |
||
"<tt><span style="color: red;"> |
"<tt><span style="color: red;">{{{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+}}. |
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+}}. |
||
<includeonly>;</includeonly><noinclude>===</noinclude>X/Y<noinclude>===</noinclude> |
|||
===X/Y=== |
|||
X and Y values are always between 0 and 1. |
X and Y values are always between 0 and 1. |
||
Line 52: | Line 90: | ||
x=0.5|y=0.5 will place the top-left corner of the label at the centre of the image |
x=0.5|y=0.5 will place the top-left corner of the label at the centre of the image |
||
<includeonly>;</includeonly><noinclude>===</noinclude>Image<noinclude>===</noinclude> |
|||
===Image=== |
|||
The title of the wiki page of the image without the "Image:" prefix. |
The title of the wiki page of the image without the "Image:" prefix. |
||
<includeonly>;</includeonly><noinclude>===</noinclude>Text<noinclude>===</noinclude> |
|||
===Text=== |
|||
The text label to display as wiki markup. |
The text label to display as wiki markup. |
||
<includeonly>;</includeonly><noinclude>===</noinclude>Float<noinclude>===</noinclude> |
|||
===Float=== |
|||
Three options: |
Three options: |
||
{{{float|none}}} makes the image sit on its own line of the page by default |
|||
{{{float|left}}} makes the image pushed to the left of the page by default |
|||
{{{float|right}}} makes the image pushed to the right of the page by default |
|||
</div> |
|||
==Template set== |
==Template set== |
Revision as of 15:20, 18 August 2008
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. |
This template is a self-reference and so is part of the Wikipedia project rather than the encyclopaedic content.
This template will automatically categorise the current template into: Category:Labelled image map templates.
This Template:Wpd documentation is [[:Template:WPDWikipedia:Template doc page pattern| transcluded]] from en:Template:Image label begin/doc [edit].
How to use
Consider this example for Template:Australia Labelled Map:
{{Image label begin|width={{{width|400}}}|image=Australia location map recolored.png|float={{{float|none}}}}} {{Image label small|scale={{{width|400}}}|x=0.260|y=0.3450|text=[[Western Australia|Western Australia]]}} {{Image label small|scale={{{width|400}}}|x=0.480|y=0.2000|text=[[Northern Territory|Northern Territory]]}} {{Image label small|scale={{{width|400}}}|x=0.505|y=0.4025|text=[[South Australia|South Australia]]}} ... {{Image label end}}
- 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 functionally scalable. This means they can be displayed at a different size by supplying a width parameter to the template when in use. For example, {{Australia Labelled Map|width=500}} will display the labelled image as a larger one of 500 pixels in width instead of 400.
To change the default size, put the wiki markup in Notepad, and search and replace "{{{width|400}}}" with "{{{width|500}}}".
For earthly geographic maps, conforming to these specifications can allow easier conversion to for any other purposes such as for the use of {{Location map+}}.
X/Y
X and Y values are always between 0 and 1. They represent the percentages of the width and height respectively where the label will be placed. The exact point is the top-left corner of the image label.
x=0 |y=0 will place the top-left corner of the label at the top-left of the image x=0 |y=1 will place the top-left corner of the label at the bottom-left of the image x=1 |y=1 will place the top-left corner of the label at the bottom-right of the 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
The title of the wiki page of the image without the "Image:" prefix.
Text
The text label to display as wiki markup.
Float
Three options:
{{{float|none}}} makes the image sit on its own line of the page by default {{{float|left}}} makes the image pushed to the left of the page by default {{{float|right}}} makes the image pushed to the right of the page by default
Template set
- {{Image label begin|image=Example.png|width=400|float=right}}
- {{Image label|x=0.25|y=0.75|scale=400|text=[[Wikipedia]]}}
- {{Image label small|x=0.25|y=0.75|scale=400|text=[[Wikipedia]]}}
- {{Image label end}}
Tool
- Labelled Image Editor
- Labelled Image Editor 2 - Coming Soon -- Zondor 07:38, 24 October 2007 (UTC)