Module:Catnav/doc/built-template/districts of a country/doc

Showcase

Without coats of arms (usually used, exemplary prefix value):

{{#parsoid\0fragment:0}}{{#parsoid\0fragment:1}}
{{|prefix=:Category:}}

With coats of arms (and another exemplary prefix value):

{{#parsoid\0fragment:2}}{{#parsoid\0fragment:3}}
{{|prefix=:Category:Architecture of|coats=yes}}
.. and added indentation, which may alternatively be enabled via user customization:
{{#parsoid\0fragment:4}}{{#parsoid\0fragment:5}}
{{|prefix=:Category:Architecture of|coats=yes|indent=1}}

Use only coats of arms and no text (affects accessibility negatively (!)):

{{#parsoid\0fragment:6}}{{#parsoid\0fragment:7}}
{{|prefix=:Category:Buildings in|coats=only}}
{{#parsoid\0fragment:8}}{{#parsoid\0fragment:9}}
{{|prefix=:Category:Buildings in|coats=only|compact=yes}}
.. and bigger icons, the default width of which was 15px in the examples above:
{{#parsoid\0fragment:10}}{{#parsoid\0fragment:11}}
{{|coatssize=48px|coats=only|compact=yes|prefix=:Category:Nature of}}

Corner cases

Grammar article or preposition handling

Usually there's no need to specify article or city_article parameters, because the template automatically checks common cases. If you encounter a set of categories that deviate from the common case, setting these parameters will override autodetect logic. For example, the following source lines yield the same result:

{{#parsoid\0fragment:12}}{{#parsoid\0fragment:13}}
{{#parsoid\0fragment:14}}{{#parsoid\0fragment:15}}
{{#parsoid\0fragment:16}}{{#parsoid\0fragment:17}}{{#parsoid\0fragment:18}}
{{|prefix=:Category:Coats of arms of}}

If city_article does not differ from article, you can omit the parameter. In this case article will be used for the urban districts as well.

Modifying the link target of the flag image

Usually there's no need to specify flaglink parameter, but sometimes the appropriate top level category to link to is not found automatically. Continuing the example above, Coats of arms of does not seem to be a proper super category to the coats of arms district categories. The alternatives at present are Coats of arms from or Coats of arms of districts in . To point to an alternative use flaglink like this:

{{#parsoid\0fragment:19}}{{#parsoid\0fragment:20}}{{#parsoid\0fragment:21}}
{{|prefix=:Category:Coats of arms of|flaglink=:Category:Coats of arms from }}
{{#parsoid\0fragment:22}}{{#parsoid\0fragment:23}}{{#parsoid\0fragment:24}}
{{|prefix=:Category:Coats of arms of|flaglink=districts in }}

Internally, if a concatenation of prefix, flaglink, suffix does not yield an existing link target, flaglink will be used unaffixed. In the first of the two examples above, the full form is used, because concatenating prefix with flaglink=from would yield the undesirable result :Category:Coats of arms of from .

Sometimes a proper top level category does not exist (yet) in commons - creating it is preferred to specifying an flaglink that may become obsolete/suboptimal/wrong in the future.

Test cases

Customization

You can css style the output of this template using class catnav in your common.css settings.

/* disable the border, center the content and make the background transparent */
.catnav {
	text-align: center;
	background: transparent;
	border: none;
}

/* achieve the same effect as if indent=1 was passed to the template
  (to apply this to all catnav instances driven by Module:Catnav
   remove "" suffix)
*/
.catnav .catnav_seq {
	display: table-row !important;
}
.catnav .catnav_seqdata {
	display: table-cell !important;
	padding-top: .4em;
}
.catnav .catnav_seqlabel br {
	display: none;
}
.catnav .catnav_seqlabel {
	display: table-cell !important;
	white-space: nowrap;
	text-align: right;
	vertical-align: top;
	padding-right: .4em;
	padding-top: .4em;
}

/* move the icons on mouse hover */
.catnav img {
  transition: all .15s ease-in-out;
}
.catnav img:hover {
  transform: translate3d(0, 5px, 0);
}

Maintenance

Generic Description

Category:Module documentation#Catnav/doc/built-template/districts%20of%20a%20country/doc

Category navigational template - template to assist navigation across related categories, e.g. Buildings in X where X is replaced by place names listed in the built template.

Usage


{{Catnav/doc/built-template/districts of a country/doc |all= |prefix= |suffix= }}

Template parameters

ParameterDescriptionDefaultStatus
allshow all items, including items where no page exists (red links). Set to 1 if you want to list all names (useful when the template is used in a parent directory for helping the creation of missing pages with coherent names). When it is empty by default, this list will be filtered from missing pages.
Without this parameter, every target page name is tested with a #ifexist: parser function, which is considered costly. Do not list too many names in this template. If this built template is used on a page with other similar templates, a parser limit may be exausted, and you'll need to set this parameter to 1 for each of these template uses in that page.
nooptional
prefixparameter to customise target page names of links, with text added before the relevant link parameter, e.g. :Category:Buildings in, or :Template:Seasons in. Without the prefix, the links will point to gallery pages of the main namespace.emptyoptional
suffixparameter to customise template use, with text added after the relevant link parameter, e.g. (example needed)emptyoptional

Additional information

The template is intended to be used in the following namespaces: no namespace specified

The template is intended to be used by the following user groups: all users

Placement: At the top of the page

Relies on:
Module:Catnav

Localization

To add your language to the list of languages supported by this template, please edit the template and add a row to the "{{LangSwitch|}}" construct. It takes the form "|xx= Your translation " (xx being the code of your language)

Country map
Country map
Category:Module documentation