Template:Infobox: Difference between revisions
From Pixar Cars Wiki
no edit summary
RodRedlineM1 (talk | contribs) |
RodRedlineM1 (talk | contribs) |
||
(25 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
{{#switch: {{{1|}}} | {{#switch: {{{1|}}} | ||
| start = <div class="infobox-wrapper"><div class="infobox-inner-wrapper"> | | start = <div class="infobox-wrapper" style="{{{outer_style|}}}"><div class="infobox-inner-wrapper" style="{{{inner_style|}}}"> | ||
{{!C}} class="infobox" id="{{{id|}}}" cellspacing="{{{cellspacing|}}}" | {{!C}} class="infobox" id="{{{id|}}}" style="{{{style|}}}" cellspacing="{{{cellspacing|0}}}" | ||
| title = ! id="{{{id|}}}" colspan="{{{colspan|}}}" {{{other|}}} {{!}} {{{text|}}} | | title = ! id="infobox-title {{{id|}}}" colspan="{{{colspan|2}}}" style="{{{style|}}}" {{{other|}}} {{!}} {{{text|}}} | ||
| image = {{#if: {{{image|}}} |{{!}}- | |||
{{!}} class="infobox-image-cell" colspan="2" style="text-align:center; {{{style|}}}" {{!}} {{#if:{{{image_style|}}}|<div style="{{{image_style|}}}">|}}[[File:{{{image|}}}{{!}}{{#if:{{{image_size|}}}|{{{image_size|}}}|280px}}]]{{#if:{{{caption|}}}|<br/><span class="caption" style="font-size:11px">{{{caption|}}}</span>|}}{{#if:{{{image_style|}}}|</div>|}}|}} | |||
| end = {{Table_end}}</div></div> | | end = {{Table_end}}</div></div> | ||
}}<noinclude> | | section = {{#if:{{{entries|}}}|{{!}}- class="infobox-section" id="{{{id|}}}" | ||
{{!}} colspan="2" style="padding:0 !important" {{!}} | |||
{{!C}} class="mw-collapsible mw-collapsed" style="width:100%;" cellspacing="0" | |||
! colspan="2" style="text-align: center;line-height: 1.5;padding: 5px;{{#if:{{{style|}}}|{{{style|}}}|}}" {{{other|}}} {{!}} {{{name|}}} | |||
{{!}}- | |||
{{{entries|}}} | |||
{{!}}- | |||
{{Table_end}} |}} | |||
| row = {{#if:{{{data|}}}|{{!}}- | |||
{{Infobox/Row|row|data={{{data|}}}|label={{{label|}}}|id={{{id|}}}}}|}} | |||
|}}<noinclude> | |||
This is the infobox builder, designed for ease-of-use and to help maintain consistency between different templates. Heavily inspired by [https://destinypedia.com/Template:Infobox Destinypedia]'s setup and approach. | |||
{{Syntax table}} | |||
|- | |||
! <nowiki>{{{1|}}}</nowiki> value | |||
! Associated code | |||
|- | |||
|{{Code|start}} | |||
|<pre style="max-width:600px;"><div class="infobox-wrapper" style="{{{outer_style|}}}"><div class="infobox-inner-wrapper" style="{{{inner_style|}}}"> | |||
{{!C}} class="infobox" id="{{{id|}}}" style="{{{style|}}}" cellspacing="{{{cellspacing|0}}}"</pre> | |||
|- | |||
|{{Code|title}} | |||
| <pre style="max-width:600px;">! id="infobox-title {{{id|}}}" colspan="{{{colspan|2}}}" style="{{{style|}}}" {{{other|}}} {{!}} {{{text|}}}</pre> | |||
|- | |||
|{{Code|image}} | |||
| <pre style="max-width:600px;">{{#if: {{{image|}}} |{{!}}- | |||
{{!}} class="infobox-image-cell" colspan="2" style="text-align:center; {{{style|}}}" {{!}} {{#if:{{{image_style|}}}|<div style="{{{image_style|}}}">|}}[[File:{{{image|}}}{{#if:{{{image_size|}}}|{{!}}{{{image_size|}}}|}}]]{{#if:{{{caption|}}}|<br/><span class="caption" style="font-size:11px">{{{caption|}}}</span>|}}{{#if:{{{image_style|}}}|</div>|}}|}}</pre> | |||
|- | |||
|{{Code|section}} | |||
| <pre style="max-width:600px;">{{#if:{{{entries|}}}|{{!}}- class="infobox-section" id="{{{id|}}}" | |||
{{!}} colspan="2" style="padding:0 !important" {{!}} | |||
{{!C}} class="mw-collapsible mw-collapsed" style="width:100%;" cellspacing="0" | |||
! colspan="2" style="text-align: center;line-height: 1.5;padding: 5px;{{#if:{{{style|}}}|{{{style|}}}|}}" {{{other|}}} {{!}} {{{name|}}} | |||
{{!}}- | |||
{{{entries|}}} | |||
{{!}}- | |||
{{Table_end}} |}}</pre> | |||
|- | |||
|{{Code|row}} | |||
|<pre style="max-width:600px;">{{Code|row}} | |||
{{#if:{{{data|}}}|{{!}}- | |||
{{Infobox/Row|row|data={{{data|}}}|label={{{label|}}}}}|}}</pre> | |||
|- | |||
|{{Code|end}} | |||
|<pre style="max-width:600px;">|}</div></div></pre> | |||
{{Table_end}}<pre> | |||
{{Infobox|{{{1}}}|situational value 1|situational value 2|etc.}} | |||
</pre><div style="clear:both" /> | |||
==Components== | |||
*{{tem|infobox/Row}} | |||
{{Infobox|start|id=character}} | {{Infobox|start|id=character}} | ||
{{Infobox|end}} | {{Infobox|title|id=infobox-title|colspan=2|text=Name}} | ||
{{Infobox|section|other={{#if: {{{boxcolor|}}} |class="infobox-{{{boxcolor|}}}"|}}|name=Section title|entries= | |||
{{Infobox|row|data=Test2|label=Test1}} | |||
}} | |||
{{Infobox|end}}[[Category:Infobox templates| ]] | |||
</noinclude> | </noinclude> |