Module:Infobox mapframe/doc
| This module is rated as ready for general use. It has reached a mature state, is considered relatively stable and bug-free, and may be used wherever appropriate. It can be mentioned on help pages and other Wikipedia resources as an option for new users. To minimise server load and avoid disruptive output, improvements should be developed through sandbox testing rather than repeated trial-and-error editing. |
| This Lua module is used on approximately 1,690,000 pages, or roughly 3% of all pages. To avoid major disruption and server load, any changes should be tested in the module's /sandbox or /testcases subpages, or in your own module sandbox. The tested changes can be added to this page in a single edit. Consider discussing changes on the talk page before implementing them. |
| This module depends on the following other modules: |
| Related pages |
|---|
This module implements {{Infobox mapframe}}.
See Template:Infobox mapframe/testcases for tests.
Usage
Module that automatically makes a mapframe suitable for an infobox automatically, with minimal user input.
Generic usage
Just use the template {{Infobox mapframe}}, following the documentation there. This module may also be imported to another Lua module.
Automatic maps in infoboxes
- Example edits: Template:Infobox prison, Template:Infobox prison/doc
Edit the infobox template (or its sandbox). Add lines like the following examples to the infobox. Replace numbers (4, or 97 to 99), with the appropriate number based on how many other image or data parameters are already present.
| If placing near the top of infobox | If placing at/near the bottom of the infobox |
|---|---|
| image4 = {{#invoke:Infobox mapframe|autoWithCaption}}
|
| header97 = {{#if:{{{mapframe|}}}|Location}}
| data98 = {{#invoke:Infobox mapframe|autoWithCaption}}
|
If the template has a call to {{#invoke:Check for unknown parameters|check}}, simply add |mapframe_args=y to the call and the various mapframe args will automatically be included.
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 #invoke calls above, e.g.
{{#invoke:Infobox mapframe
| autoWithCaption
| mapframe-marker = library
}}
- 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
|mapframe=yesis present in the template call.- To turn maps on by default, in the #invoke calls above add
|onByDefault=yes– which means maps will be displayed unless|mapframe=nois present in the template call. - onByDefault can also be set to a conditional, such as if another parameters is present, e.g.
|onByDefault={{#if:{{{pushpin_map|}}}|no|yes}}
- To turn maps on by default, in the #invoke calls above add
- Add the new parameters to the template documentation.
- You can use
{{Infobox mapframe/doc/parameters}}. - If any default values are modified in the #invoke calls, add them as parameters in the form |parameter-name=value.
- The default output is shown here collapsed:
- You can use
Extended content
|
|---|
|
- Parameters can also be added to the TemplateData, which can be copied and pasted from the relevant parts of
- For a list of available markers, see mw:Help:Extension:Kartographer/Icons
See also
Content Disclaimer
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.
- The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
- There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
- It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
- Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
- Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.