Template:Infobox: Difference between revisions

From Nguhcraft Wiki
Jump to navigation Jump to search
m (3 revisions imported)
No edit summary
Tag: 2017 source edit
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<includeonly><table class="infobox" style="background-color:#f8f9fa;border:1px solid #a2a9b1;padding:0.2em;float:right;font-size:88%;line-height:1.5em;clear:right;margin:0.5em 0 0.5em 1em;width:22em;text-align:left;display:inline-table">{{{1|}}}</table></includeonly><noinclude>{{Documentation}}</noinclude>
<includeonly><nowiki /><table class="infobox" style="background-color:#f8f9fa;border:1px solid #a2a9b1;padding:0.2em;float:right;font-size:88%;line-height:1.5em;clear:right;margin:0.5em 0 0.5em 1em;width:22em;text-align:left;display:inline-table">{{{1|}}}</table><nowiki /></includeonly><noinclude>[[Category:Infobox templates|*]]
{{Documentation}}</noinclude>

Latest revision as of 06:24, 15 December 2024

Documentation

Example ŋation
RulerEggs Ample
LanguagesExamplese
Examplian

This is a template for creating (classic) infoboxes. Classic infoboxes are essentially an HTML table with CSS to make it look like an infobox. This template just contains the outer <table> element, and it takes one unnamed parameter which is the content inside the infobox. The different infobox components themselves require a bit of CSS and other things, so there are templates for those as well. It is mainly intended for creating infobox templates that are in turn used in articles, but it can be used directly as well. An infobox template page might contain text that looks something like this:

{{Infobox|
{{Infobox/above|{{{name|}}}}}
{{Infobox/row|Ruler|{{{ruler|}}}}}
{{Infobox/row|Languages|{{{languages|}}}}}
}}

The line breaks are not necessary. The parameters for this template would be name, ruler and languages. The | after the parameter names means that the default value is what comes after the | (i.e. nothing). The helper templates have an if statement that makes it so that they only appear if a non-empty value is provided. This means that if ruler, for example, is left empty or omitted, that row will not show up.