Халип:Инфобокс/doc: Версиязда гьоркьор батӀалъиял
Контент гилдана Контент жубана
Новая страница: «{{distinguish|Template:Userbox}} {{Docpage}} <includeonly>{{#ifeq:{{#titleparts:{{PAGENAME}}|1|2}}|old ||{{High-use|3408796|all-pages=yes}}{{Lua|Module:Infobox}}}...» |
Xqbot (гьоркьолъел | хӀалтӀи) гI.-м. Bot: Replace deprecated <source> tag and "enclose" parameter; косметические изменения |
||
Мухъ 15:
}}
This template is intended as a meta template: a template used for constructing other templates. '''Note''': In general, it is not meant for use directly in an article, but can be used on a one-off basis if required. [[
== Usage ==
{{tlf|Infobox}} is a meta-template: used to organise an actual <nowiki>{{Infobox sometopic}}</nowiki> template (like {{tl|Infobox building}}).
For <code><nowiki>[[Template:Infobox sometopic]]</nowiki></code>, template code then looks like this, simplified:
Мухъ 40:
== Optional control parameters ==
; name : If this parameter is present, "view/discuss/edit" links will be added to the bottom of the infobox pointing to the named page. You may use the value <nowiki>{{subst:PAGENAME}}</nowiki>; however, this is rarely what you want because it will send users clicking these links in an infobox to the template code rather than the data in the infobox they probably want to change.
; child :
; subbox :
; decat : If this is set to "yes", the current page will not be autocategorized in a maintenance category when the generated infobox has some problems or no visible data section. Leave empty by default or set to "yes" to activate it.
Мухъ 49:
There are two different ways to put a title on an infobox. One contains the title inside the infobox's border in the uppermost cell of the table, the other puts it as a caption on top of the table. You can use them both together, or just one or the other, or neither (though this is not recommended):
; title : Text to put in the caption over the top of the table (or as section header before the whole content of this table, if this is a child infobox). For [[
; above : Text to put within the uppermost cell of the table.
; subheader(n) : additional title fields which fit below {{{title}}} and {{{above}}}, but before images.
Мухъ 118:
</pre>{{clear}}
It is also possible to automatically renumber parameter names by using [[
==== Making data fields optional ====
Мухъ 173:
| label6 = Static item | data6 = Static value
}}
<
{{Infobox
| title = Example of an optional header
Мухъ 183:
| label6 = Static item | data6 = Static value
}}
</
header1 will be shown if any of item1, item2, or item3 is defined. If none of the three parameters are defined the header won't be shown and no empty row appears before the next static content. The trick to this is that the <code>#if</code> returns false only if there is nothing whatsoever in the conditional section, so only if all three of item1, item2 and item3 are undefined will the if statement fail.
Мухъ 249:
...and so forth. "above" and "title" can also be given classes, since these are usually used to display the name of the subject of the infobox.
See [[
== Examples ==
Мухъ 268:
|imagestyle =
|captionstyle =
|image = [[
|caption = Caption displayed below File:Example-serious.jpg
Мухъ 294:
|below = Below text
}}
<
{{Infobox
|name = {{subst:PAGENAME}}
Мухъ 309:
|imagestyle =
|captionstyle =
| image = [[
|caption = Caption displayed below Example-serious.jpg
Мухъ 335:
|below = Below text
}}
</
For this example, the {{para|bodystyle}} and {{para|labelstyle}} parameters are used to adjust the infobox width and define a default width for the column of labels:
Мухъ 369:
|below = Below text
}}
<
{{Infobox
|name = {{subst:PAGENAME}}
Мухъ 400:
|below = Below text
}}
</
== Embedding ==
Мухъ 511:
Note that omitting the {{para|title}} parameter, and not including any text preceding the embedded infobox, may result in spurious blank table rows, creating gaps in the visual presentation.
[[
== Subboxes ==
Мухъ 535:
| header6 = Main 6
}}
<
{{Infobox
| headerstyle = background-color:#eee;
Мухъ 555:
| header6 = Main 6
}}
</
Similar embedding techniques may be used within content parameters of some other templates generating tables (such as [[:Template:Sidebar|Sidebar]]) :
Мухъ 577:
| heading5 = Heading 5
}}
<
{{Sidebar
| navbar = off
Мухъ 596:
| heading5 = Heading 5
}}
</
Note that the default padding of the parent data cell containing each subbox is still visible, so the subboxes are slightly narrower than the parent box and there's a higher vertical spacing between standard cells of the parent box than between cells of distinct subboxes.
== Controlling line-breaking in embedded bulletless lists ==
Template {{tlx|nbsp}} may be used with {{tlx|wbr}} and {{tlx|nowrap}} to control line-breaking in bulletless lists embedded in infoboxes (e.g. cast list in {{tlx|Infobox film}}), to prevent wrapped long entries from being confused with multiple entries. See [[
== Full blank syntax ==
Мухъ 699:
== Porting to other MediaWikis ==
The infobox template requires the [[:mw:Extension:Scribunto|Scribunto]] extension and [[mw:Manual:Using content from Wikipedia#HTMLTidy|HTMLTidy]] to be installed. It may not work with other MediaWikis. [[
== See also ==
* [[
* [[
* [[
* {{tl|Infobox3cols}}
* {{tl|Navbox}} and {{tl|Sidebar}}
* [[
* [[:Module:InfoboxImage]]
* Maintenance categories:
Мухъ 713:
** [[:Category:Pages which use embedded infobox templates with the title parameter]] ({{PAGESINCATEGORY:Pages which use embedded infobox templates with the title parameter|pages}})
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | |
[[
[[
[[
[[
[[
}}</includeonly>
== Tracking categories ==
* {{clc|Articles with missing Wikidata information}}
|