Difference between revisions of "Template:Item List-Item"
From sureai
(Fix example) |
(Fix header handling) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 3: | Line 3: | ||
{{#if: {{{title|}}}| | {{#if: {{{title|}}}| | ||
<!-- Title --> | <!-- Title --> | ||
− | < | + | <div style = "height: 50px; border: 1px solid rgb(73, 73, 59); border-radius: 5px; margin: 0 0 5px 0; padding: 0 5px; display: flex; flex-flow: row nowrap; align-items: center; box-shadow: 0 0 2px #00000055; ">{{#if: {{{icon|}}}|<div style = "margin-right: .5em">[[File:{{{icon}}}|40x40px|link=|{{{title}}}]]</div>|}}{{#if: {{{noheader|}}}||<h3 style = "font-weight: bold; font-size: 1.25em; margin: 0; padding: 0; ">}}{{{title|}}}{{#if: {{{noheader|}}}||</h3>}}</div> |
<!-- End Title --> | <!-- End Title --> | ||
|}} | |}} | ||
Line 14: | Line 14: | ||
<!-- End Container --></includeonly><noinclude> | <!-- End Container --></includeonly><noinclude> | ||
This template is used to add an item to an Item List that was begun with [[:Template:Item List-Start]]. | This template is used to add an item to an Item List that was begun with [[:Template:Item List-Start]]. | ||
+ | |||
+ | It is recommended to insert Item List templates one after the other, without any line breaks, to avoid empty paragraphs from being inserted by MediaWiki between items. See the examples for more info. | ||
== Parameters == | == Parameters == | ||
* '''title:''' Adds a title to the top of this item. Title is hidden if this parameter is empty. | * '''title:''' Adds a title to the top of this item. Title is hidden if this parameter is empty. | ||
+ | * '''icon:''' The name of the image acting as an icon for this item's title, without the initial <code>File:</code>. Icon is hidden if this parameter is empty. | ||
* '''1:''' This item's content. | * '''1:''' This item's content. | ||
− | * ''noheader:'' If nonempty, | + | * ''noheader:'' If nonempty, hides this item from the Table of Contents. |
== Examples == | == Examples == | ||
− | <pre>{{Item List-Start|title=Fancy!|noheader=1}} | + | <pre>{{Item List-Start|title=Fancy!|noheader=1 |
− | {{Item List-Item|title=An item|noheader=1| | + | }}{{Item List-Item|icon=EN-Marker-Cave.svg|title=An item|noheader=1| |
Well, would you look at that! I'm inside the item list! | Well, would you look at that! I'm inside the item list! | ||
− | }} | + | }}{{Item List-Item|icon=EN-Items-icon.png|title=Climb it|noheader=1| |
− | {{Item List-Item|title=Climb it|noheader=1| | + | |
You see that mountain over there? ''You can climb it!'' | You see that mountain over there? ''You can climb it!'' | ||
− | }} | + | }}{{Item List-Item|title=Things|noheader=1| |
− | {{Item List-Item|title=Things|noheader=1| | + | |
* Formatting | * Formatting | ||
** '''Works''' | ** '''Works''' | ||
Line 35: | Line 36: | ||
==== The Item ==== | ==== The Item ==== | ||
Don't worry. | Don't worry. | ||
− | }} | + | }}{{Item List-End}} |
− | {{Item List-End}} | + | |
</pre> | </pre> | ||
− | {{Item List-Start|title=Fancy!|noheader=1}} | + | {{Item List-Start|title=Fancy!|noheader=1 |
− | {{Item List-Item|title=An item|noheader=1| | + | }}{{Item List-Item|icon=EN-Marker-Cave.svg|title=An item|noheader=1| |
Well, would you look at that! I'm inside the item list! | Well, would you look at that! I'm inside the item list! | ||
− | }} | + | }}{{Item List-Item|icon=EN-Items-icon.png|title=Climb it|noheader=1| |
− | {{Item List-Item|title=Climb it|noheader=1| | + | |
You see that mountain over there? ''You can climb it!'' | You see that mountain over there? ''You can climb it!'' | ||
− | }} | + | }}{{Item List-Item|title=Things|noheader=1| |
− | {{Item List-Item|title=Things|noheader=1| | + | |
* Formatting | * Formatting | ||
** '''Works''' | ** '''Works''' | ||
Line 53: | Line 51: | ||
==== The Item ==== | ==== The Item ==== | ||
Don't worry. | Don't worry. | ||
− | }} | + | }}{{Item List-End}} |
− | {{Item List-End}} | + | |
− | <pre>{{Item List-Start}} | + | <pre>{{Item List-Start |
− | {{Item List-Item|title=Hello|noheader=1| | + | }}{{Item List-Item|title=Hello|noheader=1| |
Your container doesn't need to have a title! | Your container doesn't need to have a title! | ||
− | }} | + | }}{{Item List-Item| |
− | {{Item List-Item| | + | |
And neither do your items! | And neither do your items! | ||
'''IT JUST WORKS!''' | '''IT JUST WORKS!''' | ||
− | }} | + | }}{{Item List-End}} |
− | {{Item List-End}} | + | |
</pre> | </pre> | ||
− | {{Item List-Start}} | + | {{Item List-Start |
− | {{Item List-Item|title=Hello|noheader=1| | + | }}{{Item List-Item|title=Hello|noheader=1| |
Your container doesn't need to have a title! | Your container doesn't need to have a title! | ||
− | }} | + | }}{{Item List-Item| |
− | {{Item List-Item| | + | |
And neither do your items! | And neither do your items! | ||
'''IT JUST WORKS!''' | '''IT JUST WORKS!''' | ||
− | }} | + | }}{{Item List-End}} |
− | {{Item List-End}} | + | |
[[Category:Templates]] | [[Category:Templates]] | ||
</noinclude> | </noinclude> |
Latest revision as of 19:26, 13 July 2017
This template is used to add an item to an Item List that was begun with Template:Item List-Start.
It is recommended to insert Item List templates one after the other, without any line breaks, to avoid empty paragraphs from being inserted by MediaWiki between items. See the examples for more info.
Parameters
- title: Adds a title to the top of this item. Title is hidden if this parameter is empty.
- icon: The name of the image acting as an icon for this item's title, without the initial
File:
. Icon is hidden if this parameter is empty. - 1: This item's content.
- noheader: If nonempty, hides this item from the Table of Contents.
Examples
{{Item List-Start|title=Fancy!|noheader=1 }}{{Item List-Item|icon=EN-Marker-Cave.svg|title=An item|noheader=1| Well, would you look at that! I'm inside the item list! }}{{Item List-Item|icon=EN-Items-icon.png|title=Climb it|noheader=1| You see that mountain over there? ''You can climb it!'' }}{{Item List-Item|title=Things|noheader=1| * Formatting ** '''Works''' *# Just Fine *# Inside ==== The Item ==== Don't worry. }}{{Item List-End}}
Fancy!
An item
Well, would you look at that! I'm inside the item list!
Climb it
You see that mountain over there? You can climb it!
Things
- Formatting
- Works
- Just Fine
- Inside
The Item
Don't worry.
{{Item List-Start }}{{Item List-Item|title=Hello|noheader=1| Your container doesn't need to have a title! }}{{Item List-Item| And neither do your items! '''IT JUST WORKS!''' }}{{Item List-End}}
Hello
Your container doesn't need to have a title!
And neither do your items!
IT JUST WORKS!