Teamplaid:Categorize
This template is a template wrapper around the format_categories
function in Mòideal:utilities. It adds one or more categories to an entry, using the provided language code to generate a sort key specific to the language. If the namespace of the current page is not meant to contain entries (it's not the main namespace or Appendix) then the template does not categorize, so it's safe to use on any page and in any template.
The two templates {{Catlangname}}
and{{Catlangcode}}
are specialized versions of{{Categorize}}
. They work the same way, and have the same parameters. However:
{{Catlangname}}
will add the language name before all the names that are provided. This creates a "lexical" or "part-of-speech-like" category, whose name is based on the format Category:(language name) (category name)
.
{{Catlangcode}}
will add the language code and a colon:
before all the names. This creates a "topical" category, whose name is based on the formatCategory:(language code):(category name)
.
Ùsaid - Usage
[deasaich]The template accepts the following parameters:
1=
- The language code (see Wiktionary:Languages). This is required.
2=
,3=
...- One or more categories. There is no limit to how many you can specify. Empty values will be skipped.
sort=
- Provides a custom sort key. This will override the automatically generated sort key.
Eisimpleirean - Examples
[deasaich]{{Categorize|en|Cockney rhyming slang}}
adds:
- Category:Cockney rhyming slang
{{Catlangname|en|nouns}}
adds:
- Category:English nouns
{{Catlangname|pt|suffixes}}
adds:
- Category:Portuguese suffixes
{{Catlangcode|en|Biology}}
adds:
- Category:en:Biology
{{Catlangcode|pt|Biology}}
adds:
- Category:pt:Biology
Faic cuideachd - Also see
{{Categorize}}
{{Catlangname}}
{{Catlangcode}}
The above documentation is transcluded from Teamplaid:Categorize/documentation. (edit | history) Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Please add categories to the /documentation subpage. Subpages of this template. |