Template:Addon/doc

From MozillaWiki
Jump to: navigation, search
Edit-copy green.svg
This is a documentation subpage for Template:Addon.
It contains usage information, categories and other content that is not part of the original template page.

Usage

{{addon}} produces a link to an add-on at AMO (Mozilla's website Add-ons, addons.mozilla.org).

Parameters

There are 2 unnamed parameters (see the table below), both required for the template to work.

Parameter Description
1 Page URL part of the add-on
2 Link text (e.g. the name of the add-on)
Copy-paste template

{{addon|''URL part'' |''custom text'' }}

Page URL part

Required

1

The part of the URL leading to the add-on's page at AMO. The parameter is unnamed, so no parameter name needs to be entered.

The page URL part must be entered exactly as it is in the location bar, otherwise the link will break. Most add-ons will have their names turned into a page name, in lower case and the spaces replaced by hyphens, e.g. form-history-control for the add-on Form History Control. But there are many add-ons that for one reason or another have URLs that differ from their names, e.g. because there are special characters or symbols in the name that can't be used in an URL, or because the original name stays in the URL when the add-on changes its name. So, always check the URL.

Usage
  • {{addon|URL part|custom text}}

Link text

Required

2

A custom text string that will show as the link text, e.g. the add-on's name. The parameter is unnamed, so no parameter name needs to be entered.

To create a numbered link with no link text, insert a pipe character ( | ) after the first parameter, and leave the value empty, like so: {{addon|URL part|}}. If this parameter is left out altogether (no pipe character to set it), the link text will be the same as the parameter's template code {{{2}}}.

Usage
  • {{addon|URL part|custom text}}

Examples

Correct use
Parameter What you write What you see
Defined param 1,
empty param 2
{{addon|google-translator|}} [1]
Both parameters {{addon|google-translator|Google™ Translator}} Google™ Translator
Incorrect use
Case What you write What you see Error
No parameter {{addon}} {{{2}}} Broken link
Empty param 1 {{addon||Google™ Translator}} Google™ Translator Broken link
No param 1 {{addon|Google™ Translator}} Translator/ {{{2}}} Custom text used as URL part
→ broken link, text jumble
Only param 1 {{addon|google-translator}} {{{2}}} Link text "{{{2}}}"

See also