টেমপ্লেট:Worldbox person

Arsait (আলোচনা | অবদান) কর্তৃক ০২:২২, ২৬ ফেব্রুয়ারি ২০২৫ তারিখে সংশোধিত সংস্করণ


টেমপ্লেট:Wikipedia how to

Templates are a very powerful feature of MediaWiki, but can be confusing to new users and even experienced users can have difficulty making sense of the more complex ones. Templates should therefore be accompanied by documentation to improve usability.

Template documentation should explain what a template does and how to use it. It should be simple enough that a user without complete knowledge of the intricacies of template syntax—which includes many experienced contributors who focus their attention elsewhere—can use it correctly. This is especially true in the case of very widely used templates.

Editors should defer to official policies or guidelines when template documentation pages are inconsistent with established community standards and principles. Editors should also avoid "quoting" template documentation pages as though they are policy—including this how-to guide. Template documentation pages can be written without much—if any—debate, as opposed to Wikipedia policies that have been thoroughly vetted by the community (see WP:Local consensus for details).

What to include

Template documentation should cover:

  • The basic purpose of the template: what it does and if it is not immediately obvious, why it needs to be done. If there are other templates with similar names or purposes, it's a good idea to mention those, in order to reduce the chance of the wrong one being used. Include important limitations, such as the lack of {{Navbox visibility}} on the Mobile web site, if a template should only be used for certain countries or time periods, or other things that editors need to know before choosing to use the template.
  • The parameters of the template: whether they are numbered, named or optional, and if so, what the default values are and what effect they have. If a parameter can take only a limited set of values or is constrained in any way, for example, if it can only use "yes", "no", or a number, this should be clearly explained.
  • Usage examples: specify the exact wikitext that should be used and the result that it produces. The wikitext can be enclosed in a <code>...</code> container, to make it clear and easy to copy, like this. If the template can be used in several ways, with or without optional parameters, for example, provide a range of examples. A good way to do so is to transclude the template itself into the documentation a few times (i.e., use live examples), with different parameters each time and list the parameters used in each case. With {{demo}} this can be done without putting the template call twice in the wikitext.
  • TemplateData tags: See Wikipedia:TemplateData/Tutorial.
  • Related templates: if the template is one of a series of templates, include links to these – in particular, ensure that every template in the series is linked from each of the others, as this makes navigation easier. (A separate navigation template may be useful for this purpose, e.g., {{Protection templates}}).
  • Categories where applicable (InterWikimedia links should be listed at Wikidata – more information at Wikipedia:Wikidata). Like the documentation, categories must be listed within a <noinclude>...</noinclude> container on a template, or within <includeonly>টেমপ্লেট:((Sandbox otherটেমপ্লেট:!!...টেমপ্লেট:))</includeonly> tags if placed on a documentation page. Many template categories are available, see: Category:Wikipedia templates to browse through them.

The English Wikipedia is a source of templates for hundreds of other Wikipedias and sister projects. Often, templates are fully self-contained, so the process is easy: The contents are simply copied to a new template page at the other wiki, and everything works. However, on more complex templates, the template may invoke a module, transclude other templates, only work if paired with a separate template, or need particular CSS or JavaScript code to work. In these cases, it is helpful to include a brief list of templates or other code that this one requires, at the end of the documentation.

Where to place it

When viewing the rendered template page itself (as opposed to its wikicode), what is usually visible right under the title is the rendered template itself, followed by a separate section to display the template's rendered documentation, followed by the categories to which the template belongs. Categories and documentation of any sort on a template page (including TemplateData) should always be enclosed by noinclude tags, so that they do not show up when the template is used on another page.

The editable wikicode for the template's documentation is often placed on a separate subpage of the template itself, which is then transcluded at the end of the template page. This separates the often complex template code from the documentation, making the documentation easier to edit and reducing the number of accidental editing errors in the template code. It also allows templates to be protected where necessary, limiting editing access to important templates' code while allowing anyone to edit those templates' documentation. This method is sometimes referred to as the "template-doc page pattern".

How to create a documentation subpage

Put documentation in the template

