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...")
 
 
(9 intermediate revisions by the same user not shown)
Line 2: Line 2:
__NOTOC__
__NOTOC__
==Usage==
==Usage==
{{tl|mozlink}} produces a custom link to a website or webpage under the <code>mozilla.org</code> domain.
{{tlf|'''mozlink'''}} produces a custom link to a website or webpage under the {{code|mozilla.org}} domain.


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


{| class="wikitable"
{| class="wikitable" style="background-color: white;"
|-
|-
! Parameter !! Description
! Parameter !! Description
|-
|-
| ''<code>1</code>'' || Custom link text; unnamed parameter
| {{code|''1''}} || mozilla.org subdomain; unnamed parameter
|-
|-
| <code>dom</code> || mozilla.org subdomain
| {{code|''2''}} || Custom link text; unnamed parameter
|-
|-
| <code>lang</code> || Language code
| {{code|lang}} || Mozilla locale code
|-
|-
| <code>page</code> || Main page under mozilla.org, e.g. …/'''firefox'''
| {{code|path}} || Path to page under mozilla.org, e.g. {{code|…/firefox/developer}}
|-
| <code>subp</code> || Subpage to a main page under mozilla.org, e.g. …/firefox/'''developer'''
|}
|}
===Syntax===
The template's syntax is
* {{tlc|mozlink|''subdomain''&nbsp;|''text''&nbsp;|lang{{=}}&nbsp;|path{{=}}&nbsp;}}


;<big>Copy-paste templates</big>
;<big>Copy-paste templates</big>
{| class="wikitable"
{| class="wikitable" style="background-color: white;"
|-
! Size !! Template code
|-
|-
! Size !! Code
| Basic use || {{tlc|mozlink|''subdomain''&nbsp;}}
|-
|-
| Basic || <code><nowiki>{{mozlink|''text''}}</nowiki></code>
| Link text || {{tlc|mozlink|''subdomain''&nbsp;|''text''&nbsp;}}
|-
|-
| Common use || <code><nowiki>{{mozlink|''text''|dom= |lang= }}</nowiki></code>
| Common use || {{tlc|mozlink|''subdomain''&nbsp;|''text''&nbsp;|lang{{=}}&nbsp;}}
|-
|-
| All parameters || <code><nowiki>{{mozlink|''text''|dom= |lang= |page= |subp= }}</nowiki></code>
| Full || {{tlc|mozlink|''subdomain''&nbsp;|''text''&nbsp;|lang{{=}}&nbsp;|path{{=}}&nbsp;}}
|}
|}


===Custom link text===
===Optional parameters===
;<big>1</big>
====1====
Custom text string that will show as link text. The parameter is unnamed, so no parameter name needs to be entered.
;<big>Mozilla subdomain</big>
The template will, as default, link to the main Mozilla website ({{code|www.mozilla.org}}), but it is possible to specify a subdomain. For example, by setting this parameter to {{var|addons}}, your link will point to the Mozilla Add-ons site ({{code|addons.mozilla.org}}). If the parameter is left unused, the subdomain will default to {{code|www}}. The parameter is unnamed, so no parameter name needs to be entered.


