Template:Foos (dis)established in YYYY category header/doc

To make a category of the form "Foos established in YYYY" or "Foos disestablished in YYYY", where YYYY is a year (e.g. "872", "1976", or "2015"), and "Foos" is a type of entity, e.g. "Companies" or "Hospitals"

e.g.
 * Category:Hospitals established in 1877
 * Category:Companies disestablished in 1904

Usage
No parameters are needed, but some optional parameters may be supplied.

How it works
The template parses the page title, and derives three items from it:
 * 1) The type of entity
 * 2) The action, i.e. either "established" or "disestablished"
 * 3) The year

So for example, if used on Category:Organizations established in 1837:
 * 1) type = "Organizations"
 * 2) action = "established"
 * 3) year = 1837

That page is categorised in three parent categories:
 * Category:Organizations by year of establishment
 * Category:Organizations established in the 1830s
 * Category:1837 establishments

In some cases, this is sufficient. However, in other cases, the parent category should be a sub-category of Category:1837 establishments.

Foe example, Category:Transport companies established in 1926 should be a sub-category of Category:Companies established in 1926, and per WP:SUBCAT it should not be directly in Category:1926 establishments.

In cases such as these, extra parameters are needed.

Parameters for establishment type parent categories
Up to three un-named parameters may be used to specify parent types

e.g. On Category:Transport companies established in 1926:

The parameter "Companies" causes the page to be parented in Category:Companies established in 1926, instead of Category:1926 establishments

Redirects

 * Template:Foos established in YYYY category header
 * Template:Foos disestablished in YYYY category header