You must put {{documentation}} when creating (publishing) a template. Then a documentation page is created with [view] [edit] [history] [purge] links. You can create and edit the template documentation clicking in this pane [edit] link.

Template documentation subpages using {{documentation}} are named and formatted using the following general pattern, for consistency.

Suppose your template is named Template:X. Edit the template and append the following at the end of the template code, or use টেমপ্লেট:Subst:

টেমপ্লেট:Colors<noinclude>
{{Documentation}}
<!-- Add categories to the /doc subpage and interwikis in Wikidata, not here! -->
</noinclude>

This will transclude {{documentation}} at the bottom of the template page.

Important: Make sure the opening <noinclude> begins immediately after the last character of the template code or text and not on a new line, nor with any intervening spaces. Otherwise, extra space will be inserted below the template when it is used, which is usually not wanted.

If the template is already protected, ask an administrator to do this or request an edit by using an টেমপ্লেট:Tl2 on the template's talk page. If documentation and categories already exist in a section, enclosed within a <noinclude>...</noinclude> container, move them into the documentation subpage (where they should be enclosed in <includeonly>...</includeonly>), as it is best not to have documentation split across two separate pages.

Automatic creation

Use [create] link at the bottom of the empty documentation box to automatically create a preloaded documentation subpage. Insert the documentation after the top line and categories under the appropriate comment line – leaving the comment in place, so that the layout is preserved when the page is edited in future. Related templates, policy page, projects, etc. can be linked to by adding a "See also" section. Save the subpage.

Manual creation

To create the documentation subpage manually, create a subpage with the name Template:X/doc. See the details at {{Documentation subpage}} or start the page by copy-pasting the following standard wikitext:

{{Documentation subpage}}
== Usage ==


<includeonly>{{Sandbox other||
<!-- Categories below this line -->

}}</includeonly>

The top line will display a message explaining the current page and a link to the template page. Save the subpage and follow instructions in টেমপ্লেট:Section link.

With TemplateData

Instead of manually writing a lead graf and a usage table, the {{Format TemplateData}} template can do most of the job. Simply write your TemplateData in the table interface, and then wrap it into a template call like {{Format TemplateData|1=<templatedata>...</templatedata>}} at the top of the page.

Notes

You may wish to redirect the talk page of the /doc subpage to the talk page of the template itself. Then all talk relating to the template and its documentation will end up on the same talkpage. For example, redirect Template talk:X/doc to Template talk:X.

A documentation page can also be redirected to the /doc subpage of another template, if that covers the usage for both templates. In this case, clicking the links to view or edit the documentation will directly open the target of the redirect. If it is necessary to access the redirect itself (e.g. to remove the redirect and create a separate doc page), go to the template URL by clicking in the location bar at the top of your browser, and add /doc at the end.

Blank

To generate a blank template, which may then be copied from the documentation and pasted into another page, use:

