Jump to content

Template:URL: Difference between revisions

The comprehensive free global encyclopedia of CEOs, corporate leadership, and business excellence
>Jonesey95
 
Created URL template for formatting website links in infoboxes and articles
 
Line 1: Line 1:
<includeonly>{{#invoke:URL|url}}</includeonly>{{#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using URL template with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview=Page using [[Template:URL]] with unknown parameter "_VALUE_"|ignoreblank=y | 1 | 2 }}<noinclude>{{documentation}}</noinclude>
<includeonly>{{#if:{{{1|}}}|[{{#ifeq:{{#sub:{{{1}}}|0|4}}|http|{{{1}}}|{{#ifeq:{{#sub:{{{1}}}|0|5}}|https|{{{1}}}|https://{{{1}}}}}}} {{#if:{{{2|}}}|{{{2}}}|{{{1}}}}}]|}}</includeonly><noinclude>
== Usage ==
This template formats URLs for use in infoboxes and other contexts.
 
=== Syntax ===
<pre>
{{URL|example.com}}
{{URL|example.com|Example Website}}
{{URL|https://example.com}}
</pre>
 
=== Examples ===
* <code><nowiki>{{URL|microsoft.com}}</nowiki></code> → {{URL|microsoft.com}}
* <code><nowiki>{{URL|microsoft.com|Microsoft}}</nowiki></code> → {{URL|microsoft.com|Microsoft}}
* <code><nowiki>{{URL|https://microsoft.com}}</nowiki></code> {{URL|https://microsoft.com}}
 
[[Category:Formatting templates]]
</noinclude>

Latest revision as of 15:40, 20 October 2025

Usage

This template formats URLs for use in infoboxes and other contexts.

Syntax

{{URL|example.com}}
{{URL|example.com|Example Website}}
{{URL|https://example.com}}

Examples