Template:Official website: Difference between revisions
Appearance
>Izno add format and mobile to unsupported |
Fixed template to work without Lua module - replaced Scribunto invoke with native parser functions |
||
| Line 1: | Line 1: | ||
<includeonly>{{# | <includeonly>{{#if:{{{1|{{{URL|}}}}}}|[{{#ifeq:{{#sub:{{{1|{{{URL|}}}}}}|0|4}}|http|{{{1|{{{URL|}}}}}}|{{#ifeq:{{#sub:{{{1|{{{URL|}}}}}}|0|5}}|https|{{{1|{{{URL|}}}}}}|https://{{{1|{{{URL|}}}}}}}}}} {{#if:{{{2|{{{name|}}}}}}|{{{2|{{{name|}}}}}}|Official website}}]|<span class="error">No URL specified for Official website template</span>}}</includeonly><noinclude> | ||
== Usage == | |||
-->< | This template formats official website links for use in external links sections. | ||
=== Syntax === | |||
<pre> | |||
{{Official website|example.com}} | |||
{{Official website|example.com|Custom link text}} | |||
{{Official website|https://example.com}} | |||
{{Official website|URL=example.com}} | |||
{{Official website|URL=example.com|name=Custom link text}} | |||
</pre> | |||
=== Parameters === | |||
{| class="wikitable" | |||
|- | |||
! Parameter !! Description !! Required | |||
|- | |||
| 1 or URL || The website URL (with or without https://) || Yes | |||
|- | |||
| 2 or name || Custom link text (defaults to "Official website") || No | |||
|} | |||
=== Examples === | |||
* <code><nowiki>{{Official website|microsoft.com}}</nowiki></code> produces: [https://microsoft.com Official website] | |||
* <code><nowiki>{{Official website|microsoft.com|Microsoft Corporate Site}}</nowiki></code> produces: [https://microsoft.com Microsoft Corporate Site] | |||
[[Category:External link templates]] | |||
[[Category:URL templates]] | |||
</noinclude> | |||
Latest revision as of 13:12, 16 December 2025
Usage
This template formats official website links for use in external links sections.
Syntax
{{Official website|example.com}}
{{Official website|example.com|Custom link text}}
{{Official website|https://example.com}}
{{Official website|URL=example.com}}
{{Official website|URL=example.com|name=Custom link text}}
Parameters
| Parameter | Description | Required |
|---|---|---|
| 1 or URL | The website URL (with or without https://) | Yes |
| 2 or name | Custom link text (defaults to "Official website") | No |
Examples
{{Official website|microsoft.com}}produces: Official website{{Official website|microsoft.com|Microsoft Corporate Site}}produces: Microsoft Corporate Site