Template:CSS crop/doc

From blackwiki
Jump to navigation Jump to search

{{CSS crop}} creates a crop of a graphics object (like a location map) which cannot be cropped with {{CSS image crop}}. The syntax and code are derivative of {{CSS image crop}}.

Usage

{{CSS crop
|Content       = <!-- The unadorned graphics object (typically a location map with border=infobox)-->
|bSize         = <!-- The Base object width in pixels (the object we are cropping on)-->
|cWidth        = <!-- Cropped Width in pixels-->
|cHeight       = <!-- Cropped Height in pixels-->
|oTop          = <!-- Offset Top in pixels, optional and defaults to 0 when omitted-->
|oLeft         = <!-- Offset Left in pixels, optional and defaults to 0 when omitted-->
|Location      = <!-- 'right', 'left', 'center' or 'none'. Determines placement of the cropped object on the page
                 Defaults to 'right' when description is provided (as is default for thumb images)
                 When description is blank, location on left (as is default for non-thumbs)-->
|Description   = <!-- Description (will render out using thumbnail class)-->
|magnify-link  = <!-- The page to be linked by the magnify icon.-->
}}

Examples

Consider the following uncropped location map Lua error in Module:Location_map at line 399: Malformed coordinates value.

{{Location map many|Southeast Asia|width=800|float=center
|caption=Destinations of flights out of Malacca International Airport
{{legend|red|Passenger (including Seasonal Charter)}}
{{legend|green|Cargo}}
|coordinates1={{coord|2.154700|102.15090}}|mark1=BSicon FLUGg.svg|mark1size=10|label1_size=100 |label1='''MKZ'''|position1=left
|coordinates2={{coord|0.273900|101.2640}}|mark2size=6|label2_size=85 |label2='''[[Sultan Syarif Kasim II International Airport|PKU]]'''|position2=left
|coordinates3={{coord|5.174970|100.163671}}|mark3size=6|label3_size=85 |label3='''[[Penang International Airport|PEN]]'''|position3=left
}}

Using the {{CSS crop}} template, we can crop this map by (1) adding |border=infobox to the location map and (2) passing to the {{CSS crop}} template through the |Content= parameter.

Template:^
Lua error in Module:Location_map at line 399: Malformed coordinates value.
Template:^
Destinations of flights out of Malacca International Airport
  Passenger (including Seasonal Charter)
  Cargo
{{CSS crop
|Location=center
|Description=Destinations of flights out of Malacca International Airport
{{legend|red|Passenger (including Seasonal Charter)}}
{{legend|green|Cargo}}
|bSize=800
|cWidth=350
|cHeight=300
|oLeft=40
|oTop=240
|Content=
{{Location map many|Southeast Asia|width=800|float=center|border=infobox
|caption=
|coordinates1={{coord|2.154700|102.15090}}|mark1=BSicon FLUGg.svg|mark1size=10|label1_size=100 |label1='''MKZ'''|position1=left
|coordinates2={{coord|0.273900|101.2640}}|mark2size=6|label2_size=85 |label2='''[[Sultan Syarif Kasim II International Airport|PKU]]'''|position2=left
|coordinates3={{coord|5.174970|100.163671}}|mark3size=6|label3_size=85 |label3='''[[Penang International Airport|PEN]]'''|position3=left
}}
}}

See also