Template:Mozlink/doc: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
(Created page with "{{Documentation subpage}} __NOTOC__ ==Usage== {{tl|mozlink}} produces a custom link to a website or webpage under the <code>mozilla.org</code> domain. ==Parameters== There ar...")
 
Line 122: Line 122:
| <code>page</code> || <code><nowiki>{{mozlink|Firefox|page=firefox}}</nowiki></code> || {{mozlink|Firefox|page=firefox}}
| <code>page</code> || <code><nowiki>{{mozlink|Firefox|page=firefox}}</nowiki></code> || {{mozlink|Firefox|page=firefox}}
|-
|-
| <code>subp</code> || <code><nowiki>{{mozlink|Firefox Developer Edition|page=firefox|subp=developer}}</nowiki></code> || {{{{mozlink|Firefox Developer Edition|page=firefox|subp=developer}}
| <code>subp</code> || <code><nowiki>{{mozlink|Firefox Developer Edition|page=firefox|subp=developer}}</nowiki></code> || {{mozlink|Firefox Developer Edition|page=firefox|subp=developer}}
|-
|-
| Combo || <code><nowiki>{{mozlink|Firefox zehn Jahre|lang=de|page=firefox|subp=independent/#play}}</nowiki></code> || {{mozlink|Firefox zehn Jahre|lang=de|page=firefox|subp=independent/#play}}
| Combo || <code><nowiki>{{mozlink|Firefox zehn Jahre|lang=de|page=firefox|subp=independent/#play}}</nowiki></code> || {{mozlink|Firefox zehn Jahre|lang=de|page=firefox|subp=independent/#play}}

Revision as of 23:23, 21 November 2014

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

Parameter What you write What you see
No parameter {{mozlink}} www.mozilla.org
1 {{mozlink|Mozilla's website}} website.mozilla.org Mozilla's website.mozilla.org
dom {{mozlink|Bugzilla|dom=bmo}} Bugzilla.mozilla.org
lang {{mozlink|Mozilla's website in Swedish|lang=sv-SE}} website in Swedish.mozilla.org/white Mozilla's website in Swedish.mozilla.org (white)
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)

See also