Difference between revisions of "Template:Infobox"

From Appropedia
Jump to navigation Jump to search
(Restructuring)
Line 1: Line 1:
<table class="infobox {{{bodyclass|}}}" style="{{{bodystyle|}}}">{{#if:{{{form|}}}|
+
<div class="infobox">{{#if:{{{form|}}}|
 
<div class="infobox-edit">[[File:Font Awesome 5 solid pencil-alt.svg|30px|link=Special:FormEdit/{{{form}}}|Edit the infobox]]</div>
 
<div class="infobox-edit">[[File:Font Awesome 5 solid pencil-alt.svg|30px|link=Special:FormEdit/{{{form}}}|Edit the infobox]]</div>
 
}}{{#if:{{{above|}}}|
 
}}{{#if:{{{above|}}}|
<tr><td colspan="2" class="infobox-above {{{aboveclass|}}}" style="{{{abovestyle|}}}">{{{above}}}</td></tr>}}
+
<div class="infobox-above">{{{above}}}</div>}}
<tr><th colspan="2" class="infobox-title {{{titleclass|}}}" style="{{{titlestyle|}}}">{{#if:{{{title|}}}|{{{title}}}|{{PAGENAME}}}}</th></tr>{{#if:{{{subheader|}}}|
+
<div class="infobox-title">{{#if:{{{title|}}}|{{{title}}}|{{PAGENAME}}}}</div>{{#if:{{{below|}}}|
{{Infobox/row
+
<div class="infobox-below">{{{below}}}</div>}}{{#if:{{{image|}}}|
|data={{{subheader}}}
+
<div class="infobox-image">{{#ifexist:Media:{{{image}}}|[[File:{{{image}}}|{{#if:{{{image-size|}}}|{{{image-size}}}|200px}}]]|{{{image}}}}}}}{{#if:{{{caption|}}}|<div class="infobox-caption">{{{caption}}}</div>}}</div>
|datastyle={{{subheaderstyle}}}
+
<table class="infobox-data">{{Infobox/row
|class={{{subheaderclass|}}}
 
|rowclass={{{subheaderrowclass}}}
 
}}}}{{#if:{{{image|}}}|
 
{{Infobox/row
 
|data={{#if:{{{image|}}}|{{#ifexist:Media:{{{image}}}|[[File:{{{image}}}|{{#if:{{{image-size|}}}|{{{image-size}}}|200px}}]]|{{{image}}}}}}}{{#if:{{{caption|}}}|<div class="infobox-caption">{{{caption}}}</div>}}
 
|datastyle={{{imagestyle|}}}
 
|class={{{imageclass|}}}
 
|rowclass={{{imagerowclass|}}}
 
}}}}{{Infobox/row
 
 
  |header={{{header0|}}} |headerstyle={{{headerstyle|}}}
 
  |header={{{header0|}}} |headerstyle={{{headerstyle|}}}
 
  |label={{{label0|}}}  |labelstyle={{{labelstyle|}}}
 
  |label={{{label0|}}}  |labelstyle={{{labelstyle|}}}
Line 515: Line 506:
 
  |data={{{data99|}}}    |datastyle={{{datastyle|}}}
 
  |data={{{data99|}}}    |datastyle={{{datastyle|}}}
 
  |class={{{class99|}}}  |rowclass={{{rowclass99|}}}
 
  |class={{{class99|}}}  |rowclass={{{rowclass99|}}}
}}</table><templatestyles src="Infobox/styles.css" />{{#set:
+
}}</table></div><templatestyles src="Infobox/styles.css" />{{#set:
 
|Has title = {{#if:{{{title|}}}|{{{title}}}|{{PAGENAME}}}}
 
|Has title = {{#if:{{{title|}}}|{{{title}}}|{{PAGENAME}}}}
 
|Has image = {{#ifexist:Media:{{{image|}}}|File:{{{image}}}}}
 
|Has image = {{#ifexist:Media:{{{image|}}}|File:{{{image}}}}}
 
|Has image caption = {{{caption|}}}
 
|Has image caption = {{{caption|}}}
 
}}{{#if:{{{category|}}}|{{#if:{{NAMESPACE}}||[[Category:{{{category}}}]]}}}}<noinclude>{{Documentation}}</noinclude>
 
}}{{#if:{{{category|}}}|{{#if:{{NAMESPACE}}||[[Category:{{{category}}}]]}}}}<noinclude>{{Documentation}}</noinclude>

Revision as of 13:03, 21 October 2020

Infobox

Template documentation[edit]

This template is as a metatemplate: a template used for constructing other templates. It is not meant for use directly in content pages.

Basic usage

This is an advanced template. Before using or modifying it, you should be familiar with templates in general. Then look at how it's used on existing infoboxes and follow the examples.

See also