Difference between revisions of "Template:Infobox"
From Salem Wiki
m (preparation for auto-info) |
m (started to code auto-info) |
||
Line 1: | Line 1: | ||
− | < | + | <onlyinclude><!-- Lets see what type we're going to generate |
− | -->{{#switch: {{{type|}}} | + | -->{{#switch: {{{type|auto}}} |
| 1 = <!-- | | 1 = <!-- | ||
-->{{#if: {{{nocat|}}} | | -->{{#if: {{{nocat|}}} | | ||
Line 41: | Line 41: | ||
|inlineThemeBkgColor5={{{inlineThemeBkgColor5|#aaaaaa}}} | |inlineThemeBkgColor5={{{inlineThemeBkgColor5|#aaaaaa}}} | ||
}} | }} | ||
− | | #default = | + | | #default=<!-- |
− | }}</ | + | ********************************************************** |
+ | From here on is the new-code for the auto-info Infobox... | ||
+ | ********************************************************** | ||
+ | -->{{#set:isGameMenu=n}}<!-- | ||
+ | --><table border="0" cellspacing="1px" cellpadding="5px" frame="box" class="Infobox" {{ | ||
+ | #ifeq: {{{inlineTheme|yes}}} | yes | ||
+ | | style="min-width:250px; font-size:89%; color:{{ | ||
+ | #if: {{{inlineThemeColor1|}}} | ||
+ | | {{{inlineThemeColor1}}} | ||
+ | | black | ||
+ | }}; background-color:{{ | ||
+ | #if: {{{inlineThemeBkgColor1|}}} | ||
+ | | {{{inlineThemeBkgColor1}}} | ||
+ | | gray | ||
+ | }}; border:5px solid {{ | ||
+ | #if: {{{inlineThemeBorderColor|}}} | ||
+ | | {{{inlineThemeBorderColor}}} | ||
+ | | #3366CC | ||
+ | }}; border-radius:20px;" | ||
+ | }}><!-- | ||
+ | --><tr {{#ifeq: {{{inlineTheme|yes}}} | yes | ||
+ | | style="background-color:{{ | ||
+ | #if: {{{inlineThemeBkgColor2|}}} | ||
+ | | {{{inlineThemeBkgColor2}}} | ||
+ | | {{#if: {{{inlineThemeBorderColor|}}} | ||
+ | | {{{inlineThemeBorderColor}}} | ||
+ | | #3366CC | ||
+ | }} | ||
+ | }};" | ||
+ | }}><!-- | ||
+ | --><th colspan="2" {{ | ||
+ | #ifeq: {{{inlineTheme|yes}}} | yes | ||
+ | | style="font-size:150%; padding:0.5em;" | ||
+ | }}><!-- | ||
+ | --><div {{#ifeq: {{{inlineTheme|yes}}} | yes | ||
+ | | style="color:{{ | ||
+ | #if: {{{inlineThemeColor2|}}} | ||
+ | | {{{inlineThemeColor2}}} | ||
+ | | white | ||
+ | }};" | ||
+ | }}><!-- | ||
+ | -->{{#if: {{{name|}}} | {{{name}}} | {{{page}}} }}<!-- | ||
+ | --></div><!-- | ||
+ | --></th><!-- | ||
+ | --></tr><!-- | ||
+ | --><tr {{#ifeq: {{{inlineTheme|yes}}} | yes | ||
+ | | style="background-color:{{ | ||
+ | #if: {{{inlineThemeBkgColor3|}}} | ||
+ | | {{{inlineThemeBkgColor3}}} | ||
+ | | #527acc | ||
+ | }}; text-align:center;" | ||
+ | }}><!-- | ||
+ | --><td colspan="2" {{#ifeq: {{{inlineTheme|yes}}} | yes | ||
+ | | style="" | ||
+ | }}><!-- | ||
+ | -->[[Image:{{ | ||
+ | #if: {{{icon|}}} | ||
+ | | {{{icon}}} | ||
+ | | {{ #ifexist: Image:{{{page}}} icon.png | ||
+ | | {{{page}}} icon.png | ||
+ | | Unknown Item icon.png{{!}}link=:Image:{{{page}}} icon.png{{!}}No image found, click to upload | ||
+ | }} | ||
+ | }}]]<br/><!-- | ||
+ | -->''{{#if: {{{caption|}}} | {{{caption}}} | {{{page}}} }}''<br/><!-- | ||
+ | -->[[Image:{{#if: {{{image|}}} | {{{image}}} | {{{page}}}.png }}|200px]]<!-- | ||
+ | --></td><!-- | ||
+ | --></tr><!-- | ||
+ | --></table><!-- | ||
+ | ********************************************************** | ||
+ | this is for the old-code of Infobox... | ||
+ | ********************************************************** | ||
+ | -->}}<!-- | ||
+ | --></onlyinclude><noinclude>{{-}}{{documentation}}</noinclude> |
Revision as of 18:13, 28 June 2012
{{{page}}} | |
---|---|
{{{page}}} [[Image:{{{page}}}.png|200px]] |
Template documentation (for the template shown above, sometimes hidden or invisible)
Description
- This template is used to create an information-box to automatically display different kinds of info, depending on properties set on the page it is displaying this info for.
- It relies on properties set using {{SetProp}}.
- It uses Infobox/Stylesheet.css as CSS-Stylesheet, which is site-wide included.
Syntax
- Type the below code at the top of the page, with values assigned to relevant parameters.
- See {{SetProp}} for easy copy&paste code to use on pages.
{{SetProp |... }}{{Infobox}} ==About==
name | description |
---|---|
nocat | optional, auto-categorization will be inhibited when used with any non-empty value. |
page | optional, pagename of item to display info for. Defaults to {{PAGENAME}} or {{FULLPAGENAME}} when appropriate.
|
catsort | optional, sortkey of page inside category listings. Defaults to {{PAGENAME}} or something different when appropriate depending on special cases. |
Examples
- See the Help:Infobox or test-data pages.
Helper-templates
- {{SetProp}}
- {{HasProp}}
- {{PropVals}}
- {{PropVals/getIcon}} to display icon at top.
- {{PropVals/Print Entry}} to display icons with name links.
- {{List Locations}} to display Locations info.
- {{Infobox/List Skillvals}} to display Skill values.
- {{Infobox/List RequiredBys}} to display RequiredBy's.
Visit Template:Infobox/doc to edit this text! (How does this work?)