Template:C/doc: Difference between revisions
Template page
More actions
mNo edit summary |
Fix language-code links to use Wikipedia interwiki prefixes |
||
| (10 intermediate revisions by 4 users not shown) | |||
| Line 1: | Line 1: | ||
{{ | <!-- Add categories where indicated at the bottom of this page and interwikis at Wikidata --> | ||
{{tsh|catlink}} | |||
{{Heavily used template|3=very}} | |||
<!-- {{Heavily used template}} | <!-- {{Heavily used template}} | ||
{{Use sandbox|testcase= }} -->{{TemplateBox | {{Use sandbox|testcase= }} --> | ||
|1=1 | {{TemplateBox | ||
|1d=category name, with or without a namespace | | useTemplateData = 1 | ||
| | |||
| | | desc-td-en = | ||
|2=2 | Links to a category, either within the Commons or to another Wikipedia and offers additional options for the layout formatting, the linking and more. | ||
|2d=link text to display (instead of category name) | |||
|2def=param. #1 | In its simplest form <nowiki>{{c|category name}}</nowiki> does the same as <nowiki>[[:Category:category name|category name]]</nowiki>: producing a link to a category displaying just “category name” (without prefixing with the namespace“Category:”). | ||
|2stat=optional | Understrokes in the category name are replaced by spaces, a lowercase first character is converted to uppercase. | ||
|3=3 | <nowiki/> | ||
|3d=The 3{{exp|rd}} parameter establishes either | |||
| 1 = 1 | |||
| 1label-en = Category | |||
| 1d-en = category name, with or without a namespace | |||
| 1stat = required | |||
| 1type = wiki-page-name | |||
| 2 = 2 | |||
| 2label-en = Display Text | |||
| 2d-en = link text to display (instead of category name) | |||
| 2def = param. #1 | |||
| 2stat = optional | |||
| 2type = line | |||
| 3 = 3 | |||
| 3label-en = Option | |||
| 3d-en = The 3{{exp|rd}} parameter establishes either | |||
*interwiki access, with any language code, | *interwiki access, with any language code, | ||
::''or'' | ::''or'' | ||
| Line 18: | Line 36: | ||
**non-existing categories are not linked, but displayed | **non-existing categories are not linked, but displayed | ||
::(not specified): text is displayed in black color | ::(not specified): text is displayed in black color | ||
::when < | ::when <code>3=x</code> (lower case): text is displayed in red color | ||
::when < | ::when <code>3=<big>X</big></code> (upper case): display with red background | ||
:''or'' | :''or'' | ||
*when < | *when <code>3=<big>B</big></code> (upper case): text is displayed within {{!((}}…{{))!}}-'''b'''rackets | ||
*when < | *when <code>3=<big>G</big></code>: <nowiki>[[Category:</nowiki> will be '''g'''enerated; par.2 is sorting option | ||
| | <nowiki/> | ||
|3stat=optional- | |||
|4=4 | | 3d-td-en = The 3rd parameter establishes either: | ||
|4d=+/- to precede the category name with the namespace <code>Category:</code> | * Interwiki access, with any language code, | ||
:'''+''' ("plus" sign) to make < | or | ||
:'''-''' ("minus" sign) to precede < | * A link to a category on Commons, always with check for existence | ||
The +/- parameter can as well be specified with parameter 2 or 3<br> | ** Existing categories are linked and displayed | ||
** Non-existing categories are not linked, but displayed | |||
*** (not specified): text is displayed in black color | |||
*** 3=x (lower case): text is displayed in red color | |||
*** 3=X (upper case): text is displayed in red color | |||
or | |||
* 3=B (upper case): text is displayed within {{!((}}…{{))!}}-brackets | |||
* 3=G (upper case): “{{!((}}Category:” will be generated; par.2 is sorting option | |||
<nowiki/> | |||
| 3sv = x/X/B/G | |||
| 3stat = optional- | |||
| 3type = string | |||
| 4 = 4 | |||
| 4label-en = Include “Category:” Prefix? | |||
| 4d-en = +/- to precede the category name with the namespace <code>Category:</code> | |||
:'''+''' ("plus" sign) to make <code>Category:</code> a part of the link, | |||
:'''-''' ("minus" sign) to precede <code>Category:</code> as a plain text.<br /> | |||
The +/- parameter can as well be specified with parameter 2 or 3<br /> | |||
(If ''both'' signs are specified, "+" has precedence). | (If ''both'' signs are specified, "+" has precedence). | ||
| | |||
|4stat=optional- | | 4d-td-en = +/- to precede the category name with the namespace “Category:” | ||
; + ("plus" sign) | |||
: to make “Category:” a part of the link, | |||
; - ("minus" sign) | |||
: to precede “Category:” as a plain text. | |||
The +/- parameter can as well be specified with parameter 2 or 3 | |||
(If both signs are specified, “+” has precedence). | |||
<nowiki/> | |||
| 4sv = +/- | |||
| 4stat = optional- | |||
| 4type = string | |||
| 5 = link | |||
| 5label-en = Link? | |||
| 5d-en = Whether to link to the target category page, set to <code>n</code> or <code>none</code> for a plain text result. | |||
| 5d-td-en = Whether to link to the target category page, set to “n” or “none” for a plain text result. | |||
| 5sv = n/none | |||
| 5stat = optional- | |||
| 5type = string | |||
|name=C | |name=C | ||
|desc=Links to a category, either within the Commons or to another Wikipedia< | |desc=Links to a category, either within the Commons or to another Wikipedia <br />{{Nobold|and offers additional options for the layout formatting, the linking and more.<br /><br />In its simplest form <code><nowiki>{{c|</nowiki>''category name''<nowiki>}}</nowiki></code> does the same as <code><nowiki>[[:category:</nowiki>''category name''<nowiki>|</nowiki>''category name''<nowiki>]]</nowiki></code> :<br />producing a link to a category displaying just ''[[:category:help|category name]]'' (without prefixing with the namespace“Category:”).}} | ||
|namespace=all | |namespace=all | ||
|usergroup=all | |usergroup=all | ||
| Line 49: | Line 105: | ||
|i18n-desc=The template does not generate any localizable text. With + or - always the namespace (in English) is used. | |i18n-desc=The template does not generate any localizable text. With + or - always the namespace (in English) is used. | ||
|i18n-mediawiki-msg= | |i18n-mediawiki-msg= | ||
|seealso = * [[Cat|< | |seealso = * [[Cat|<code><nowiki>[[Cat:</nowiki> </code>]] → [[:cat:Typing-aid templates]] | ||
* {{tl|cl}}{{0|e}} → {{cl|Typing-aid templates}} | * {{tl|cl}}{{0|e}} → {{cl|Typing-aid templates}} | ||
* {{tl|lc}}{{0|e}} → {{lc|Typing-aid templates}} | * {{tl|lc}}{{0|e}} → {{lc|Typing-aid templates}} | ||
* {{tl|lcs}} → {{lcs|Typing-aid templates}} | * {{tl|lcs}} → {{lcs|Typing-aid templates}} | ||
* {{tl| | * {{tl|Catseealso}} link to other categories | ||
* {{tl|F}} → similar functions for files | * {{tl|F}} → similar functions for files | ||
* {{tl|M}} → similar functions for modules | |||
* {{tl|T}} → similar functions for templates | |||
* {{Tl|Igen/cat}} for categorizing – different possibilities parametrizable | * {{Tl|Igen/cat}} for categorizing – different possibilities parametrizable | ||
| Line 69: | Line 128: | ||
Parameter 1 is the category name. Parameter 2 may specify any text do be displayed instead. | Parameter 1 is the category name. Parameter 2 may specify any text do be displayed instead. | ||
The template will display <nowiki>{{{2}}}</nowiki>, or just the category name given as <nowiki>{{{1}}}</nowiki>. | The template will display <nowiki>{{{2}}}</nowiki>, or just the category name given as <nowiki>{{{1}}}</nowiki> (but with replacing<br />understrokes in the category name by spaces, and converting a lowercase first character to uppercase). | ||
The standard usage is without any prefix and without a namespace. No test occurs, redlinks can result. | The standard usage is without any prefix and without a namespace. No test occurs, redlinks can result. | ||
| Line 82: | Line 141: | ||
When parameter 3 is either X or x, | When parameter 3 is either X or x, | ||
or when a namespace is encountered, a check for existence is performed.<br> | or when a namespace is encountered, a check for existence is performed.<br /> | ||
This can avoid the generation of a redlink to a not-existing category. | This can avoid the generation of a redlink to a not-existing category. | ||
When later the category is defined, the display occurs like standard as above. | When later the category is defined, the display occurs like standard as above. | ||
| Line 106: | Line 165: | ||
*{{Tle|T=C|Internal link templates}} produces {{C|Internal link templates}} | *{{Tle|T=C|Internal link templates}} produces {{C|Internal link templates}} | ||
*{{Tle|T=C| | *{{Tle|T=C|internal_link_templates|}} produces {{C|internal_link_templates|}} | ||
*{{Tle|T=C|Internal link templates||B}} produces {{C|Internal link templates||B}} | *{{Tle|T=C|Internal link templates||B}} produces {{C|Internal link templates||B}} | ||
*{{Tle|T=C|Internal link templates|Cat:I-l-t|B}} produces {{C|Internal link templates|Cat:I-l-t|B}} | *{{Tle|T=C|Internal link templates|Cat:I-l-t|B}} produces {{C|Internal link templates|Cat:I-l-t|B}} | ||
| Line 112: | Line 171: | ||
# {{Tle|T=C|Not-existing-cat}} produces {{C|Not-existing-cat}}<br><!-- | # {{Tle|T=C|Not-existing-cat}} produces {{C|Not-existing-cat}}<br /><!-- | ||
-->{{Tle|T=C|Not-existing-cat|display}} produces {{C|Not-existing-cat|display}} | -->{{Tle|T=C|Not-existing-cat|display}} produces {{C|Not-existing-cat|display}} | ||
# {{Tle|T=C|Category:Not-existing-cat}} produces {{C|Category:Not-existing-cat}}<br><!-- | # {{Tle|T=C|Category:Not-existing-cat}} produces {{C|Category:Not-existing-cat}}<br /><!-- | ||
-->{{Tle|T=C|Category:Not-existing-cat|display}} produces {{C|Category:Not-existing-cat|display}} | -->{{Tle|T=C|Category:Not-existing-cat|display}} produces {{C|Category:Not-existing-cat|display}} | ||
# {{Tle|T=C|Not-existing-cat|p2=3|x}} produces {{C|Not-existing-cat|3=x}}<br><!-- | # {{Tle|T=C|Not-existing-cat|p2=3|x}} produces {{C|Not-existing-cat|3=x}}<br /><!-- | ||
-->{{Tle|T=C|Not-existing-cat|display-cat|x}} produces {{C|Not-existing-cat|display-cat|x}} | -->{{Tle|T=C|Not-existing-cat|display-cat|x}} produces {{C|Not-existing-cat|display-cat|x}} | ||
# {{Tle|T=C|Not-existing-cat|p2=3|X}} produces {{C|Not-existing-cat|3=X}}<br><!-- | # {{Tle|T=C|Not-existing-cat|p2=3|X}} produces {{C|Not-existing-cat|3=X}}<br /><!-- | ||
-->{{Tle|T=C|Not-existing-cat|displayname|X}} produces {{C|Not-existing-cat|displayname|X}} | -->{{Tle|T=C|Not-existing-cat|displayname|X}} produces {{C|Not-existing-cat|displayname|X}} | ||
| Line 129: | Line 188: | ||
*{{Tle|T=C|Commons:Multimedia Features/MediaViewer}} produces {{C|Commons:Multimedia Features/Media Viewer}} | *{{Tle|T=C|Commons:Multimedia Features/MediaViewer}} produces {{C|Commons:Multimedia Features/Media Viewer}} | ||
*{{Tle|T=C|Category:Commons:Multimedia Features/Media Viewer}} produces {{C|Category:Commons:Multimedia Features/Media Viewer}} | *{{Tle|T=C|Category:Commons:Multimedia Features/Media Viewer}} produces {{C|Category:Commons:Multimedia Features/Media Viewer}} | ||
Link parameter: | |||
* {{Tle|T=C|Internal link templates|p2=link|n}} produces {{C|Internal link templates|link=n}}<br/><!-- | |||
-->{{Tle|T=C|Internal link templates|p2=link|none}} produces {{C|Internal link templates|link=none}} | |||
* {{Tle|T=C|Category:Internal link templates|p2=link|n}} produces {{C|Category:Internal link templates|link=n}}<br/><!-- | |||
-->{{Tle|T=C|Category:Internal link templates|p2=link|none}} produces {{C|Category:Internal link templates|link=none}} | |||
==== Interwiki access ==== | ==== Interwiki access ==== | ||
It is not possible to check for existence in other Wikipedias.<br>The link is always established, whether the category exists or not. | It is not possible to check for existence in other Wikipedias.<br />The link is always established, whether the category exists or not. | ||
*{{Tle|T=C|Main||en}} or {{Tle|T=C|Main|p2=3|en}} produces {{C|Main||en}} | *{{Tle|T=C|Main||w:en}} or {{Tle|T=C|Main|p2=3|w:en}} produces {{C|Main||w:en}} | ||
*{{Tle|T=C|Wikipedia:Hilfe|German help pages|de}} produces {{C|Wikipedia:Hilfe|German help pages|de}} | *{{Tle|T=C|Wikipedia:Hilfe|German help pages|w:de}} produces {{C|Wikipedia:Hilfe|German help pages|w:de}} | ||
*{{Tle|T=C|Accueil|Catégorie:Accueil|fr}} produces {{C|Accueil|Catégorie:Accueil|fr}} | *{{Tle|T=C|Accueil|Catégorie:Accueil|w:fr}} produces {{C|Accueil|Catégorie:Accueil|w:fr}} | ||
*{{Tle|T=C|Kangxi radicals||wiktionary}} produces {{C|Kangxi radicals||wiktionary}} | *{{Tle|T=C|Kangxi radicals||wiktionary}} produces {{C|Kangxi radicals||wiktionary}} | ||
*{{Tle|T=C|Wikcionario:Apéndices|Categoría:Apéndices|wiktionary:es}} produces {{C|Wikcionario:Apéndices|Categoría:Apéndices|wiktionary:es}} | *{{Tle|T=C|Wikcionario:Apéndices|Categoría:Apéndices|wiktionary:es}} produces {{C|Wikcionario:Apéndices|Categoría:Apéndices|wiktionary:es}} | ||
| Line 142: | Line 207: | ||
*{{Tle|T=C|A|-}} produces {{C|A|-}} | *{{Tle|T=C|A|-}} produces {{C|A|-}} | ||
*{{Tle|T=C|B|+}} produces {{C|B|+}} | *{{Tle|T=C|B|+}} produces {{C|B|+}} | ||
*{{Tle|T=C|C|Konsonant C|de|+}} produces {{C|C|Konsonant C|de|+}} | *{{Tle|T=C|C|Konsonant C|w:de|+}} produces {{C|C|Konsonant C|w:de|+}} | ||
<includeonly> | |||
{{Commons:Link templates/Category links}} | |||
<includeonly>{{Sandbox other|| | |||
<!-- Categories below this line; interwikis at Wikidata --> | |||
[[Category:Internal link templates|{{PAGENAME}}]] | [[Category:Internal link templates|{{PAGENAME}}]] | ||
[[Category:Interwiki link templates|{{PAGENAME}}]] | [[Category:Interwiki link templates|{{PAGENAME}}]] | ||
[[Category:Typing-aid templates|{{PAGENAME}}]] | [[Category:Typing-aid templates|{{PAGENAME}}]] | ||
[[Category:One-letter templates| ]] | [[Category:One-letter templates| ]] | ||
</includeonly> | }}</includeonly> | ||