Note:
;<big>List of Mozilla subdomains</big>
* If this parameter is left out, the link will be numbered in the usual MediaWiki manner, e.g. "<code><nowiki>[1]</nowiki></code>".
{| class="wikitable" style="background-color: white;"
 
;Usage:
* <code><nowiki>{{mozlink|''text''}}</nowiki></code>
 
===Domain===
;<big>dom</big>
The template will, as default, link to the main Mozilla website (<code>www.mozilla.org</code>), 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 <code>dom</code> parameter to <var>amo</var> or <var>addons</var>, your link will point to the Mozilla Add-ons site (<code>addons.mozilla.org</code>). If the parameter is left unused, the subdomain will be <code>www</code>.
{| class="wikitable" style="font-size:95%;"
|-
|-
! Code !! Subdomain !!  !! Code !! Subdomain !!  !! Code !! Subdomain
! colspan="5" style="text-align: left;" | Subdomains
|-
|-
| style="background-color:#f2f2f2;" | '''adv''' || advocacy ||| style="background-color:#f2f2f2;" | '''eid''' || eideticker ||| style="background-color:#f2f2f2;" | '''mot''' || moztrap
| style="width: 150px;" | advocacy || rowspan="14" | || style="width: 150px;" | eideticker || rowspan="14" | || style="width: 150px;" | moztrap
|-
|-
| style="background-color:#f2f2f2;" | '''aff''' || affiliates ||  || style="background-color:#f2f2f2;" | '''eth''' || etherpad ||  || style="background-color:#f2f2f2;" | '''mxr''' || mxr
| affiliates || etherpad || mxr
|-
|-
| style="background-color:#f2f2f2;" | '''air''' || air || || style="background-color:#f2f2f2;" | '''ftp''' || ftp ||  || style="background-color:#f2f2f2;" | '''nig''' || nightly
| air || ftp || nightly
|-
|-
| style="background-color:#f2f2f2;" | '''amo''' || addons ||  || style="background-color:#f2f2f2;" | '''git''' || gitmirror ||  || style="background-color:#f2f2f2;" | '''peo''' || people
| addons || gitmirror || people
|-
|-
| style="background-color:#f2f2f2;" | '''arc''' || www-archive ||  || style="background-color:#f2f2f2;" | '''gra''' || graphs ||  || style="background-color:#f2f2f2;" | '''pla''' || planet
| www-archive || graphs || planet
|-
|-
| style="background-color:#f2f2f2;" | '''blog''' || blog ||  || style="background-color:#f2f2f2;" | '''hac''' || hacks ||  || style="background-color:#f2f2f2;" | '''pon''' || pontoon
| blog || hacks || pontoon
|-
|-
| style="background-color:#f2f2f2;" | '''bmo''' || bugzilla ||  || style="background-color:#f2f2f2;" | '''hg''' || hg ||  || style="background-color:#f2f2f2;" | '''pul''' || pulse
| bugzilla || hg || pulse
|-
|-
| style="background-color:#f2f2f2;" | '''brq''' || browserquest ||  || style="background-color:#f2f2f2;" | '''kra''' || krakenbenchmark ||  || style="background-color:#f2f2f2;" | '''qua''' || quality
| browserquest || krakenbenchmark || quality
|-
|-
| style="background-color:#f2f2f2;" | '''bzr''' || bzr || || style="background-color:#f2f2f2;" | '''l10n''' || l10n ||  || style="background-color:#f2f2f2;" | '''reps''' || reps
| bzr || l10n || reps
|-
|-
| style="background-color:#f2f2f2;" | '''car''' || careers ||  || style="background-color:#f2f2f2;" | '''ldap''' || ldap ||  || style="background-color:#f2f2f2;" | '''sen''' || sendto
| careers || ldap || sendto
|-
|-
| style="background-color:#f2f2f2;" | '''dev''' || developer ||  || style="background-color:#f2f2f2;" | '''lis''' || lists ||  || style="background-color:#f2f2f2;" | '''stu''' || studentreps
| developer || lists || studentreps
|-
|-
| style="background-color:#f2f2f2;" | '''dnd''' || dnt-dashboard ||  || style="background-color:#f2f2f2;" | '''loc''' || localize ||  || style="background-color:#f2f2f2;" | '''sum''' || summit
| dnt-dashboard || localize || summit
|-
|-
| style="background-color:#f2f2f2;" | '''dnt''' || dnt || || style="background-color:#f2f2f2;" | '''mail''' || mail ||  || style="background-color:#f2f2f2;" | '''sup''' || support
| dnt || mail || support
|-
|-
| style="background-color:#f2f2f2;" | '''edu''' || education ||  || style="background-color:#f2f2f2;" | '''mob''' || mobilepartners ||  || style="background-color:#f2f2f2;" | '''tel''' || telemetry
| education || mobilepartners || telemetry
|}
|}


;Limitations:
;<big>Usage</big>
* The template can only link to subdomains that are listed in the template itself. For the moment there are 42 listed subdomains.
* {{tlc|mozlink|<big>'''1'''</big>}}


;Usage:
====2====
* <code><nowiki>{{mozlink|dom=domain code/name}}</nowiki></code>
;<big>Custom link text</big>
Custom text string that will show as link text. The parameter is unnamed, so no parameter name needs to be entered.


