• Home
  • Random
  • Nearby
  • Log in
  • Settings
Donate Now If Wikipedia is useful to you, please give today.
  • About Wikipedia
  • Disclaimers
Wikipedia

Template:Category if exists/sandbox

  • Template
  • Talk
  • Language
  • Watch
  • Edit
< Template:Category if exists
This is the template sandbox page for Template:Category if exists (diff).
See also the companion subpage for test cases.
Template documentation[view] [edit] [history] [purge]
WarningThis template is used on approximately 76,000 pages and changes may be widely noticed. Test changes in the template's /sandbox or /testcases subpages, or in your own user subpage. Consider discussing changes on the talk page before implementing them.
Due to a server limit of 500 "expensive parser function" calls (e.g. #ifexist:, PAGESIZE:, and PAGESINCATEGORY:), this template will only work properly if the page using it has not already exceeded the limit. When the limit is exceeded, the page using this template or module is categorised in Category:Pages with too many expensive parser function calls. (further information)
Shortcut
  • {{Category ifexistTemplate:Category ifexist}}
This template uses Lua:
  • Module:If not given or empty

This template outputs a category if the category exists. Otherwise, it returns nothing. It is intended for use in templates.

This template follows category redirects (using {{resolve category redirect}}).

TemplateData

edit
This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools. See a monthly parameter usage report for Template:Category if exists in articles based on its TemplateData.

TemplateData for Category if exists

Outputs a link to a category if it exists; otherwise returns nothing.

Template parameters[Edit template data]

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Category name1

Category for potential inclusion if it exists. "Category:" prefix is optional.

Example
Category:Writers
Page namerequired
Sort key2

[[WP:SORTKEY]] of the category.

Suggested values
*
Example
Foo
Lineoptional

See also

edit
  • Template:Category link if exists
The above documentation is transcluded from Template:Category if exists/doc. (edit | history)
Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages.
Add categories to the /doc subpage. Subpages of this template.
Retrieved from "https://en.wikipedia.org/w/index.php?title=Template:Category_if_exists/sandbox&oldid=1240647209"
Last edited on 16 August 2024, at 15:00

Languages

      This page is not available in other languages.

      Wikipedia
      • Wikimedia Foundation
      • Powered by MediaWiki
      • This page was last edited on 16 August 2024, at 15:00 (UTC).
      • Content is available under CC BY-SA 4.0 unless otherwise noted.
      • Privacy policy
      • About Wikipedia
      • Disclaimers
      • Contact Wikipedia
      • Code of Conduct
      • Developers
      • Statistics
      • Cookie statement
      • Terms of Use
      • Desktop