{{subst:#tag:pre|{{subst:Parameters|code|base={{subst:BASEPAGENAME}}}}|style=overflow: auto;}}

Examples

To generate an instance of the template, populated with its own property names, use:

{{subst:Parameters|demo|base={{subst:BASEPAGENAME}}|_base=}}

Categories and interwiki links

  • To place the template itself into a category, add the [[Category:Category name]] code inside an <includeonly>...</includeonly> section on the doc subpage. See টেমপ্লেট:Section link for guidelines.
  • To create an interwiki link for the template itself, go to Wikidata and follow the instructions for adding links to pages.
  • To place the doc subpage into a category, add the [[Category:Category name]] code inside a <noinclude>...</noinclude> section on the doc subpage.
  • To make the template place an article into a category (when the article includes the template), add the [[Category:Category name]] code inside an <includeonly>...</includeonly> section on the template page. Exact placement within the template code may affect how the category code is executed. See টেমপ্লেট:Section link for guidelines.

/sandbox and /testcases

Before doing changes to a template it can be good to first copy the template code to a sandbox and run some testcases, since the template might be visible on thousands or even millions of pages. If you create subpages named exactly "/sandbox" and "/testcases" to a template then the green টেমপ্লেট:Tlc box on the template auto-detects this and will show links to those pages in its header. See Wikipedia:Template sandbox and test cases for more information.

Several templates, one documentation page

When several templates work together or are very similar then it is often clearer and easier to maintain one single documentation page that documents them together. The simplest way to do this is to make a full documentation page at one of the templates, and then make "soft redirects" from the other templates. See, for instance: {{wrap}}.

Directly on a template page

When a documentation subpage has not been created, and the {{documentation}} template is being used with a |content= parameter on the actual template page, then to place the template itself into a category, add টেমপ্লেট:Elc inside the documentation template, after the content. For example, for placement on the actual template page:

<!--Last line of your template code--><noinclude>
{{Documentation
 | content =
<!-- template documentation -->

[[Category:Category name]]
[[Category:Category name2]]
}}</noinclude>

When no documentation is needed

When a template as displayed will link to a page that can serve as the documentation, then separate documentation is superfluous and does not need to be created. For instance, a stub template, using the {{asbox}} template as a base, will already display pre-loaded common documentation for all stub templates using that template, and will not need additional documentation.

Tips and tricks

Here are some tips to facilitate writing documentations:

  • Links to templates like {{Japanese year|1800}} can be inserted by writing {{tlp|Japanese year|1800}}. See {{tlp}} for similar templates.
  • HTML tags like <ref group="note">...</ref> can be easily inserted with {{tag}}. This example is written as {{tag|ref|params=group="note"}}
  • Equals sign = can be inserted with টেমপ্লেট:Tn. For example, {{Citation needed|date=1900-02-29}} is made by {{tlp|Citation needed|date{{=}}1900-02-29}}. Avoid the equivalent notation &#61; which is not easy to read for other editors.
  • Don't forget the single <nowiki /> tag:
  • For a link to a category, use {{cat}}. For example, {{cat|Templates with incorrect parameter syntax}} becomes টেমপ্লেট:Cat.
  • Use utility templates to quickly build-up documentation , e.g. টেমপ্লেট:T. See Category:Documentation shared content templates.
  • To suppress categorization of the /sandbox and /testcases pages of the template (if they exist), use this code at the bottom of the documentation subpage:
<includeonly>{{sandbox other||{{testcases other||
<!-- Categories below this line, please; interwikis at Wikidata -->

}}}}</includeonly>
  • When the template is a child infobox, documentation appears broken. Prevent this by adding the <includeonly> tag:
{{Some infobox (child) template
|  child = <includeonly>yes</includeonly>
| label1 = Hello
|  data1 = World
}}<noinclude>{{documentation}}</noinclude>

See also

টেমপ্লেট:Help navigation টেমপ্লেট:Wikipedia technical help


Documentation

This is the documentation page for the Worldbox person template. It provides detailed information about a person, such as their personal information, office details, career details, and more. This template is used to create consistent and well-structured person pages, especially for Worldbox characters or other related figures.

Parameters

  • name: The name of the person (defaults to "No name provided"). This parameter is used to display the person's name at the top of the template.
  • verified_icon: The icon representing verification (optional). If a verified icon is available, provide its file name (e.g., `Verified_icon.png`).
  • native_name: The native name of the person (defaults to "N/A"). This is used to display the name in the person's native script or language.
  • image: The image of the person (defaults to "No_image_available.svg"). This is used to display the person's image. If no image is available, it will show the placeholder image.
  • nickname: The nickname of the person (defaults to "N/A"). Provide the person's nickname, if available.
  • image_date: The approximate date when the image was captured (defaults to "N/A"). This is used to show the date the image was taken.
  • image_capture_from: The source of the image capture (defaults to "N/A"). Mention where the image was captured or who took the photograph.
  • office: The office held by the person (defaults to "N/A"). Mention the position or role held by the person (e.g., "President").
  • organization: The organization the person is associated with (defaults to "N/A"). Mention the name of the organization (e.g., "Worldbox Company").
  • term_start: The start date of the person's office term (defaults to "N/A"). If the person holds an office, specify the start date (e.g., "2015-01-01").
  • birth_date: The birth date of the person (defaults to "Unknown"). Use the format `YYYY-MM-DD` for the birth date.
  • birth_place: The birth place of the person (defaults to "Unknown"). Provide the name of the city or country where the person was born.
  • nationality: The nationality of the person (defaults to "Unknown"). Provide the person's nationality or country of citizenship.
  • occupation: The occupation of the person (defaults to "Unknown"). Mention the person's profession or career.
  • years_active: The years in which the person has been active (defaults to "N/A"). Indicate the years during which the person was active in their field or profession.
  • height: The height of the person (defaults to "N/A"). Provide the height of the person (e.g., "6 feet").
  • spouse: The spouse of the person (defaults to "N/A"). Mention the name of the person's spouse, if applicable.
  • father: The father of the person (defaults to "N/A"). Mention the name of the person's father, if applicable.
  • awards: The awards the person has received (defaults to "N/A"). List any major awards or recognitions the person has received.
  • website: The official website of the person (defaults to "N/A"). Provide the URL of the person's official website, if available.
  • signature: The signature image of the person (defaults to "No_signature.png"). Provide the file name of the person's signature image (if applicable).
  • native_name_lang: The language code of the native name (defaults to "N/A"). Specify the language in which the native name is written (e.g., `bn` for Bengali).
  • english_page: The English Wikipedia page of the person (defaults to "N/A"). Provide the title of the English Wikipedia page, if available.
  • bangla_page: The Bangla Wikipedia page of the person (defaults to "N/A"). Provide the title of the Bangla Wikipedia page, if available.
  • hindi_page: The Hindi Wikipedia page of the person (defaults to "N/A"). Provide the title of the Hindi Wikipedia page, if available.
  • urdu_page: The Urdu Wikipedia page of the person (defaults to "N/A"). Provide the title of the Urdu Wikipedia page, if available.

Usage

To use this template, include the following code on the page:


See also



TemplateData for Worldbox person

This is the TemplateData for the Worldbox person template, used to display detailed information about a person in Worldbox.

Description

This template is used to display detailed information about a person, including personal details, office details, and more. It allows the addition of various parameters such as the name, image, office, birth date, and other key details.

Parameters

  • name: The name of the person (defaults to "No name provided").
  • verified_icon: The icon representing verification (optional).
  • native_name: The native name of the person (defaults to "N/A").
  • image: The image of the person (defaults to "No_image_available.svg").
  • nickname: The nickname of the person (defaults to "N/A").
  • image_date: The approximate date when the image was captured (defaults to "N/A").
  • image_capture_from: The source of the image capture (defaults to "N/A").
  • office: The office held by the person (defaults to "N/A").
  • organization: The organization the person is associated with (defaults to "N/A").
  • term_start: The start date of the person's office term (defaults to "N/A").
  • birth_date: The birth date of the person (defaults to "Unknown").
  • birth_place: The birth place of the person (defaults to "Unknown").
  • nationality: The nationality of the person (defaults to "Unknown").
  • occupation: The occupation of the person (defaults to "Unknown").
  • years_active: The years in which the person has been active (defaults to "N/A").
  • height: The height of the person (defaults to "N/A").
  • spouse: The spouse of the person (defaults to "N/A").
  • father: The father of the person (defaults to "N/A").
  • awards: The awards the person has received (defaults to "N/A").
  • website: The official website of the person (defaults to "N/A").
  • signature: The signature image of the person (defaults to "No_signature.png").
  • native_name_lang: The language code of the native name (defaults to "N/A").
  • english_page: The English Wikipedia page of the person (defaults to "N/A").
  • bangla_page: The Bangla Wikipedia page of the person (defaults to "N/A").
  • hindi_page: The Hindi Wikipedia page of the person (defaults to "N/A").
  • urdu_page: The Urdu Wikipedia page of the person (defaults to "N/A").

Usage

To use this template, include the following code on the page:

{{Worldbox person
| name = 
| verified_icon = 
| native_name = 
| image = 
| nickname = 
| image_date = 
| image_capture_from = 
| office = 
| organization = 
| term_start = 
| birth_date = 
| birth_place = 
| nationality = 
| occupation = 
| years_active = 
| height = 
| spouse = 
| father = 
| awards = 
| website = 
| signature = 
| native_name_lang = 
| english_page = 
| bangla_page = 
| hindi_page = 
| urdu_page = 
}}

See also