Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Micro Pedia
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Module:Infobox/doc
Module
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Special pages
Page information
Get shortened URL
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Module rating|beta}} <!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) --> {{High-use}} {{Lua sidebar}} == Usage == Module that automatically makes a mapframe suitable for an infobox automatically, with minimal user input. ===Generic usage=== Just use the template {{tl|Infobox mapframe}}, following the documentation there. This module may also be imported to another Lua module. ===Automatic maps in infoboxes=== :''Example edits: [https://en.wikipedia.org/w/index.php?title=Template%3AInfobox_prison&type=revision&diff=962824818&oldid=782742135 Template:Infobox prison], [https://en.wikipedia.org/w/index.php?title=Template%3AInfobox_prison%2Fdoc&type=revision&diff=962825435&oldid=768262729 Template:Infobox prison/doc]'' Edit the infobox template (or its sandbox). Add lines like the following examples to the infobox. Replace numbers ({{kbd|4}}, or {{kbd|97}} to {{kbd|99}}), with the appropriate number based on how many other image or data parameters are already present. {|style=width:100% |- ! If placing near the top of infobox !! If placing at/near the bottom of the infobox |- |<pre> | image4 = {{#invoke:Infobox mapframe|auto}} | caption4 = {{#invoke:Infobox mapframe|autocaption}} </pre> |<pre> | header97 = {{#if:{{{mapframe|}}}|Location}} | data98 = {{#invoke:Infobox mapframe|auto}} | data99 = {{#invoke:Infobox mapframe|autocaption}} </pre> |} If the template has a <code><nowiki>{{#invoke:</nowiki>[[Module:Check for unknown parameters|Check for unknown parameters]]<nowiki>}}</nowiki></code>, add the following parameters: <pre> | mapframe | mapframe-area_km2 | mapframe-area_mi2 | mapframe-caption | mapframe-coord | mapframe-coordinates | mapframe-custom | mapframe-frame-coord | mapframe-frame-coordinates | mapframe-frame-height | mapframe-frame-width | mapframe-geomask | mapframe-geomask-fill | mapframe-geomask-fill-opacity | mapframe-geomask-stroke-color | mapframe-geomask-stroke-colour | mapframe-geomask-stroke-width | mapframe-height | mapframe-id | mapframe-length_km | mapframe-length_mi | mapframe-marker | mapframe-marker-color | mapframe-marker-colour | mapframe-point | mapframe-shape | mapframe-shape-fill | mapframe-shape-fill-opacity | mapframe-stroke-color | mapframe-stroke-colour | mapframe-stroke-width | mapframe-switcher | mapframe-width | mapframe-wikidata | mapframe-zoom </pre> Once this is done, the above parameters will be available to users of the template. * Defaults values for these parameters can also be specified in the {{kbd|#invoke}} calls above, e.g. <code><nowiki>{{#invoke:Infobox mapframe|auto|mapframe-marker=library}}</nowiki></code> means that the library marker will be used, unless a different value is passed in to the template. * The maps are off by default, which means maps will not be displayed unless {{para|mapframe|yes}} is present in the template call. To turn maps on by default, in the {{kbd|#invoke}} calls above add {{para|onByDefault|yes}} β which means maps will be displayed unless {{para|mapframe|no}} is present in the template call. {{kbd|onByDefault}} can also be set to a conditional, such as if another parameters is present, e.g. {{para|onByDefault|2=<nowiki>{{#if:{{{pushpin_map|}}}|no|yes}}</nowiki>}} * Add the new parameters to the document. You can use {{tlx|Infobox mapframe/doc/parameters}}. Specify default values (if any are used in the {{kbd|#invoke}} calls) using by adding parameters in the form {{tt|{{!}}}}''parameter-name''{{tt|{{=}}}}''value''. The default output is shown here collapsed: {{cot}} {{Infobox mapframe/doc/parameters}} {{cob}} *Parameters can also be added to the TemplateData can also be added by copy-pasting from {{edit|Template:Infobox mapframe/doc/templatedata|Template:Infobox mapframe/doc/templatedata}} == See also == * [[Wikipedia:Mapframe maps in infoboxes]] * [[Module:Mapframe]] & [[Template:Maplink]] <includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | | <!-- Categories below this line, please; interwikis at Wikidata --> }}</includeonly>
Summary:
Please note that all contributions to Micro Pedia may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Micro Pedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Templates used on this page:
Template:Cob
(
edit
)
Template:Cot
(
edit
)
Template:Edit
(
edit
)
Template:Endplainlist
(
edit
)
Template:High-use
(
edit
)
Template:Infobox mapframe/doc/parameters
(
edit
)
Template:Kbd
(
edit
)
Template:Lua sidebar
(
edit
)
Template:Module rating
(
edit
)
Template:Para
(
edit
)
Template:Plainlist
(
edit
)
Template:Sidebar
(
edit
)
Template:Tl
(
edit
)
Template:Tlx
(
edit
)
Template:Tt
(
edit
)
Module:Arguments
(
edit
)
Module:High-use
(
edit
)
Module:Message box
(
edit
)
Module:Message box/configuration
(
edit
)
Module:No globals
(
edit
)
Module:Redirect
(
edit
)
Module:Sidebar
(
edit
)
Module:Sidebar/configuration
(
edit
)
Module:Transclusion count
(
edit
)
Module:Transclusion count/data/I
(
edit
)
Module:Yesno
(
edit
)