Difference between revisions of "User:Dorsal Axe/Sandbox2"

From Nookipedia, the Animal Crossing wiki
(Misc changes and clean up code a bit)
Line 1: Line 1:
{| class="infobox roundlast" style="table-layout: fixed; border-radius: 15px; background: hsl({{{primarycolor|0 0}}}% {{{overrideprimary|70%}}}); margin-left: 10px; margin-bottom: 10px; width: 320px; padding: 5px; float:right"
+
{| class="infobox roundlast" style="background: hsl({{{primarycolor|0 0}}}% {{{overrideprimary|70%}}});"
 
|-
 
|-
 
| colspan=6 |
 
| colspan=6 |
Line 13: Line 13:
 
<!-- TITLE -->
 
<!-- TITLE -->
 
<!--      -->
 
<!--      -->
! {{#if:{{{titlecolor|}}}|style="background: {{{titlecolor|}}}; border: 2px solid {{{titlecolor|}}}; {{roundy|20px}} padding: 0 15px 0 15px;"}} align="center" | <big><big><font color="{{{textcolor|#000}}}">{{{title|Infobox}}}</font></big></big>
+
! style="{{#if:{{{titlecolor|}}}|background: {{{titlecolor|}}}; border: 2px solid {{{titlecolor|}}}; {{roundy|20px}} padding: 0 15px 0 15px;}} font-size: 1.5em; align="center" | <font color="{{{textcolor|#000}}}">{{{title|Infobox}}}</font>
  
 
<!--            -->
 
<!--            -->
Line 43: Line 43:
 
<!--      -->
 
<!--      -->
 
|-
 
|-
| colspan="6" style="background: #ffffff; text-align:center; {{roundy|9px}}; width:100%; padding:4px;" | {{#if:{{{image|}}}|{{{image}}}|[[File:Nia.png|200px]]}}{{#if:{{{caption|}}}|<br>{{{caption}}}}}<br>{{#if:{{{image2|}}}|{{{image}}}|}}{{#if:{{{caption2|}}}|<br>{{{caption}}}}}
+
| class="roundy" colspan="6" style="background: #ffffff; text-align:center; border-radius: 9px; width:100%; padding:4px;" | {{#if:{{{image|}}}|{{{image}}}|[[File:Nia.png|200px]]}}{{#if:{{{caption|}}}|<br>{{{caption}}}}}<br>{{#if:{{{image2|}}}|{{{image}}}|}}{{#if:{{{caption2|}}}|<br>{{{caption}}}}}
  
 
<!--                -->
 
<!--                -->
Line 50: Line 50:
 
|- {{#if: {{{subtitlebelow|}}}|
 
|- {{#if: {{{subtitlebelow|}}}|
 
{{!-}} align="center"
 
{{!-}} align="center"
{{!}} colspan="6" {{!}} {{#switch: {{{subtitlebelow|}}}| gallery = <div style="background: #BF84F1; {{roundy|10px}}; width:100%;">{{#ifexist: {{PAGENAME}}/Gallery|| [[File:Menu Camera NH Icon.png|25px|link={{PAGENAME}}/Gallery]] [[{{{1|{{PAGENAME}}}}}/Gallery|<span style="font-family: Coustard; color: white; text-shadow: 2px 2px 0 #9230e8;">Image Gallery</span>]]}}</div> | #default = <div style="background: #FFFFFF; {{roundy|10px}}; width:100%;">{{{subtitlebelow|}}}</div>}} }}
+
{{!}} class="roundy" colspan="6" {{!}} {{#switch: {{{subtitlebelow|}}}| gallery = <div style="background: #BF84F1; border-radius: 9px; width:100%;">{{#ifexist: {{PAGENAME}}/Gallery|| [[File:Menu Camera NH Icon.png|25px|link={{PAGENAME}}/Gallery]] [[{{{1|{{PAGENAME}}}}}/Gallery|<span style="font-family: Coustard; color: white; text-shadow: 2px 2px 0 #9230e8;">Image Gallery</span>]]}}</div> | #default = <div style="background: #FFFFFF; border-radius: 9px; width: 100%;">{{{subtitlebelow|}}}</div>}} }}
  
 
<!--            -->
 
<!--            -->
Line 57: Line 57:
 
|- {{#if:{{{leftdata|}}}|
 
|- {{#if:{{{leftdata|}}}|
 
{{!-}}
 
{{!-}}
! colspan="{{#if:{{{middledata|}}}|2|3}}" style="min-width:50px; background: hsl({{#if:{{{secondarycolor|}}}|{{{secondarycolor|}}}|{{{primarycolor|0 0}}}}}% {{{overridesecondary|85%}}}); {{roundytl|9px}} text-align: center;" {{!}} {{{leftlabel|}}}
+
! colspan="{{#if:{{{middledata|}}}|2|3}}" style="min-width:50px; background: hsl({{#if:{{{secondarycolor|}}}|{{{secondarycolor|}}}|{{{primarycolor|0 0}}}}}% {{{overridesecondary|85%}}}); {{roundytl|9px}}; text-align: center;" {{!}} {{{leftlabel|}}}
 
{{#if:{{{middledata|}}}|
 
{{#if:{{{middledata|}}}|
 
! colspan="2" style="min-width:50px; background: hsl({{#if:{{{secondarycolor|}}}|{{{secondarycolor|}}}|{{{primarycolor|0 0}}}}}% {{{overridesecondary|85%}}}); text-align: center;" {{!}} {{{middlelabel|}}} }}
 
! colspan="2" style="min-width:50px; background: hsl({{#if:{{{secondarycolor|}}}|{{{secondarycolor|}}}|{{{primarycolor|0 0}}}}}% {{{overridesecondary|85%}}}); text-align: center;" {{!}} {{{middlelabel|}}} }}
! colspan="{{#if:{{{middledata|}}}|2|3}}" style="min-width:50px; background: hsl({{#if:{{{secondarycolor|}}}|{{{secondarycolor|}}}|{{{primarycolor|0 0}}}}}% {{{overridesecondary|85%}}}); {{roundytr|9px}} text-align: center;" {{!}} {{{rightlabel|}}}
+
! colspan="{{#if:{{{middledata|}}}|2|3}}" style="min-width:50px; background: hsl({{#if:{{{secondarycolor|}}}|{{{secondarycolor|}}}|{{{primarycolor|0 0}}}}}% {{{overridesecondary|85%}}}); {{roundytr|9px}}; text-align: center;" {{!}} {{{rightlabel|}}}
 
{{!-}}
 
{{!-}}
 
{{!}} colspan="{{#if:{{{middledata|}}}|2|3}}" style="min-width:50px; background:#ffffff; text-align: center; {{roundybl|9px}}" {{!}} {{{leftdata|}}}
 
{{!}} colspan="{{#if:{{{middledata|}}}|2|3}}" style="min-width:50px; background:#ffffff; text-align: center; {{roundybl|9px}}" {{!}} {{{leftdata|}}}
Line 265: Line 265:
 
{{#incat:Animal Crossing {{{appearances}}}|{{Infobox Appearance|game={{PG|shortest}}|appears=yes}}|{{Infobox Appearance|game={{PG|shortest}}|appears=no}}}}
 
{{#incat:Animal Crossing {{{appearances}}}|{{Infobox Appearance|game={{PG|shortest}}|appears=yes}}|{{Infobox Appearance|game={{PG|shortest}}|appears=no}}}}
 
{{#incat:Doubutsu no Mori e+ {{{appearances}}}|{{Infobox Appearance|game={{DnMe+|shortest}}|appears=yes}}|{{Infobox Appearance|game=[[Dōbutsu no Mori e+|e+]]|appears=no}}}}
 
{{#incat:Doubutsu no Mori e+ {{{appearances}}}|{{Infobox Appearance|game={{DnMe+|shortest}}|appears=yes}}|{{Infobox Appearance|game=[[Dōbutsu no Mori e+|e+]]|appears=no}}}}
{{#incat:Animal Crossing: Wild World {{{appearances}}}|{{Infobox Appearance|game={{WW|shortest}}|appears=yes}}|{{Infobox Appearance|game={{WW|shortest}}|appears=no}}}}
+
{{#incat:Wild World {{{appearances}}}|{{Infobox Appearance|game={{WW|shortest}}|appears=yes}}|{{Infobox Appearance|game={{WW|shortest}}|appears=no}}}}
{{#incat:Animal Crossing: City Folk {{{appearances}}}|{{Infobox Appearance|game={{CF|shortest}}|appears=yes}}|{{Infobox Appearance|game={{CF|shortest}}|appears=no}}}}
+
{{#incat:City Folk {{{appearances}}}|{{Infobox Appearance|game={{CF|shortest}}|appears=yes}}|{{Infobox Appearance|game={{CF|shortest}}|appears=no}}}}
{{#incat:Animal Crossing: New Leaf {{{appearances}}}|{{Infobox Appearance|game={{NL|shortest}}|appears=yes}}|{{Infobox Appearance|game={{NL|shortest}}|appears=no}}}}
+
{{#incat:New Leaf {{{appearances}}}|{{Infobox Appearance|game={{NL|shortest}}|appears=yes}}|{{Infobox Appearance|game={{NL|shortest}}|appears=no}}}}
{{#incat:Animal Crossing: New Horizons {{{appearances}}}|{{Infobox Appearance|game={{NH|shortest}}|appears=yes}}|{{Infobox Appearance|game={{NH|shortest}}|appears=no}}}} }}
+
{{#incat:New Horizons {{{appearances}}}|{{Infobox Appearance|game={{NH|shortest}}|appears=yes}}|{{Infobox Appearance|game={{NH|shortest}}|appears=no}}}} }}
  
 
<!--                  -->
 
<!--                  -->
Line 278: Line 278:
 
{{!-}}
 
{{!-}}
 
{{!}} colspan="6" style="background:#ffffff; text-align: center; {{roundybottom|9px}}" {{!}} {{#incat:Doubutsu no Mori (film) {{{o-appearances}}}|{{Infobox Appearance|game={{AM|shortest}}|appears=yes}}|{{Infobox Appearance|game=[[Dōbutsu no Mori (film)|Film]]|appears=no}}}}
 
{{!}} colspan="6" style="background:#ffffff; text-align: center; {{roundybottom|9px}}" {{!}} {{#incat:Doubutsu no Mori (film) {{{o-appearances}}}|{{Infobox Appearance|game={{AM|shortest}}|appears=yes}}|{{Infobox Appearance|game=[[Dōbutsu no Mori (film)|Film]]|appears=no}}}}
{{#incat:Happy Home Designer {{{o-appearances}}}|{{Infobox Appearance|game={{HHD|shortest}}|appears=yes}}|{{Infobox Appearance|game={{HHD|shortest}}|appears=no}}}}
+
{{#incat:{{{hhdoverride|Happy Home Designer}}} {{{o-appearances}}}|{{Infobox Appearance|game={{HHD|shortest}}|appears=yes}}|{{Infobox Appearance|game={{HHD|shortest}}|appears=no}}}}
{{#incat:amiibo Festival {{{o-appearances}}}|{{Infobox Appearance|game={{AMF|short}}|appears=yes}}|{{Infobox Appearance|game={{AMF|shortest}}|appears=no}}}}
+
{{#incat:{{{afoverride|amiibo Festival}}} {{{o-appearances}}}|{{Infobox Appearance|game={{AMF|short}}|appears=yes}}|{{Infobox Appearance|game={{AMF|shortest}}|appears=no}}}}
 
{{#incat:Pocket Camp {{{o-appearances}}}|{{Infobox Appearance|game={{PC|shortest}}|appears=yes}}|{{Infobox Appearance|game={{PC|shortest}}|appears=no}}}} }}
 
{{#incat:Pocket Camp {{{o-appearances}}}|{{Infobox Appearance|game={{PC|shortest}}|appears=yes}}|{{Infobox Appearance|game={{PC|shortest}}|appears=no}}}} }}
  
<!--                 -->
+
<!--           -->
<!-- OTHER LANGUAGES -->
+
<!-- LANGUAGES -->
<!--                 -->
+
<!--           -->
 
|- {{#if:{{{languages|}}}|
 
|- {{#if:{{{languages|}}}|
 
{{!-}}
 
{{!-}}
{{!}} colspan="6" style="background: hsl({{#if:{{{secondarycolor|}}}|{{{secondarycolor|}}}|{{{primarycolor|0 0}}}}}% {{{overridesecondary|85%}}}); text-align: center; {{roundy|9px}}" {{!}} '''Name in other languages'''<br>
+
{{!}} colspan="6" style="background: hsl({{#if:{{{secondarycolor|}}}|{{{secondarycolor|}}}|{{{primarycolor|0 0}}}}}% {{{overridesecondary|85%}}}); text-align: center; {{roundy|9px}}" {{!}} '''{{{languages|Name}}} in other languages'''<br>
 +
{{Translation
 +
| color      = black
 +
| max-length = {{{max-length|30}}}
 +
| ja-name    = {{{ja-name|}}}{{#if:{{{ja-note|}}}|{{{ja-note}}}|}}
 +
| zh-name    = {{{zh-name|}}}{{#if:{{{zh-note|}}}|{{{zh-note}}}|}}
 +
| zht-name  = {{{zht-name|}}}{{#if:{{{zht-note|}}}|{{{zht-note}}}|}}
 +
| ko-name    = {{{ko-name|}}}{{#if:{{{ko-note|}}}|{{{ko-note}}}|}}
 +
| fr-name    = {{{fr-name|}}}{{#if:{{{fr-note|}}}|{{{fr-note}}}|}}
 +
| frq-name  = {{{frq-name|}}}{{#if:{{{frq-note|}}}|{{{frq-note}}}|}}
 +
| es-name    = {{{es-name|}}}{{#if:{{{es-note|}}}|{{{es-note}}}|}}
 +
| esl-name  = {{{esl-name|}}}{{#if:{{{esl-note|}}}|{{{esl-note}}}|}}
 +
| it-name    = {{{it-name|}}}{{#if:{{{it-note|}}}|{{{it-note}}}|}}
 +
| de-name    = {{{de-name|}}}{{#if:{{{de-note|}}}|{{{de-note}}}|}}
 +
| nl-name    = {{{nl-name|}}}{{#if:{{{nl-note|}}}|{{{nl-note}}}|}}
 +
| ru-name    = {{{ru-name|}}}{{#if:{{{ru-note|}}}|{{{ru-note}}}|}}
 +
}}
 +
}}
 +
 
 +
<!--            -->
 +
<!-- LANGUAGES 2 -->
 +
<!--            -->
 +
|- {{#if:{{{languages2|}}}|
 +
{{!-}}
 +
{{!}} colspan="6" style="background: hsl({{#if:{{{secondarycolor|}}}|{{{secondarycolor|}}}|{{{primarycolor|0 0}}}}}% {{{overridesecondary|85%}}}); text-align: center; {{roundy|9px}}" {{!}} '''{{{languages2|Phrase}}} in other languages'''<br>
 
{{Translation  
 
{{Translation  
 
| color      = black
 
| color      = black
 
| max-length = {{{max-length|30}}}
 
| max-length = {{{max-length|30}}}
| ja-name    = {{{ja-name|}}}
+
| ja-name    = {{{ja-name2|}}}{{#if:{{{ja-note2|}}}|{{{ja-note2}}}|}}
| ko-name    = {{{ko-name|}}}
+
| zh-name    = {{{zh-name2|}}}{{#if:{{{zh-note2|}}}|{{{zh-note2}}}|}}
| zh-name    = {{{zh-name|}}}
+
| zht-name  = {{{zht-name2|}}}{{#if:{{{zht-note2|}}}|{{{zht-note2}}}|}}
| zht-name  = {{{zht-name|}}}
+
| ko-name   = {{{ko-name2|}}}{{#if:{{{ko-note2|}}}|{{{ko-note2}}}|}}
| fr-name    = {{{fr-name|}}}
+
| fr-name    = {{{fr-name2|}}}{{#if:{{{fr-note2|}}}|{{{fr-note2}}}|}}
| frq-name  = {{{frq-name|}}}
+
| frq-name  = {{{frq-name2|}}}{{#if:{{{frq-note2|}}}|{{{frq-note2}}}|}}
| es-name    = {{{es-name|}}}
+
| es-name    = {{{es-name2|}}}{{#if:{{{es-note2|}}}|{{{es-note2}}}|}}
| esl-name  = {{{esl-name|}}}
+
| esl-name  = {{{esl-name2|}}}{{#if:{{{esl-note2|}}}|{{{esl-note2}}}|}}
| it-name    = {{{it-name|}}}
+
| it-name    = {{{it-name2|}}}{{#if:{{{it-note2|}}}|{{{it-note2}}}|}}
| de-name    = {{{de-name|}}}
+
| de-name    = {{{de-name2|}}}{{#if:{{{de-note2|}}}|{{{de-note2}}}|}}
| nl-name    = {{{nl-name|}}}
+
| nl-name    = {{{nl-name2|}}}{{#if:{{{nl-note2|}}}|{{{nl-note2}}}|}}
| ru-name    = {{{ru-name|}}}
+
| ru-name    = {{{ru-name2|}}}{{#if:{{{ru-note2|}}}|{{{ru-note2}}}|}}
 
}}
 
}}
 
}}
 
}}
 +
 
<!--              -->
 
<!--              -->
 
<!-- STRATEGYWIKI -->
 
<!-- STRATEGYWIKI -->
Line 312: Line 337:
 
{{!}} style="background: #ffffff; text-align:center; line-height:12px; {{roundy|9px}}" colspan="6" {{!}}
 
{{!}} style="background: #ffffff; text-align:center; line-height:12px; {{roundy|9px}}" colspan="6" {{!}}
 
[[StrategyWiki:{{{strategywiki|}}}|Guide at StrategyWiki]]}}
 
[[StrategyWiki:{{{strategywiki|}}}|Guide at StrategyWiki]]}}
|}
+
|}<noinclude>{{Clear}}
 
 
<noinclude>{{Clear}}
 
  
  

Revision as of 10:38, July 18, 2020

Infobox
Nia.png









Usage

{{Infobox
 | Title          = 
 | Lefticon       =
 | Righticon      =

 | PrimaryColor   =
 | SecondaryColor =

 | LeftLink       =
 | RightLink      =

 | SubtitleAbove  = 
 | SubtitleBelow  =

 | Image          =
 | Caption        =
 | Image2         =
 | Caption2       =

 | LeftLabel      =
 | LeftData       =
 | MiddleLabel    =
 | MiddleData     =
 | RightLabel     =
 | RightData      =

 | Calendar       =
 | CalColor       = 

 | WideLabel      =
 | WideData       =

 | Group          =
 | Label          = 
 | Data           = 

 | Appearances    =
 | O-Appearances  =
 | Languages      =

 | StrategyWiki   =
}}

This template is intended to be used for all infoboxes, as it allows them to be easily created and maintained and gives them a consistent visual style and functionality. It is very complex, and has been designed to adapt to the many different needs of various infoboxes across the wiki. This template is mobile-friendly and should appear the same on mobile devices.


Visual styles

The following parameters primarily set the visual style of the template:

  • title sets the displayed heading of the infobox.
  • lefticon is an optional parameter that allows an image or text to appear in the upper-left corner of the infobox.
  • righticon is an optional parameter that allows an image or text to appear in the upper-right corner of the infobox.
  • primarycolor sets the display colors of the infobox. Requires hue and saturation values in in HSL format, as other colors on the template are adjusted dynamically based on these values.
  • secondarycolor allows a complimentary color to be specified. Requires hue and saturation values in in HSL format, as other colors on the template are adjusted dynamically based on these values.
  • overrideprimary allows the lightness of the primary color to be overridden with a custom percentage value. Should only be used if chosen color lightness is not suitable.
  • overridesecondary allows the lightness of the secondary color to be overridden with a custom percentage value. Should only be used if chosen color lightness is not suitable.
  • calcolor sets the displayed colour of highlighted months on calendar, if it has been set to be shown (see below). Requires hue and saturation values in in HSL format, as other colors on the template are adjusted dynamically based on these values. Appending 2 defines the color of the second calendar (see below).
Content

The following parameters primarily set the content of the template:

  • image sets the image file to be displayed in the infobox.
  • caption sets a text caption to be displayed below the image.
  • image2 sets a second image file to be displayed in the infobox, below the first image.
  • caption2 sets a text caption to be displayed below the second image.
  • leftlink sets a link that appears on the upper-left side of the infobox with an arrow pointing left. Intended for navigation between related topics.
  • rightlink sets a link that appears on the upper-right side of the infobox with an arrow pointing right. Intended for navigation between related topics.
  • subtitleabove sets a subtitle that will appear below the heading, but above any images.
  • subtitlebelow sets a subtitle that will appear below images. Setting this to Gallery will automatically set this to a styled gallery page link.
Multi-column labels

The infobox can be set to show two or three adjacent columns of labels and data using the following parameters. It will appear with two columns if only left and right sides are specified, and three if the middle parameters are specified.

  • leftlabel
  • leftdata
  • middlelabel
  • middledata
  • rightlabel
  • rightdata
Calendars

A calendar can be set to appear in the infobox and will highlight any specified months. The calendar will appear above and visually join wide labels if they are set to be shown. Appending 2 to these parameters will allow creation of a second calendar below the first one, which is primarily intended for distinguishing months between northern and southern hemispheres.

  • calendar
Wide labels

The following parameters will set the label to appear above the data, in a single column that spans the width of the infobox:

  • widelabel
  • widedata
Labels

The following parameters will set the label to appear adjacent to the data, in two columns.

  • group will create a group label in a single column that spans the width of the infobox. This will also shade the labels in a slightly lighter colour, allowing the creation of "sub-labels".
  • labelspan can be set to wide to extend the width of the labels at the expense of the data column.
  • label
  • data
  • subdata allows an extra cell to be displayed to the right of the first level of data. At the present time, this is solely intended to display star signs in Template:Infobox Villager.
Appearances

The following parameters will display which media the subject has appeared in, by checking the categories the page is included in. For both parameters, the category name must be specified, omitting the title of the media (e.g. just "characters" rather than "New Horizons characters")

  • appearances will display appearances in main series games.
  • o-appearances will display appearances in spin-off games and media.
Languages
  • languages setting to yes toggles the appearance of the languages sub-box, intended for names for the subject in other languages. The following parameters must be used to specify any parameters for the supported languages. Appending 2 to these parameters will allow creation of a second languages box below the first one.
Miscellaneous
  • StrategyWiki allows a link to be set to a corresponding on StrategyWiki

The infobox template supports up to 5 wide rows and 12 two-column rows. When adding more than one row, you must append the sequential number to the names of the parameters like so. Failing to this will result in display errors.

 | widelabel2     =
 | widedata2      =

 | label2         = 
 | data2          =