This page is protected against editing.

Template:Resolve category redirect

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search
Template documentationview · edit · history · purge ]

Resolves a category redirect.

It takes one parameter, which is the name of a category. It returns that category name, unless the category exists and is a {{Category redirect}} ... when it returns the name of the redirect target.

Usage

{{Resolve category redirect|categoryname}}

Examples

Category exists and is not redirected
Category:1970s
  • {{Resolve category redirect|1970s}} → 1970s
  • {{Resolve category redirect|Category:1970s}} → Category:1970s
Category exists and is a soft redirect
Category:View
  • {{Resolve category redirect|View}} → Views
  • {{Resolve category redirect|Category:View}} → Views
Category exists and is a soft redirect
Category:Organisations (uses alias Template:Seecat)
  • {{Resolve category redirect|Organisations}} → Organisations
  • {{Resolve category redirect|Category:Organisations}} → Category:Organisations
Category exists and is a soft redirect
Category:Wellcome Library manuscripts (uses alias Template:Catredirect)
  • {{Resolve category redirect|Wellcome Library manuscripts}} → Manuscripts in the Wellcome Collection
  • {{Resolve category redirect|Category:Wellcome Library manuscripts}} → Manuscripts in the Wellcome Collection
Category exists and is a soft redirect
Category:Rail cars of Italy (uses alias Template:Redirect category)
  • {{Resolve category redirect|Rail cars of Italy}} → Rail cars of Italy
  • {{Resolve category redirect|Category:Rail cars of Italy}} → Category:Rail cars of Italy
Category exists and is a soft redirect
Category:Coretos in Portugal (uses alias Template:cat-red)
  • {{Resolve category redirect|Coretos in Portugal}} → Bandstands in Portugal
  • {{Resolve category redirect|Category:Coretos in Portugal}} → Bandstands in Portugal
Non-existent category
Category:Colourless green things
  • {{Resolve category redirect|Colourless green things}} → Colourless green things
  • {{Resolve category redirect|Category:Colourless green things}} → Category:Colourless green things
MediaWiki:Babel-category-override
This resolves, among others, Category:User pt-BR to Category:User pt-br
Similar with Module:Redirect
(fails on some others, basic syntax: {{#invoke:redirect|main|[[Category:View]]}}

Uses in templates

Template currently using it: Search

Category redirects

Do not use templates in the target name of category redirects.

{{Resolve category redirect}} cannot expand any templates in the target name, and the { character caused crashes (as did } and !). So it does not attempt to resolve any redirect where the target includes those characters.

Example (from English Wikipedia)
  • Category:1781 in Mexico‎ contained {{category redirect|{{title year}} in New Spain}} which cannot be resolved. To be safe, {{Resolve category redirect|1781 in Mexico‎}} simply returned 1781 in Mexico‎.
    The above example has since been changed to {{category redirect|1781 in New Spain}}, which can be resolved.

See also