Template:Infobox: Difference between revisions

From Love and Deepspace Wiki
Content added Content deleted
No edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
<noinclude>
<noinclude>
==Description==
==Description==
This is a template approach to building infoboxes. There are several sub-templates that are used.
This is a template approach to building custom infoboxes (e.g. [[Template:Character infobox]]). There are several sub-templates that are used.


* Required Templates to create infobox
* Required Templates to create infobox
Line 40: Line 40:
===line===
===line===
No arguments, simply renders an hr line element when used.
No arguments, simply renders an hr line element when used.

<pre>{{Infobox/line}}</pre>


===row-data===
===row-data===

Latest revision as of 19:44, 18 February 2024

Description[edit source]

This is a template approach to building custom infoboxes (e.g. Template:Character infobox). There are several sub-templates that are used.

  • Required Templates to create infobox
  • Infobox Parts

Excluding the row-data template, the naming of the templates follows the structure of the Wikipedia Infobox template, which a visual guide can be found here - w:Template:Infobox.

Usage[edit source]

Start/End[edit source]

To use these infobox templates, keep in mind that they must all include the start and end templates to work correctly. The other templates are put between these two.

{{Infobox/start}}
...content
{{Infobox/end}}

Title, Above, Header, Subheader, Below, Image[edit source]

All only take a single argument, which is the content to be displayed. For example, to get title:

{{Infobox/title|Title text here}}

Image follows a similar format, but you do need to provide it with the full file link (e.g. [[File:<filename>]].

line[edit source]

No arguments, simply renders an hr line element when used.

{{Infobox/line}}

row-data[edit source]

This is where this infobox differs. This template creates a row in the infobox, but also has the ability to split the row up to 4 sections if desired.

# of Sections Example Template
1 section only (Full row)
{{Infobox/row-data|content here}}
2 sections (e.g. For the standard label/data row)
{{Infobox/row-data
|sections=2
|left=
|right=
}}
3 sections (e.g. For next/label/previous rows)
{{Infobox/row-data
|sections=3
|left=
|mid=
|right=
}}
4 sections
{{Infobox/row-data
|sections=4
|left=
|midLeft=
|midRight=
|right=
}}

Full Example[edit source]

{{Infobox/start}}
{{Infobox/title|Sample Infobox}}
{{Infobox/above|Page name}}
{{Infobox/subheader|Subheader}}
{{Infobox/image|[[File:10 Days With You banner.png|link=]]}}
{{Infobox/line}}
{{Infobox/header|Sample Header}}
{{Infobox/row-data|some text here}}
{{Infobox/row-data
|sections=2
|left='''Label'''
|right=Data
}}
{{Infobox/line}}
{{Infobox/row-data
|sections=3
|left={{#fas:arrow-left}} Previous
|mid=Episodes
|right=Next {{#fas:arrow-right}}
}}
{{Infobox/below|The end...}}
{{Infobox/end}}
Sample Infobox
Page name
Subheader

Sample Header
some text here
Label
Data

Previous
Episodes
Next
The end...