Jump to content

ទំព័រគំរូ:catboiler/doc

ពីWiktionary


This template is a helper template for generating category boilerplate templates. It is not meant to be used directly, but is to be used by a more specific template such as {{poscatboiler}}.

Parameters

[កែប្រែ]

This template and its subtemplates have various parameters which are passed in between them. Most of the subtemplates share a common set:

  • {{{temp}}} - The name of the specific template that uses the catboiler system.
  • {{{code}}} - The code that specifies what 'owns' the category's contents. This is usually a language code such as en, but it can also be a script code like Latn or the code of a language family.
  • {{{label}}} - A name for the thing that is being categorised. How the label is interpreted depends on the label subtemplate's properties, and it could be anything at all in theory. This name is used internally, and is also used as the name of the category unless the label's mask property overrides this. If an empty label is provided to {{catboiler}} (but not its subtemplates), the label is ROOT.
  • {{{sc}}} - The script of the items to be categorised. This is usually empty, but many categories such as those used by Mandarin Chinese can split into subcategories based on script.
  • {{{c}}} - Unknown. Always empty.

General workings

[កែប្រែ]

There are two possible ways for labels to be generated, based on the labeltype setting in {{catboiler customize}}. Both methods use one or more subtemplates of the current template, and use {{catboiler helper}} as a helper template (see below).

The first, called subtemplate mode, uses one subtemplate for each label. So, for example, the label noun for the template {{poscatboiler}} would use a subtemplate called {{poscatboiler/noun}}. Each subtemplate defines its own settings for that specific label, and this is useful if there is no systematic way to decide what the contents of each category should be or what its parents are. If a category is created that does not have a corresponding subtemplate, an error is shown with a link to the missing subtemplate. The subtemplate for the ROOT label is named ROOT and must always be present.

The second, called single mode, uses one subtemplate named ALL to handle all labels, including the ROOT label. This is useful if finer control over the labels is needed, and if there is an easy way to automatically determine the contents and parents of each category. No error checking is done, so the subtemplate itself is responsible for handling invalid labels and such. An example of a template that uses this mode is {{derivcatboiler}}, which uses {{derivcatboiler/ALL}} to automatically generate the parents of each category based on the family/superfamily of the current label.

The catboiler template system distinguishes three kinds of category.

Subtemplates

[កែប្រែ]

The following are the main subtemplates called directly by catboiler.

These categories are supplemental and are used in various places throughout the catboiler template system.

  • {{catboiler helper}} - A helper template that is used to create label subtemplates.
  • {{catboiler customize}} - Defines specific settings for each template that uses catboiler. If you create a new template, you should add its settings here.
  • {{catboiler format}} - Generates the names of the categories.
  • {{catboiler getproperty}} - Gets a property from a label subtemplate of the current template.