Template:Mozlink/doc

Edit-copy green.svg
This is a documentation subpage for Template:Mozlink.
It contains usage information, categories and other content that is not part of the original template page.

Usage

{{mozlink}} produces a custom link to a website or webpage under the mozilla.org domain.

Parameters

There are 1 unnamed and 4 named parameters (see the table below), none of which is required for the template to work.

Parameter Description
1 Custom link text; unnamed parameter
dom mozilla.org subdomain
lang Language code
page Main page under mozilla.org, e.g. …/firefox
subp Subpage to a main page under mozilla.org, e.g. …/firefox/developer
Copy-paste templates
Size Code
Basic {{mozlink|''text''}}
Common use {{mozlink|''text''|dom= |lang= }}
All parameters {{mozlink|''text''|dom= |lang= |page= |subp= }}

Custom link text

1

Custom text string that will show as link text. The parameter is unnamed, so no parameter name needs to be entered.

Note:

  • If this parameter is left out, the link will be numbered in the usual MediaWiki manner, e.g. "[1]".
Usage
  • {{mozlink|''text''}}

Domain

dom

The template will, as default, link to the main Mozilla website (www.mozilla.org), but it is possible to specify a subdomain using the subdomain codes in the table below, or by entering the entire subdomain name. For example, by defining the dom parameter to amo or addons, your link will point to the Mozilla Add-ons site (addons.mozilla.org). If the parameter is left unused, the subdomain will be www.

Code Subdomain Code Subdomain Code Subdomain
adv advocacy eid eideticker mot moztrap
aff affiliates eth etherpad mxr mxr
air air ftp ftp nig nightly
amo addons git gitmirror peo people
arc www-archive gra graphs pla planet
blog blog hac hacks pon pontoon
bmo bugzilla hg hg pul pulse
brq browserquest kra krakenbenchmark qua quality
bzr bzr l10n l10n reps reps
car careers ldap ldap sen sendto
dev developer lis lists stu studentreps
dnd dnt-dashboard loc localize sum summit
dnt dnt mail mail sup support
edu education mob mobilepartners tel telemetry
Limitations
  • The template can only link to subdomains that are listed in the template itself. For the moment there are 42 listed subdomains.
Usage
  • {{mozlink|dom=domain code/name}}

Language

lang

It is possible to specify a Mozilla locale for the link, defined as a locale code (e.g. de for German or sv-SE for Swedish). If the parameter is left out, the link will be redirected at the target to either the locale of the user's Firefox browser, or (if there is no translation of that webpage for the user's locale) to the English default locale (en-US). An up-to-date list of Mozilla's web locale codes can be found at the Mozilla Web Localization Dashboard.

Usage
  • {{mozlink|lang=locale code}}

Webpage

page

To link to a webpage one step under the websites base address, you can use the page parameter. To, e.g., link to the firefox page under mozilla.org (www.mozilla.org/firefox), you enter firefox. The name you type in must be the same as the page's address part in the location bar. If you, as an example, want to link to the login page for Bugzilla (bugzilla.mozilla.org/index.cgi?GoAheadAndLogIn=1), you need to enter index.cgi?GoAheadAndLogIn=1 as the parameter value.

Usage
  • {{mozlink|page=page address part}}

Subpage

subp

If you want to link to a subpage under a webpage (see above), the parameter subp lets you do that. It works just like the page parameter, i.e. you need to insert the subpage's address part as it looks when you see it in the location bar. To link to the main page for the Firefox Developer Edition (www.mozilla.org/firefox/developer), you need to enter developer as the parameter value. It is also possible to add lower levels using this parameter. For linking to, and automatically play, the video for Firefox' tenth anniversary, you enter the value independent/#play.

Usage
  • {{mozlink|subp=subpage address part}}

Examples

Correct use
Parameter What you write What you see
1 {{mozlink|Mozilla's website}} website.mozilla.org Mozilla's website.mozilla.org
dom – code {{mozlink|Bugzilla|dom=bmo}} Bugzilla.mozilla.org
dom – name {{mozlink|Bugzilla|dom=bugzilla}} Bugzilla.mozilla.org
lang {{mozlink|Mozilla's website in Swedish|lang=sv-SE}} website in Swedish.mozilla.org/sv-SE Mozilla's website in Swedish.mozilla.org (sv-SE)
page {{mozlink|Firefox|page=firefox}} Firefox.mozilla.org
subp {{mozlink|Firefox Developer Edition|page=firefox|subp=developer}} Developer Edition.mozilla.org Firefox Developer Edition.mozilla.org
Combo {{mozlink|Firefox zehn Jahre|lang=de|page=firefox|subp=independent/#play}} zehn Jahre.mozilla.org/de Firefox zehn Jahre.mozilla.org (de)
Incorrect use
Case What you write What you see Error
Defined subp param,
empty page param
{{mozlink|Subpage, no page|page=|subp=developer}} no page.mozilla.org Subpage, no page.mozilla.org Subpage name used as webpage base level
(subdom).mozilla.org/(subpage)/
→ broken or redirected link
Default fallbacks
Example case What you write What you see Fallback
No parameter {{mozlink}} www.mozilla.org www and null (→ en-US)
www.mozilla.org/(en-US)
No text param {{mozlink|page=firefox}} www.mozilla.org MediaWiki default
→ Numbered external link
Empty text param {{mozlink||page=firefox}} www.mozilla.org MediaWiki default
→ Numbered external link
Empty dom param {{mozlink|Empty domain|dom=}} domain.mozilla.org Empty domain.mozilla.org www
www.mozilla.org
Empty lang param {{mozlink|Empty locale|lang=}} locale.mozilla.org Empty locale.mozilla.org null (→ en-US)
(subdom).mozilla.org/(en-US)
Empty page param {{mozlink|Empty page entry|page=}} page entry.mozilla.org Firefox Website base level
(subdom).mozilla.org/
Empty subp param {{mozlink|Empty subpage entry|page=firefox|subp=}} subpage entry.mozilla.org Empty subpage entry.mozilla.org Webpage base level
(subdom).mozilla.org/(webpage)/

See also