Module:Infobox mapframe/doc: Difference between revisions

Content deleted Content added
documenting parameters
ce
 
(22 intermediate revisions by 8 users not shown)
Line 1:
{{Module rating|beta}}
{{Lua sidebar}}
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) -->
{{High-use}}
{{Lua|Module:Mapframe|Module:InfoboxImage|Module:Infobox dim|Module:Yesno|Module:Arguments}}
{{Lua sidebar}}
 
== Usage ==
 
Line 10 ⟶ 13:
 
===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 linesexamples 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%
<pre>
|-
! 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_captionmapframe-area_km2 | mapframe_idmapframe-area_mi2 | mapframe_coordmapframe-caption | mapframe_wikidatamapframe-coord | mapframe_shapemapframe-coordinates | mapframe_framemapframe-widthcustom | mapframe_framemapframe-frame-coord | mapframe-frame-coordinates | mapframe-frame-height | mapframe_shapemapframe-frame-width | mapframe-geomask | mapframe-geomask-fill | mapframe_shapemapframe-geomask-fill-opacity | mapframe_strokemapframe-geomask-stroke-color | mapframe_strokemapframe-geomask-stroke-colour | mapframe_strokemapframe-geomask-stroke-width | mapframe_markermapframe-height | mapframe_markermapframe-colorid | mapframe_markermapframe-colourlength_km | mapframe_geomaskmapframe-length_mi | mapframe_geomaskmapframe-strokemarker | mapframe-marker-color | mapframe_geomaskmapframe-strokemarker-colour | mapframe_geomaskmapframe-strokepoint | mapframe-widthpopulation | mapframe_geomaskmapframe-shape | mapframe-shape-fill | mapframe_geomaskmapframe-shape-fill-opacity | mapframe_zoommapframe-stroke-color | mapframe_length_kmmapframe-stroke-colour | mapframe_length_mimapframe-stroke-width | mapframe_area_km2mapframe-switcher | mapframe_area_mi2mapframe-type | mapframe_framemapframe-coordinateswidth | mapframe_framemapframe-coordwikidata | 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><nowikipre>{{#invoke:Infobox mapframe/sandbox
| auto
| mapframe-marker = library
}}</nowiki></codepre>
: 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>}}
*: Both the {{kbd|auto}} and {{kbd|autocaption}} functions take the {{kbd|onByDefault}} value into account.
* Add the new parameters to the document.
*: You can use {{tltlx|Infobox mapframe/doc/parameters}}.
*: If Specifyany default values are modified in the {{kbd|#invoke}} calls, usingadd bythem addingas parameters in the form {{tt|{{!}}}}''parameter-name''{{tt|{{=}}}}''value''.
*: The default output is shown here collpasedcollapsed:
{{cot}}
{{Infobox mapframe/doc/parameters}}
{{cob}}
*Parameters can also be added to the TemplateData, which can be copied and pasted from the relevant parts of {{edit|Template:Infobox mapframe/doc|Template:Infobox mapframe/doc}}
 
== See also ==
* [[Wikipedia:Mapframe maps in infoboxes]]
* [[Module:Mapframe]] & [[Template:Maplink]]
 
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | |
<!-- Categories below this line, please; interwikis at Wikidata -->
 
}}</includeonly><noinclude>
[[Category:Module documentation pages]]
</noinclude>