Template:Foo–Bar relations category/doc

This creates a category page for the category of bilateral relations between two countries named "Foo" and "Bar."

The page name must take the form "Category:Foo–Bar relations", with an endash between the two country names. The template will report an error if the title does not take this form.

Note that using "Category:Foo-Bar relations" will be treated as an error because it uses a dash rather than an endash.

Usage change

{{Foo–Bar relations category}}

Two optional parameters are available:

  • main=, which sets the name of the "main article" link in the category header. The default is the category title, but in some cases, this may not be appropriate:
  • map=, which sets the filename of the map displayed in the category header. The default is derived from the category title, but in some cases, this may be inappropriate or unavailable

{{Foo–Bar relations category|main=Some article|map=somefile}}

Output change

Most countries change

[[File:Foo Bar Locator.png]]

{{Cat main}}

[[Category:Bilateral relations of Foo|Bar]]
[[Category:Bilateral relations of Bar|Foo]]

"The" Country change

This template uses {{CountryPrefixThe}} to intelligently handle countries whose name is prefixed by "the" in running text. e.g. "the United States" or "the Soviet Union"

Example: Category:Comoros–Ghana relations

{{Cat main}}

[[Category:Bilateral relations of Ghana|Comoros]]
[[Category:Bilateral relations of the Comoros|Ghana]]

Exceptions change

In some cases, the parent Category:Bilateral relations of SomeCountry may use a different name to that used in "Category:SomeCountry–OtherCountry relations" categories. In such cases, a sub-template Template:Foo–Bar relations category/fixcountryname handles the correction. As of December 2018, its only entry is Palestine/State of Palestine: e.g. Category:Ireland–State of Palestine relations is a subcat of Category:Bilateral relations of the State of Palestine.

Location map change

Unless a |map= parameter is supplied, the sub-template {{Foo–Bar relations category/mapname}} looks for a map, and displays it if found.

There is a large collection of bilateral maps at Commons:Category:Bilateral maps.

For an example Category:Foo–Bar relations, the template looks in the following order:

  1. File:Foo Bar Locator.png
  2. File:Foo Bar Locator.svg
  3. File:Bar Foo Locator.png
  4. File:Bar Foo Locator.svg

If no file is found with those titles, the search is repeated using a lower "locator".

Tracking categories change

Used on a non-category page

Used on category page with an invalid title

"main=" has a non-nil value

"main=" has a non-nil value, but the page specified does not exist

A location map is generated

No location map is generated

"map=" has a non-nil value

"map=" has a non-nil value, but the page specified does not exist

See also change