===Language===
;<big>Note</big>
;<big>lang</big>
* If this parameter is left out, the link will use the other parameters to provide the link text.
It is possible to specify a Mozilla locale for the link, defined as a locale code (e.g. <code>de</code> for German or <code>sv-SE</code> 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 (<code>en-US</code>). An up-to-date list of Mozilla's web locale codes can be found at the [https://l10n.mozilla-community.org/webdashboard/ Mozilla Web Localization Dashboard].


;Usage:
;<big>Usage</big>
* <code><nowiki>{{mozlink|lang=locale code}}</nowiki></code>
* {{tlc|mozlink|<big>'''2'''</big>}}


===Webpage===
====lang====
;<big>page</big>
;<big>Language (locale) code</big>
To link to a webpage one step under the websites base address, you can use the <code>page</code> parameter. To, e.g., link to the firefox page under mozilla.org (<code>www.mozilla.org/'''firefox'''</code>), you enter <var>firefox</var>. 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 (<code>bugzilla.mozilla.org/index.cgi?GoAheadAndLogIn=1</code>), you need to enter <var>index.cgi?GoAheadAndLogIn=1</var> as the parameter value.
It is possible to specify a Mozilla locale for the link, defined as a locale code (e.g. {{samp|de}} for German or {{samp|sv-SE}} for Swedish). If this 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 ({{samp|en-US}}). An up-to-date list of Mozilla's web locale codes can be found at the [https://l10n.mozilla-community.org/webdashboard/ Mozilla Web Localization Dashboard].


;Usage:
;Usage:
* <code><nowiki>{{mozlink|page=page address part}}</nowiki></code>
* {{tlc|mozlink|<big>'''lang{{=}}'''</big>''locale code''}}
 
====path====
;<big>Path to page</big>
To link to a webpage under the websites base address, you use the {{code|path}} parameter. To, e.g., link to the Firefox Developer Edition page under mozilla.org ({{code|www.mozilla.org/firefox/developer}}), you enter {{para|path|firefox/developer}}.


===Subpage===
The name you type in must be the same as the page's address path in the location bar. If you, for example, want to link to the login page for Bugzilla ({{samp|bugzilla.mozilla.org/index.cgi?GoAheadAndLogIn{{=}}1}}), you need to enter {{para|path|index.cgi?GoAheadAndLogIn{{=}}1}} as the parameter value.
;<big>subp</big>
If you want to link to a subpage under a webpage (see above), the parameter <code>subp</code> lets you do that. It works just like the <code>page</code> 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 (<code>www.mozilla.org/firefox/'''developer'''</code>), you need to enter <var>developer</var> 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 <var>independent/#play</var>.


;Usage:
;<big>Usage</big>
* <code><nowiki>{{mozlink|subp=subpage address part}}</nowiki></code>
* {{tlc|mozlink|<big>'''path{{=}}'''</big>''path to page''}}


==Examples==
==Examples==
{| class="wikitable"
;<big>Correct use</big>
{| class="wikitable" style="background-color: white;"
|-
|-
! Parameter !! What you write !! What you see
! Parameter !! What you write !! What you see
|-
|-
| No parameter || <code><nowiki>{{mozlink}}</nowiki></code> || {{mozlink}}
| No parameters || {{tlc|mozlink}} || {{mozlink}}
|-
| <code>1</code> || <code><nowiki>{{mozlink|Mozilla's website}}</nowiki></code> || {{mozlink|Mozilla's website}}
|-
|-
| <code>dom</code> || <code><nowiki>{{mozlink|Bugzilla|dom=bmo}}</nowiki></code> || {{mozlink|Bugzilla|dom=bmo}}
| {{para|1}} || {{tlc|mozlink|bugzilla}} || {{mozlink|bugzilla}}
|-
|-
| <code>lang</code> || <code><nowiki>{{mozlink|Mozilla's website in Swedish|lang=sv-SE}}</nowiki></code> || {{mozlink|Mozilla's website in Swedish|lang=white}}
| {{para|2}} || {{tlc|mozlink|bugzilla|Go to Bugzilla}} || {{mozlink|bugzilla|Go to Bugzilla}}
|-
|-
| <code>page</code> || <code><nowiki>{{mozlink|Firefox|page=firefox}}</nowiki></code> || {{mozlink|Firefox|page=firefox}}
| {{para|lang}} || {{tlc|mozlink||Mozilla's website|lang{{=}}sv-SE}} || {{mozlink||Mozilla's website|lang=sv-SE}}
|-
|-
| <code>subp</code> || <code><nowiki>{{mozlink|Firefox Developer Edition|page=firefox|subp=developer}}</nowiki></code> || {{{{mozlink|Firefox Developer Edition|page=firefox|subp=developer}}
| {{para|path}} || {{tlc|mozlink||Firefox Developer Edition|path{{=}}firefox/developer}} || {{mozlink||Firefox Developer Edition|path=firefox/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 || {{tlc|mozlink|addons|„Rainbow“ Farbwerkzeuge|lang{{=}}de|path{{=}}firefox/addon/rainbow-color-tools}} || {{mozlink|addons|„Rainbow“ Farbwerkzeuge|lang=de|path=firefox/addon/rainbow-color-tools}}
|}
|}


==See also==
==See also==
* {{tl|mozillian}}
* {{tl|mozillian}}
* {{tl|mozillians}}


<includeonly>
<includeonly>
[[Category:Mozilla link templates]]
[[Category:Mozilla link templates]]
</includeonly>
</includeonly>

Latest revision as of 22:29, 26 January 2015

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 2 unnamed and 2 named parameters, none of which is strictly required.

Parameter Description
1 mozilla.org subdomain; unnamed parameter
2 Custom link text; unnamed parameter
lang Mozilla locale code
path Path to page under mozilla.org, e.g. …/firefox/developer

Syntax

The template's syntax is

  • {{mozlink|subdomain |text |lang= |path= }}
Copy-paste templates
Size Template code
Basic use {{mozlink|subdomain }}
Link text {{mozlink|subdomain |text }}
Common use {{mozlink|subdomain |text |lang= }}
Full {{mozlink|subdomain |text |lang= |path= }}

Optional parameters

1

Mozilla subdomain

The template will, as default, link to the main Mozilla website (www.mozilla.org), but it is possible to specify a subdomain. For example, by setting this parameter to addons, your link will point to the Mozilla Add-ons site (addons.mozilla.org). If the parameter is left unused, the subdomain will default to www. The parameter is unnamed, so no parameter name needs to be entered.

List of Mozilla subdomains
Subdomains
advocacy eideticker moztrap
affiliates etherpad mxr
air ftp nightly
addons gitmirror people
www-archive graphs planet
blog hacks pontoon
bugzilla hg pulse
browserquest krakenbenchmark quality
bzr l10n reps
careers ldap sendto
developer lists studentreps
dnt-dashboard localize summit
dnt mail support
education mobilepartners telemetry
Usage
  • {{mozlink|1}}

2

Custom link text

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 use the other parameters to provide the link text.
Usage
  • {{mozlink|2}}

lang

Language (locale) code

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 this 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}}

path

Path to page

To link to a webpage under the websites base address, you use the path parameter. To, e.g., link to the Firefox Developer Edition page under mozilla.org (www.mozilla.org/firefox/developer), you enter |path=firefox/developer.

The name you type in must be the same as the page's address path in the location bar. If you, for example, want to link to the login page for Bugzilla (bugzilla.mozilla.org/index.cgi?GoAheadAndLogIn=1), you need to enter |path=index.cgi?GoAheadAndLogIn=1 as the parameter value.

Usage
  • {{mozlink|path=path to page}}

Examples

Correct use
Parameter What you write What you see
No parameters {{mozlink}} www.mozilla.org
|1 {{mozlink|bugzilla}} bugzilla.mozilla.org
|2 {{mozlink|bugzilla|Go to Bugzilla}} Go to Bugzilla
|lang {{mozlink||Mozilla's website|lang=sv-SE}} Mozilla's website (sv-SE)
|path {{mozlink||Firefox Developer Edition|path=firefox/developer}} Firefox Developer Edition
Combo {{mozlink|addons|„Rainbow“ Farbwerkzeuge|lang=de|path=firefox/addon/rainbow-color-tools}} „Rainbow“ Farbwerkzeuge (de)

See also