Халип:Инфобокс/doc: Версиязда гьоркьор батӀалъиял

Контент гилдана Контент жубана
Новая страница: «{{distinguish|Template:Userbox}} {{Docpage}} <includeonly>{{#ifeq:{{#titleparts:{{PAGENAME}}|1|2}}|old ||{{High-use|3408796|all-pages=yes}}{{Lua|Module:Infobox}}}...»
 
г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. [[HelpСправка:Infobox]] contains an introduction about the recommended content and design of infoboxes; [[WikipediaВикипедия:Manual of Style/Infoboxes]] contains additional style guidelines. See [[WP:List of infoboxes]] and [[:Category:Infobox templates]] for lists of prepared topic-specific infoboxes.
 
== 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 : See the [[#Embedding|Embedding]] section for details. If this is set to "yes", this child infobox should be titled but have no name parameter. This parameter is empty by default, set it to "yes" to activate it.
; subbox : See the [[#Subboxes|Subboxes]] section for details. If this is set to "yes", this subbox should be titled but have no name parameter. This parameter is empty by default, set to "yes" to activate it. It has no effect if the '''child''' parameter is also set to "yes".
; 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 [[WikipediaВикипедия:Manual of Style/Accessibility#Tables|accessibility reasons]], this is the most recommended alternative.
; 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 [[UserУчастник:Frietjes/infoboxgap.js]] or [[ModuleМодуль:IncrementParams]].
 
==== Making data fields optional ====
Мухъ 173:
| label6 = Static item | data6 = Static value
}}
<sourcesyntaxhighlight lang="moin" style="overflow:auto">
{{Infobox
| title = Example of an optional header
Мухъ 183:
| label6 = Static item | data6 = Static value
}}
</sourcesyntaxhighlight>{{clear}}
 
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 [[WikipediaВикипедия:WikiProject Microformats]] for more information on adding microformat information to Wikipedia, and [[microformat]] for more information on microformats in general.
 
== Examples ==
Мухъ 268:
|imagestyle =
|captionstyle =
|image = [[FileФайл:Example-serious.jpg|200px|alt=Example alt text]]
|caption = Caption displayed below File:Example-serious.jpg
 
Мухъ 294:
|below = Below text
}}
<sourcesyntaxhighlight lang="Sass" style="overflow:auto" highlight="15">
{{Infobox
|name = {{subst:PAGENAME}}
Мухъ 309:
|imagestyle =
|captionstyle =
| image = [[FileФайл:Example-serious.jpg|200px|alt=Example alt text]]
|caption = Caption displayed below Example-serious.jpg
 
Мухъ 335:
|below = Below text
}}
</sourcesyntaxhighlight>{{clear}}
 
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
}}
<sourcesyntaxhighlight lang="sass" highlight="3,9" style="overflow: auto">
{{Infobox
|name = {{subst:PAGENAME}}
Мухъ 400:
|below = Below text
}}
</sourcesyntaxhighlight>{{clear}}
 
== 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.
 
[[WikipediaВикипедия:WikiProject Infoboxes/embed]] includes some links to Wikipedia articles which include infoboxes embedded within other infoboxes.
 
== Subboxes ==
Мухъ 535:
| header6 = Main 6
}}
<sourcesyntaxhighlight lang="sass" style="overflow:auto">
{{Infobox
| headerstyle = background-color:#eee;
Мухъ 555:
| header6 = Main 6
}}
</sourcesyntaxhighlight>{{clear}}
 
Similar embedding techniques may be used within content parameters of some other templates generating tables (such as [[:Template:Sidebar|Sidebar]]) :
Мухъ 577:
| heading5 = Heading 5
}}
<sourcesyntaxhighlight lang="sass" style="overflow:auto">
{{Sidebar
| navbar = off
Мухъ 596:
| heading5 = Heading 5
}}
</sourcesyntaxhighlight>{{clear}}
 
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 [[TemplateШаблон:Wbr/doc#Controlling line-breaking in infoboxes]] for details.
 
== 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. [[WikipediaВикипедия:WikiProject Transwiki|WikiProject Transwiki]] has a version of this template that has been modified to work on other MediaWikis.
 
== See also ==
* [[ModuleМодуль:Infobox]], the [[WP:LUA|Lua]] module on which this template is based
* [[SpecialСлужебная:Permalink/558855956|Template:Infobox/old]], the previous ParserFunctions implementation
* [[ModuleМодуль:Check for unknown parameters]]
* {{tl|Infobox3cols}}
* {{tl|Navbox}} and {{tl|Sidebar}}
* [[WikipediaВикипедия:List of infoboxes|List of infoboxes]]
* [[: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 | |
[[CategoryКатегория:Infobox templates| ]]
[[CategoryКатегория:Wikipedia metatemplates|Infobox]]
[[CategoryКатегория:Templates generating microformats]]
[[CategoryКатегория:Templates that add a tracking category]]
[[CategoryКатегория:Lua-based infobox templates]]
}}</includeonly>
 
== Tracking categories ==
* {{clc|Articles with missing Wikidata information}}