Template:Image area/doc: Difference between revisions
Jump to navigation
Jump to search
create |
No edit summary |
||
| Line 11: | Line 11: | ||
* '''new width''' or '''new height''' - the dimensions of the resulting cropped area. Everything will be scaled to fit the given dimensions. Defaults to 250px wide. Only one of these two is required, the other will be calculated from it. | * '''new width''' or '''new height''' - the dimensions of the resulting cropped area. Everything will be scaled to fit the given dimensions. Defaults to 250px wide. Only one of these two is required, the other will be calculated from it. | ||
* '''caption''' - text to display as hovertext on the image (and alt text if it can't be loaded). Defaults to "(page name) within (preset name)". | * '''caption''' - text to display as hovertext on the image (and alt text if it can't be loaded). Defaults to "(page name) within (preset name)". | ||
* '''margin''' (optional) - CSS style for the container element's margins. To center it in an infobox, use <code>-1px auto auto</code>. | |||
==Coordinates== | ==Coordinates== | ||
Latest revision as of 23:41, 26 November 2025
This page contains the documentation for Template:Image area. It includes information about the template, such as usage and categories, and is not displayed when using the template itself.
This template is used to display a portion of a larger image which has been zoomed in and/or cropped, such as showing a region of a map without having to create and upload a new image.
This template makes use of Lua code at Module:Image area. Please use the template rather than invoking the module directly.
Parameters
- first unnamed parameter: the name of a preset image that has been added to the module code. It has to be done this way and added to MediaWiki:Common.css due to technical limitations for security.
- The following options are available:
Enessa. To have more added, please contact Media staff.
- The following options are available:
- x1, y1, x2, and y2 - the coordinates on the original full size image to use for the area for the display. All of these are required. They must have x1 and y1 be the top left corner of the area, and x2 and y2 be the bottom right corner of the area. See below for more details.
- new width or new height - the dimensions of the resulting cropped area. Everything will be scaled to fit the given dimensions. Defaults to 250px wide. Only one of these two is required, the other will be calculated from it.
- caption - text to display as hovertext on the image (and alt text if it can't be loaded). Defaults to "(page name) within (preset name)".
- margin (optional) - CSS style for the container element's margins. To center it in an infobox, use
-1px auto auto.
Coordinates
Coordinates are taken from the top left of the full size image. For one easy way to get the coordinates, use the script linked on Help:Imagemap and create a rectangular area, then copy the coordinates. Use the left mouse button to select the top left corner, and the right mouse button to select the bottom right corner.
Examples
This section is a stub - it only covers the very basics of its subject. More information should be added to make the section informative and useful. If no more information is available, the section should be considered for merging or removal.
If you can correct the issue, please edit the page to do so, then remove this notice.
If you can correct the issue, please edit the page to do so, then remove this notice.