Difference between revisions of "Template:InfoBox"

From Detective Conan Wiki
(The first unnamed parameter can take the place of main=; re-indenting some lines)
m (Template:InfoBox/CollapsibleTable -> Template:InfoBox/CollapsibleRow)
 
(15 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
<includeonly>{{#if: {{{chronology|}}}
 
<includeonly>{{#if: {{{chronology|}}}
|<div style="{{#if: {{{header-color|}}} |--header-color:{{{header-color|}}};}}">
+
|<div style="{{#if: {{{header-color|}}} |--header-color: {{{header-color}}};}} --header-text-color: {{#if: {{{header-text-color|}}} |{{{header-text-color}}} | #fff }};">
 
   {{{chronology}}}
 
   {{{chronology}}}
   <div class="infobox" style="width: 275px; font-size: 90%; display: flex; flex-direction: column; gap: 4px; padding: 0.4em;">{{{main|{{{1|}}}}}}</div>
+
   <div class="infobox" style="width: 275px; font-size: 90%; padding: 4.5px;">{{{main|}}}</div>
 
</div>
 
</div>
|<div class="infobox" style="width: 275px; font-size: 90%; display: flex; flex-direction: column; gap: 4px; padding: 0.4em; {{#if: {{{header-color|}}} |--header-color:{{{header-color|}}};}}">{{{main|{{{1|}}}}}}</div>
+
|<div class="infobox" style="width: 275px; font-size: 90%; padding: 4.5px; {{#if: {{{header-color|}}} |--header-color: {{{header-color}}};}} --header-text-color: {{#if: {{{header-text-color|}}} |{{{header-text-color}}} | #fff }};">{{{main|}}}</div>
 
}}
 
}}
 
</includeonly><noinclude>
 
</includeonly><noinclude>
This template and its subtemplates are used to simplify the backends of various other InfoBox templates and can also be used to easily create custom InfoBoxes if needed.
+
This template and its subtemplates can be combined and used as a [[wikipedia:Help:Metatemplating|metatemplate]] for other InfoBox templates. It can also be used to easily create custom InfoBoxes if needed.  
 +
 
 +
For detailed documentation on each of the sub-templates, follow their respective links under the [[#See also|See also]] section at the bottom of this page.
 +
 
 +
'''Example:'''
 +
<pre>{{InfoBox|header-color = #ececec|header-text-color = black
 +
| chronology = {{InfoBox/Chronology|Previous|[[The links of this chronology table are intentionally broken|Link]]|Next}}
 +
| main =
 +
{{InfoBox/MainHeader|Main Header}}
 +
{{InfoBox/Image|Detective Conan Anime Logo.png|caption=Japanese [[Detective Conan]] logo}}
 +
{{InfoBox/Section|Section 1|content =
 +
{{InfoBox/LabeledRow|Label|Some information |border-top = none}}
 +
{{InfoBox/CollapsibleRow|Expand this...|...to read more information}}
 +
{{InfoBox/Item|Some final information}}
 +
}} <!-- End of Section 1 -->
 +
}}</pre>
 +
'''Results in:'''
 +
{{BeginBox}} <!-- For aesthetic purposes, Template:BeginBox is being used to push the See also section down and is unrelated to Template:InfoBox. -->
 +
{{InfoBox|header-color = #ececec|header-text-color = black
 +
| chronology = {{InfoBox/Chronology|Previous|[[The links of this chronology table are intentionally broken|Link]]|Next}}
 +
| main =
 +
{{InfoBox/MainHeader|Main Header}}
 +
{{InfoBox/Image|Detective Conan Anime Logo.png|caption=Japanese [[Detective Conan]] logo}}
 +
{{InfoBox/Section|Section 1|content =
 +
{{InfoBox/LabeledRow|Label|Some information |border-top = none}}
 +
{{InfoBox/CollapsibleRow|Expand this...|...to read more information}}
 +
{{InfoBox/Item|Some final information}}
 +
}} <!-- End of Section 1 -->
 +
}}
 +
{{EndBox}} <!-- Template:EndBox pairs with Template:BeginBox above and is also unrelated to Template:InfoBox. -->
  
 
== See also ==
 
== See also ==
* [[Template:InfoBox/Chronology]]
+
{{InfoBox/See also links}}
* [[Template:InfoBox/MainHeader]]
 
* [[Template:InfoBox/Image]]
 
* [[Template:InfoBox/Section]]
 
* [[Template:InfoBox/LabeledRow]]
 
* [[Template:InfoBox/Item]]
 
  
 
[[Category:Templates]]
 
[[Category:Templates]]
 
[[Category:InfoBox templates]]
 
[[Category:InfoBox templates]]
 
</noinclude>
 
</noinclude>

Latest revision as of 04:20, 18 March 2026

This template and its subtemplates can be combined and used as a metatemplate for other InfoBox templates. It can also be used to easily create custom InfoBoxes if needed.

For detailed documentation on each of the sub-templates, follow their respective links under the See also section at the bottom of this page.

Example:

{{InfoBox|header-color = #ececec|header-text-color = black
| chronology = {{InfoBox/Chronology|Previous|[[The links of this chronology table are intentionally broken|Link]]|Next}}
| main =
{{InfoBox/MainHeader|Main Header}}
{{InfoBox/Image|Detective Conan Anime Logo.png|caption=Japanese [[Detective Conan]] logo}}
{{InfoBox/Section|Section 1|content =
{{InfoBox/LabeledRow|Label|Some information |border-top = none}}
{{InfoBox/CollapsibleRow|Expand this...|...to read more information}}
{{InfoBox/Item|Some final information}}
}} <!-- End of Section 1 -->
}}

Results in:

Chronology
Next
Main Header
Detective Conan Anime Logo.png
Japanese Detective Conan logo
Section 1
Label
Some information
Expand this...
...to read more information
Some final information

See also