The new Waze Wiki, aka Wazeopedia, is now live at Wazeopedia.waze.com! While this legacy wiki will remain accessible for the time being, it is no longer updated by the community. For the most up-to-date guidance, please visit your local Wazeopedia.

Please do not make any more updates to these legacy wiki pages, all future updates should be made in your country's local Wazeopedia.

Clock over a larger globe

Template:Plain image with caption/doc

From waze
Jump to: navigation, search
This is a documentation subpage for Template:Plain image with caption.
It contains usage information, categories and other content that is not part of the original template page.

Since MediaWiki does not provide a way to add visible captions to images integrated seamlessly in a page (i.e, without borders), this template aims to provide that functionality.

Usage

This template can be either with named parameters, as in

{{plain image with caption|image=Example.svg|caption=Example text|width=250|align=right}}

...or in its shorthand form:

{{plain image with caption|Example.svg|Example text|250|right}}
  • The only compulsory parameters are image and caption. The width defaults to 250px, and the alignment defaults to right
  • When using the shorthand version, keep in mind that the order of parameters is important
  • Please notice that the width does not include the unit "px" (see the code below)

Technical

The template wraps the image in an HTML table wrapper bounding the wrapper margins relative to the image width. The table positions the construct right or left and isolates it from other page text intrusion with fixed padding.

Actual internal coding

The equivalance between placeholder and named parameters is shown here below:

{| style="float:{{{4|{{{align|right}}}}}}; width:{{{3|{{{width|250}}}}}}px;
 margin:1em; background:transparent;"
| [[Image:{{{1|{{{image<noinclude>|Example.svg</noinclude>}}}}}}
| right|{{{3|{{{width|250}}}}}}px|{{{2|{{{caption<noinclude>|Caption goes here.</noinclude>}}}}}}]]
|-
|<span style="font-size:85%;">{{{2|{{{caption<noinclude>|Caption goes here.</noinclude>}}}}}}</span>
|}

So the placeholder parameters map as named parameters to operational HTML in order:

  1. image:   {{{image}}} or {{{1|}}}
  2. caption: {{{caption}}} or {{{2|}}}
  3. width:  {{{width}}} or {{{3|}}}defaults to 250 and adds the 'px;' suffix, so leave it off!
  4. float:   {{{align}}} or {{{4|}}}