Difference between revisions of "Template:Category"
Jump to navigation
Jump to search
Line 22: | Line 22: | ||
-->{{#if: {{{1|}}} | {{#ifexist: Category:{{{1}}} | [[Category:{{{1}}}]] }} }} }} }} }} }}<!-- | -->{{#if: {{{1|}}} | {{#ifexist: Category:{{{1}}} | [[Category:{{{1}}}]] }} }} }} }} }} }}<!-- | ||
--></includeonly> | --></includeonly> | ||
+ | |||
+ | <noinclude> | ||
+ | [[Category:Templates]] | ||
+ | </noinclude> |
Latest revision as of 22:50, 22 March 2025
This template helps with page categorizing. It's intented for use especially in other templates. Takes max. 5 parameters and starts to check category existence from the last one, only the last existing category is used as a result.
Examples
{{Category|Europe|Germany|Bavaria|nonexistentcategory}} --> [[Category:Bavaria]] {{Category|Germany|Bavaria}} --> [[Category:Bavaria]] {{Category|Canada|Quebec|Montérégie}} --> [[Category:Quebec]]
Note
Tthis template doesn't check if a category is under another category, picture is only informal. Therefore it's good to use for geo/administrative categories. Don't use it to put page in more categories e.g. {{Category|Poland|Slovakia|Border crossings}}.