Template:Coord/doc: Difference between revisions

Fix usage examples
(Change out-text parameter to link-parameter. Add new parameters for pre & post.)
(Fix usage examples)
Line 63: Line 63:
== Usage  ==
== Usage  ==


  '''{{coord|'''''latitude'''''|'''''longitude'''''|'''''[[#1|coordinate parameters]]'''''|'''''[[#2|template parameters]]'''''}}'''
  '''{{coord|'''''latitude'''''|'''''longitude'''''|'''''[[#1|coordinate parameters]]'''''|'''''[[#2|template parameters]]'''''}}'''
  '''{{coord|'''''dd'''''|'''''N/S'''''|'''''dd'''''|'''''E/W'''''|'''''[[#1|coordinate parameters]]'''''|'''''[[#2|template parameters]]'''''}}'''
  '''{{coord|'''''dd'''''|'''''N/S'''''|'''''dd'''''|'''''E/W'''''|'''''[[#1|coordinate parameters]]'''''|'''''[[#2|template parameters]]'''''}}'''
  '''{{coord|'''''dd'''''|'''''mm'''''|'''''N/S'''''|'''''dd'''''|'''''mm'''''|'''''E/W'''''|'''''[[#1|coordinate parameters]]'''''|'''''[[#2|template parameters]]'''''}}'''
  '''{{coord|'''''dd'''''|'''''mm'''''|'''''N/S'''''|'''''dd'''''|'''''mm'''''|'''''E/W'''''|'''''[[#1|coordinate parameters]]'''''|'''''[[#2|template parameters]]'''''}}'''
  '''{{coord|'''''dd'''''|'''''mm'''''|'''''ss'''''|'''''N/S'''''|'''''dd'''''|'''''mm'''''|'''''ss'''''|'''''E/W'''''|'''''[[#1|coordinate parameters]]'''''|'''''[[#2|template parameters]]'''''}}'''
  '''{{coord|'''''dd'''''|'''''mm'''''|'''''ss'''''|'''''N/S'''''|'''''dd'''''|'''''mm'''''|'''''ss'''''|'''''E/W'''''|'''''[[#1|coordinate parameters]]'''''|'''''[[#2|template parameters]]'''''}}'''


There are two kinds of parameters, all optional:  
There are two kinds of parameters, all optional:  
Line 82: Line 81:
::**shortcut: <code>display=it</code> -->
::**shortcut: <code>display=it</code> -->
::*<code>display=title,inline</code> has the same effect as <code>display=inline,title</code>
::*<code>display=title,inline</code> has the same effect as <code>display=inline,title</code>
::Note: the <code>title</code> attribute indicates that the coordinates apply to the entire article, and not just one of (perhaps many) places mentioned in it — so it should only be omitted in the latter case.  
::Note: the <code>title</code> attribute indicates that the coordinates apply to the entire article, and not just one of (perhaps many) places mentioned in it — so it should only be omitted in the latter case.
:*'''format=''' can be used to force ''dec'' or ''dms'' coordinate display.
:*'''format=''' can be used to force ''dec'' or ''dms'' coordinate display.
::*<code>format=dec</code> reformats the coordinates to <span style="text-decoration: underline">decimal degrees</span> format.  
::*<code>format=dec</code> reformats the coordinates to <span style="text-decoration: underline">decimal degrees</span> format.  
::*<code>format=dms</code> reformats the coordinates to <span style="text-decoration: underline">degrees | minutes | seconds</span> format.
::*<code>format=dms</code> reformats the coordinates to <span style="text-decoration: underline">degrees | minutes | seconds</span> format.  
::*<code>format=text</code> display text instead of the coordinates using <code>pre-link-text</code>, <code>link-text</code>, and <code>post-link-text</code> parameters.
::*<code>format=text</code> display text instead of the coordinates using <code>pre-link-text</code>, <code>link-text</code>, and <code>post-link-text</code> parameters.
:*'''name=''' can be used to annotate inline coordinates for display in map services such as the [[:meta:WikiMiniAtlas|WikiMiniAtlas]]. If omitted, the article title (PAGENAME) is assumed.
:*'''name=''' can be used to annotate inline coordinates for display in map services such as the [[:meta:WikiMiniAtlas|WikiMiniAtlas]]. If omitted, the article title (PAGENAME) is assumed.
::Note: a ''name='' parameter causes {{tl|Coord}} to emit an [[HCard]] [[Microformat]] using that name, ''even if used within an existing hCard''. Do not use when the name is that of a person (e.g for a gravesite), as the generated hCard would be invalid. Also, do not use square brackets in names.
::Note: a ''name='' parameter causes {{tl|Coord}} to emit an [[HCard]] [[Microformat]] using that name, ''even if used within an existing hCard''. Do not use when the name is that of a person (e.g for a gravesite), as the generated hCard would be invalid. Also, do not use square brackets in names.
:*'''notes=''' specifies text to be displayed immediately following the coordinates. This is primarily intended for adding footnotes to title coordinates.  
:*'''notes=''' specifies text to be displayed immediately following the coordinates. This is primarily intended for adding footnotes to title coordinates.  
:*'''pre-link-text=''' specifies text to be displayed in place of the coordinates. This is only used when display is set to text and for overriding the default. The default is no text.
:*'''pre-link-text=''' specifies text to be displayed in place of the coordinates. This is only used when display is set to text and for overriding the default. The default is no text.  
:*'''link-text=''' specifies text to be displayed in place of the coordinates. This is only used when display is set to text and for overriding the default. The default is 'Click here'
:*'''link-text=''' specifies text to be displayed in place of the coordinates. This is only used when display is set to text and for overriding the default. The default is 'Click here'  
:*'''link-text=''' specifies text to be displayed in place of the coordinates. This is only used when display is set to text and for overriding the default. The default is ' to view information about this location'.
:*'''link-text=''' specifies text to be displayed in place of the coordinates. This is only used when display is set to text and for overriding the default. The default is ' to view information about this location'.


2,175

edits