Difference between revisions of "Template:Category pair/doc"
imported>Frietjes |
imported>Zyxw m (note Lua module used, update link to tracking category, add template category) |
||
| Line 1: | Line 1: | ||
{{Documentation subpage}} | {{Documentation subpage}} | ||
| − | <!-- PLEASE ADD CATEGORIES | + | <!-- PLEASE ADD CATEGORIES AT THE BOTTOM OF THIS PAGE --> |
| + | {{Lua|Module:Check for unknown parameters}} | ||
==Usage== | ==Usage== | ||
| Line 42: | Line 43: | ||
== Tracking categories == | == Tracking categories == | ||
| − | * | + | * {{clc|Pages using category pair with no output}} |
: If neither parameter is a category which currently exists the template will produce no output. This is ''not necessarily an error''; the other categories may simply be part of an incomplete series which will be completed in due course | : If neither parameter is a category which currently exists the template will produce no output. This is ''not necessarily an error''; the other categories may simply be part of an incomplete series which will be completed in due course | ||
| − | * | + | * {{clc|Pages using category pair with more than 2 parameters}} |
: See above: [[#Error checking|Error checking]] | : See above: [[#Error checking|Error checking]] | ||
| Line 56: | Line 57: | ||
[[Category:Internal category-link templates]] | [[Category:Internal category-link templates]] | ||
[[Category:Hatnote templates for category pages]] | [[Category:Hatnote templates for category pages]] | ||
| + | [[Category:Templates that add a tracking category]] | ||
}} | }} | ||
</includeonly> | </includeonly> | ||
Revision as of 02:40, 8 February 2019
| 40px | This is a documentation subpage for Template:Category pair. It contains usage information, categories and other content that is not part of the original template page. |
| 30px | This template uses Lua: |
Usage
Place
{{Category pair|CATEGORY NAME1|CATEGORY NAME2}}
on the top of the category page, replacing "CATEGORY NAMEn" with the names only of the target categories, leaving out the term "Category:".
Each category is displayed only if it exists. If neither category exists, nothing will be displayed.
If there is no succeeding category, you may simply place:
{{Category pair|CATEGORY NAME1}}
on the top of the category page, replacing "CATEGORY NAME1" with the name only of the target category, leaving out the term "Category:".
If there is no preceding category, then leave the first parameter empty, and simply place:
{{Category pair| |CATEGORY NAME2}}
on the top of the category page, replacing "CATEGORY NAME2" with the name only of the target category, leaving out the term "Category:".
Examples
- Preceding and succeeding categories, both exist
{{Category pair|19th century|21st century}}→{{Category pair|20th century|22nd century}}→
- Preceding category only, which exists
{{Category pair|20th century}}→
- Succeding category only, which exists
{{Category pair||5th century}}→
- Preceding and succeeding categories, only preceding exists
{{Category pair|7th century|Nth century}}→
- Preceding and succeeding categories, only succeeding exists
{{Category pair|Xth century|5th century}}→
- Two non-existent categories, so no output
{{Category pair|81st century|83rd century}}→
Error checking
If more than two parameters are supplied, a warning message is shown when the page is previewed and when it is saved the page is added to a hidden tracking category: Category:Pages using Template:Category pair with more than 2 parameters.
Only the first two parameters are processed. Others are ignored.
If more than two parameters are supplied, the template is unlikely to do what the editor intended e.g.
{{tlx|Category pair|CATEGORY NAME1|CATEGORY NAME2|CATEGORY NAME3}}will ignore CATEGORY NAME3{{tlx|Category pair|CATEGORY NAME1||CATEGORY NAME2}}will ignore CATEGORY NAME2, because a duplicate|character between the two categories causes CATEGORY NAME2 to be the third parameter rather the second
Tracking categories
- If neither parameter is a category which currently exists the template will produce no output. This is not necessarily an error; the other categories may simply be part of an incomplete series which will be completed in due course
- See above: Error checking
See also
- {{Preceding category}}
- {{Succeeding category}}
- {{Category see also}}
- {{Category see also if exists}}