Template:URL2
Template:Documentation subpage Template:High-use
![]() | Uses Lua: |
This is a fork of Template:URL for use in infoboxes.
It behaves similarly to
- REDIRECT Template:Template link
![]() Template:Redirect templateTemplate:R from move/except When appropriate, protection levels are automatically sensed, described and categorized. |
- By default it does not display anything if the parameters are blank or omitted. Template:URL displays
{{URL|example.com|optional display text}}
by default. - It implements a parameter Template:Para that turns on or off the message
{{URL|example.com|optional display text}}
. Setting msg to false or anything beginning with n or N will suppress the message. Anything else enables the message. - It strips html tags and wiki-link markup from the supplied url parameter.
- It truncates the url parameter at the first space it finds.
- It can take its own output as input, allowing website parameters to be wrapped in Template:Tnull in the design of an infobox, without causing problems if editors add
|website={{URL|some.url.com}}
in an article.
Usage
{{URL2|url}}
{{URL2|1=url}}
Examples
Different from Template:URL
If there is no input, the default behavior of URL2 is to display nothing (use Template:Para to display the instructional message): Template:Nowiki template demo Template:Nowiki template demo Template:Nowiki template demo
URL2 handles formatting commonly found in the Template:Para parameter of an infobox: Template:Nowiki template demo Template:Nowiki template demo Template:Nowiki template demo Template:Nowiki template demo
Same as Template:URL
The template wraps the output in <span class="url">...</span>
(see Template:Section link) and adds <wbr/> before displayed periods:
Template:Nowiki template demo
The use of http://, https://, a protocol-relative URL, or a different protocol is preserved in the URL but is not shown in the link text: Template:Nowiki template demo Template:Nowiki template demo Template:Nowiki template demo Template:Nowiki template demo
If the path is only a slash (/
) it is not displayed in the link text:
Template:Nowiki template demo
The template also adds <wbr/> before any displayed slashes (/
) in the path:
Template:Nowiki template demo
For a URL containing an equal sign (=
), use Template:Para:
Template:Nowiki template demo
Microformat
The template wraps the displayed URL with class="url"
so that it is included in any parent microformat which takes a URL parameter - see Wikipedia:WikiProject Microformats.
See also
- REDIRECT Template:Template link
![]() Template:Redirect templateTemplate:R from move/except When appropriate, protection levels are automatically sensed, described and categorized. |
- REDIRECT Template:Template link
![]() Template:Redirect templateTemplate:R from move/except When appropriate, protection levels are automatically sensed, described and categorized. |
- REDIRECT Template:Template link
![]() Template:Redirect templateTemplate:R from move/except When appropriate, protection levels are automatically sensed, described and categorized. |