Difference between revisions of "Template:Tel/doc"

From Second Life Wiki
Jump to navigation Jump to search
(Shiny new template for tel: URIs)
 
m (Fix <includeonly>)
 
(One intermediate revision by the same user not shown)
Line 21: Line 21:
Because RFC 3966 prohibits the usage of spaces in {{code|tel:}} links — although spaces are used as a visual separator in many countries — a second parameter ''can'' be used to display spaces, e.g. for a mobile phone number in Portugal:
Because RFC 3966 prohibits the usage of spaces in {{code|tel:}} links — although spaces are used as a visual separator in many countries — a second parameter ''can'' be used to display spaces, e.g. for a mobile phone number in Portugal:


: <code><nowiki>{{tel|+351-93-677-1490|93 677 1490}}</nowiki></code>
: <code><nowiki>{{tel|+351-98-765-4321|98 765 4321}}</nowiki></code>


produces
produces


: {{tel|+351-93-677-1490|93 677 1490}}
: {{tel|+351-98-765-4321|98 765 4321}}


Note that hyphens, parentheses and periods are perfectly valid separators according to RFC 2966.
Note that hyphens, parentheses and periods are perfectly valid separators according to RFC 2966.
Line 47: Line 47:
</syntaxhighlight>
</syntaxhighlight>
<!--</templatedata>-->
<!--</templatedata>-->
 
<includeonly>
{{Sandbox other||
{{Sandbox other||
<!-- ADD CATEGORIES BELOW THIS LINE -->
<!-- ADD CATEGORIES BELOW THIS LINE -->
}}
}}
</includeonly>

Latest revision as of 10:52, 27 February 2024

Creates fancy links for phone numbers.

This was used mostly on the suicide hotline page, because in an emergency, readers will not want to type long numbers on their phones, and copy & pasting might not work quickly enough.

Usage

{{tel|+1-555-123-4567}}

produces

☏ +1-555-123-4567

Phone format might be anything that is considered a valid phone number in the country where it's used.

See RFC 3966 for syntax, additional features, and other details about the tel: URL scheme.

Parameters

Because RFC 3966 prohibits the usage of spaces in tel: links — although spaces are used as a visual separator in many countries — a second parameter can be used to display spaces, e.g. for a mobile phone number in Portugal:

{{tel|+351-98-765-4321|98 765 4321}}

produces

☏ 98 765 4321

Note that hyphens, parentheses and periods are perfectly valid separators according to RFC 2966.

Template data

This is the "Wikipedia logo"TemplateData for this template used by TemplateWizard, "Wikipedia logo"VisualEditor and other tools. Click here to see a monthly parameter usage report for this template based on this TemplateData.

TemplateData for Tel

{
	"params": {
		"1": {
			"type": "content"
		},
		"2": {
			"type": "content"
		}
	},
	"description": "Telephone number"
}