Difference between revisions of "User:Djonni/Template sandbox"

From GodWiki
Jump to: navigation, search
m (Simple test of short term pantheon parameters.)
m (Improved logic for pantheon subheaders, and added pantheonsubheaders=yes/no to override logic.)
Line 59: Line 59:
 
   | title = {{#if: {{yesno-no|{{{emoji|yes}}}|yes=}}||<span style="display: inline-block; width: 2em;">πŸ†</span>}}Pantheons{{#if: {{yesno-no|{{{emoji|yes}}}|yes=}}||<span style="display: inline-block; width: 2em;">&nbsp;</span>}}
 
   | title = {{#if: {{yesno-no|{{{emoji|yes}}}|yes=}}||<span style="display: inline-block; width: 2em;">πŸ†</span>}}Pantheons{{#if: {{yesno-no|{{{emoji|yes}}}|yes=}}||<span style="display: inline-block; width: 2em;">&nbsp;</span>}}
 
   | rowstyle1 = font-size: 85%;
 
   | rowstyle1 = font-size: 85%;
βˆ’
   | header1 = {{#if:{{{gratitude|}}}{{{might|}}}{{{templehood|}}}{{{gladiatorship|}}}{{{storytelling|}}}|Long Term}}
+
   | header1 = {{#switch:{{yesno|{{{pantheonsubheaders|}}}}}
 +
    | yes = {{#if:{{{gratitude|}}}{{{might|}}}{{{templehood|}}}{{{gladiatorship|}}}{{{storytelling|}}}|Long Term}}
 +
    | no =
 +
    | {{#if:{{{gratitude|}}}{{{might|}}}{{{templehood|}}}{{{gladiatorship|}}}{{{storytelling|}}}|{{#if: {{{mastery|}}}{{{construction|}}}{{{taming|}}}{{{survival|}}}{{{savings|}}}{{{creation|}}}{{{destruction|}}}{{{arkeology|}}}{{{catch|}}}{{{duelers|}}}|Long Term}}}}
 +
  }}
 
   | label2 = [[Pantheon of Gratitude|Gratitude]]:
 
   | label2 = [[Pantheon of Gratitude|Gratitude]]:
 
   | data2 = {{#if: {{{gratitude|}}}|{{#iferror:{{#expr:{{{gratitude}}}}}|{{{gratitude}}}|{{Pantheon link|gratitude|{{{gratitude}}}|text=none|plain=yes}}}}}}
 
   | data2 = {{#if: {{{gratitude|}}}|{{#iferror:{{#expr:{{{gratitude}}}}}|{{{gratitude}}}|{{Pantheon link|gratitude|{{{gratitude}}}|text=none|plain=yes}}}}}}
Line 71: Line 75:
 
   | data6 = {{#if: {{{storytelling|}}}|{{#iferror:{{#expr:{{{storytelling}}}}}|{{{storytelling}}}|{{Pantheon link|storytelling|{{{storytelling}}}|text=none|plain=yes}}}}}}
 
   | data6 = {{#if: {{{storytelling|}}}|{{#iferror:{{#expr:{{{storytelling}}}}}|{{{storytelling}}}|{{Pantheon link|storytelling|{{{storytelling}}}|text=none|plain=yes}}}}}}
 
   | rowstyle10 = font-size: 85%;
 
   | rowstyle10 = font-size: 85%;
βˆ’
   | header10 = {{#if: {{{mastery|}}}{{{construction|}}}{{{taming|}}}{{{survival|}}}{{{savings|}}}{{{creation|}}}{{{destruction|}}}{{{arkeology|}}}{{{catch|}}}{{{duelers|}}}|Short Term}}
+
   | header10 = {{#switch:{{yesno|{{{pantheonsubheaders|}}}}}
 +
    | yes = {{#if: {{{mastery|}}}{{{construction|}}}{{{taming|}}}{{{survival|}}}{{{savings|}}}{{{creation|}}}{{{destruction|}}}{{{arkeology|}}}{{{catch|}}}{{{duelers|}}}|Short Term}}
 +
    | no =
 +
    | {{#if: {{{mastery|}}}{{{construction|}}}{{{taming|}}}{{{survival|}}}{{{savings|}}}{{{creation|}}}{{{destruction|}}}{{{arkeology|}}}{{{catch|}}}{{{duelers|}}}|{{#if:{{{gratitude|}}}{{{might|}}}{{{templehood|}}}{{{gladiatorship|}}}{{{storytelling|}}}|Short Term}}}}
 +
  }}
 
   | label11 = [[Pantheon of Mastery|Mastery]]:
 
   | label11 = [[Pantheon of Mastery|Mastery]]:
 
   | data11 = {{#if: {{{mastery|}}}|{{#iferror:{{#expr:{{{mastery}}}}}|{{{mastery}}}|{{Pantheon link|mastery|{{{mastery}}}|text=none|plain=yes}}}}}}
 
   | data11 = {{#if: {{{mastery|}}}|{{#iferror:{{#expr:{{{mastery}}}}}|{{{mastery}}}|{{Pantheon link|mastery|{{{mastery}}}|text=none|plain=yes}}}}}}
Line 141: Line 149:
 
Example, for editing and testing.
 
Example, for editing and testing.
  
βˆ’
{{User:Djonni/Template sandbox|
+
{{User:Djonni/Template sandbox
 +
|nocat = yes
 
|highlighthex = #FFDD88
 
|highlighthex = #FFDD88
 
|title = God
 
|title = God
Line 161: Line 170:
 
|domain = God of perfectly shaped spoons
 
|domain = God of perfectly shaped spoons
 
|motto = In Ζ’or a penny! [http://godvillegame.com/forums/show_topic/2481 βœ”]
 
|motto = In Ζ’or a penny! [http://godvillegame.com/forums/show_topic/2481 βœ”]
 +
 +
|pantheonsubheaders = blah
 
|gratitude = e
 
|gratitude = e
 
|might = pi
 
|might = pi
Line 166: Line 177:
 
|gladiatorship = 1/3
 
|gladiatorship = 1/3
 
|storytelling = test
 
|storytelling = test
βˆ’
|nocat = yes
+
 
 +
|mastery = 11
 +
|construction = 12
 +
|taming = 13
 +
|survival = 14
 +
|savings = 15
 +
|creation = 16
 +
|destruction = 17
 +
|arkeology = 18
 +
|catch = 19
 +
|duelers = 20
 +
 
 
|below = This is a below.
 
|below = This is a below.
 
<!--|guildhighlighthex = #FFAA77-->
 
<!--|guildhighlighthex = #FFAA77-->
Line 188: Line 210:
 
|customlabel2 = Custom label 2
 
|customlabel2 = Custom label 2
 
|customdata2 = Custom data 2
 
|customdata2 = Custom data 2
βˆ’
 
βˆ’
|mastery = 11
 
βˆ’
|construction = 12
 
βˆ’
|taming = 13
 
βˆ’
|survival = 14
 
βˆ’
|savings = 15
 
βˆ’
|creation = 16
 
βˆ’
|destruction = 17
 
βˆ’
|arkeology = 18
 
βˆ’
|catch = 19
 
βˆ’
|duelers = 20
 
 
}}
 
}}
βˆ’
<pre>{{User:Djonni/Template sandbox|
+
<pre>{{User:Djonni/Template sandbox
βˆ’
<!--|highlighthex = #FFDD88-->
+
|nocat = yes
 +
|highlighthex = #FFDD88
 
|title = God
 
|title = God
 
<!--|name = Djonni-->
 
<!--|name = Djonni-->
 
|postnomial = the Great
 
|postnomial = the Great
 
|subheader=This is a subheader.
 
|subheader=This is a subheader.
 +
|caption = This is a caption.
 
|temple = 23rd of January, 2015
 
|temple = 23rd of January, 2015
 
|animalist = 2nd of December, 2018
 
|animalist = 2nd of December, 2018
Line 219: Line 232:
 
|domain = God of perfectly shaped spoons
 
|domain = God of perfectly shaped spoons
 
|motto = In Ζ’or a penny! [http://godvillegame.com/forums/show_topic/2481 βœ”]
 
|motto = In Ζ’or a penny! [http://godvillegame.com/forums/show_topic/2481 βœ”]
 +
 +
|pantheonsubheaders = blah
 
|gratitude = e
 
|gratitude = e
 
|might = pi
 
|might = pi
Line 224: Line 239:
 
|gladiatorship = 1/3
 
|gladiatorship = 1/3
 
|storytelling = test
 
|storytelling = test
βˆ’
|nocat = yes
+
 
 +
|mastery = 11
 +
|construction = 12
 +
|taming = 13
 +
|survival = 14
 +
|savings = 15
 +
|creation = 16
 +
|destruction = 17
 +
|arkeology = 18
 +
|catch = 19
 +
|duelers = 20
 +
 
 
|below = This is a below.
 
|below = This is a below.
 
<!--|guildhighlighthex = #FFAA77-->
 
<!--|guildhighlighthex = #FFAA77-->
Line 246: Line 272:
 
|customlabel2 = Custom label 2
 
|customlabel2 = Custom label 2
 
|customdata2 = Custom data 2
 
|customdata2 = Custom data 2
βˆ’
 
βˆ’
|mastery = 11
 
βˆ’
|construction = 12
 
βˆ’
|taming = 13
 
βˆ’
|survival = 14
 
βˆ’
|savings = 15
 
βˆ’
|creation = 16
 
βˆ’
|destruction = 17
 
βˆ’
|arkeology = 18
 
βˆ’
|catch = 19
 
βˆ’
|duelers = 20
 
 
}}</pre>
 
}}</pre>
 
{{clear}}
 
{{clear}}
Line 332: Line 347:
 
;catch
 
;catch
 
;duelers
 
;duelers
βˆ’
:''Unstable'' If these parameters are given a numeric value (for example, {{para|might|1234}}), they will display a link to the pantheon position by calling {{tlc|Pantheon link|text{{=}}none|plain{{=}}yes|<var>pantheon</var>|<var>number</var>}}, like so: {{Pantheon link|text=none|plain=yes|might|1234}}. If provided with any non-numeric value, the value of the parameter will be displayed exactly as given. So, if {{para|might|text or templates}}, the cell will display <code>text or templates</code>.
+
: If these parameters are given a numeric value (for example, {{para|might|1234}}), they will display a link to the pantheon position by calling {{tlc|Pantheon link|text{{=}}none|plain{{=}}yes|<var>pantheon</var>|<var>number</var>}}, like so: {{Pantheon link|text=none|plain=yes|might|1234}}. If provided with any non-numeric value, the value of the parameter will be displayed exactly as given. So, if {{para|might|text or templates}}, the cell will display <code>text or templates</code>.
 +
 
 +
;pantheonsubheaders = <code>yes/no</code>
 +
:''Optional'' This parameter can be used to switch the '''Long Term''' and '''Short Term''' subheaders on or off. If {{para|pantheonsubheaders|yes}} (or any yes-like value), a subheader will be displayed if any parameters of that type are given. {{para|pantheonsubheaders|no}} (or any no-like value) will turn the subheaders off. The default behaviouris that the subheaders will appear iff at least one from both pantheon groups is shown.
  
 
===Custom section===
 
===Custom section===

Revision as of 16:12, 2 November 2019

Deities of Godville
Djonni/Template sandbox 
πŸ“š Documentation

Example, for editing and testing.

Deities of Godville
God Djonni/Template sandbox εΊ™θˆŸη•œ the Great
This is a subheader.
Moloch_the_god.gif
This is a caption.
Champion Djonniboy
Personality Adjective
Gender Divine
Domain God of perfectly shaped spoons
Motto In Ζ’or a penny! βœ”
⚜️Guild 
The Forsakens Lament
Guild position Avatar of Lust; Daily Bugler
Guild rank Patriarch
πŸ†Pantheons 
Long Term
Gratitude eth
Might pith
Templehood 1.5st
Gladiatorship 1/3th
Storytelling test
Short Term
Mastery 11th
Construction 12th
Taming 13th
Survival 14th
Savings 15th
Creation 16th
Destruction 17th
Arkeology 18th
Catch 19th
βš”οΈCustom section 
Example-simple.png
Custom caption.
Custom header 1.
Custom label 2 Custom data 2

This is a below.

{{User:Djonni/Template sandbox
|nocat = yes
|highlighthex = #FFDD88
|title = God
<!--|name = Djonni-->
|postnomial = the Great
|subheader=This is a subheader.
|caption = This is a caption.
|temple = 23rd of January, 2015
|animalist = 2nd of December, 2018
|ark = 2nd of March, 2019
|avatar = Moloch_the_god.gif
|hero = Djonniboy
|herolabel = Champion
|gender = Divine
|guild = The Forsakens Lament
|position = Avatar of Lust; Daily Bugler
|rank = Patriarch
|personality = Adjective 
|domain = God of perfectly shaped spoons
|motto = In Ζ’or a penny! [http://godvillegame.com/forums/show_topic/2481 βœ”]

|pantheonsubheaders = blah
|gratitude = e
|might = pi
|templehood = 1.5
|gladiatorship = 1/3
|storytelling = test

|mastery = 11
|construction = 12
|taming = 13
|survival = 14
|savings = 15
|creation = 16
|destruction = 17
|arkeology = 18
|catch = 19
|duelers = 20

|below = This is a below.
<!--|guildhighlighthex = #FFAA77-->
|guildheadercolor = lightcoral
|guilddatacolor = lightblue
|guildbordercolor = slateblue
<!--|pantheonhighlighthex = #77AAFF-->
|pantheonheadercolor = pink
|pantheondatacolor = orange
|pantheonbordercolor = purple

|customhighlighthex =#66FFBB

|customsection = Custom section
|customemoji = βš”οΈ
|customimage = Example-simple.png
|customcaption = Custom caption.
|customheader1 = Custom header 1.
|customlabel1 = Custom label 1
|customdata1 = Custom data 1
|customlabel2 = Custom label 2
|customdata2 = Custom data 2
}}

Brief documentation of parameters.

This template is NOT stable. You're welcome to use and test it, but be aware, I may make changes without warning. If I do see anyone using it, I'll drop you a message on your talk page if something changes.

This is a list of pages (therefore users) that link to this page:

I have (hopefully) incorporated all variables used in {{Usergod}}, so that this can be a drop-in replacement. (Tick.png Done: examine the Usergod code to ensure I haven't missed any undocumented variables)

Basic parameters

title
A title to place before the God's name. In my user page, |title=God
name
The name of the God. This is only required if the current {{PAGENAME}} is not what you want displayed for the God's name. If set, literal contents will be displayed instead of using {{God|{{PAGENAME}}}}, so can be used to disable the link to user's Godville page if desired.
All parameters of the {{medal}} template
These will correctly render as medals in {{God}}, and will also appear after {{{name}}}. Considering also creating an Achievements section below Pantheons which would show these somehow. (TODO: This isn't really all parameters yet.)
postnomial
A title for after the God's name. In my user page, |postnomial=the Great
subheader
caption
below
As per {{infobox}}
avatar
As {{Usergod}}, except that for now this uses a placeholder image. I've since taken a took, and there are users of Usergod who haven't put avatar images in, so this will be changed.
hero
heroine
personality
gender
motto
town
guild
All as per existing {{Usergod}}
herolabel
If supplied, the contents of this parameter will replace Hero: or Heroine: in the label column. So, for example, |herolabel=Champion would result in Champion:   Djonniboy
domain
The God's "domain", their area of influence in the world.

Guild section

position
A position in a guild's organisation.
rank
Guild rank.

Pantheon section

gratitude
might
templehood
gladiatorship
storytelling
mastery
construction
taming
survival
savings
creation
destruction
arkeology
catch
duelers
If these parameters are given a numeric value (for example, |might=1234), they will display a link to the pantheon position by calling {{Pantheon link|text=none|plain=yes|pantheon|number}}, like so: 1234th. If provided with any non-numeric value, the value of the parameter will be displayed exactly as given. So, if |might=text or templates, the cell will display text or templates.
pantheonsubheaders = yes/no
Optional This parameter can be used to switch the Long Term and Short Term subheaders on or off. If |pantheonsubheaders=yes (or any yes-like value), a subheader will be displayed if any parameters of that type are given. |pantheonsubheaders=no (or any no-like value) will turn the subheaders off. The default behaviouris that the subheaders will appear iff at least one from both pantheon groups is shown.

Custom section

customsection
Text for the custom section header.
customemoji
An emoji to appear to the left of the header, if desired (e.g., |customemoji=βš”οΈ. This will be keep the header text correctly balanced in the center.
customimage
customcaption
An image and caption to appear immediately below the custom header.
customheader(1-9)
customlabel(1-9)
customdata(1-9)
Labels and data to appear in rows below the customheader. These can be set in any combination. If a label is set but no data is supplied for that row, it will not appear; if a data row is given without a label, it will take up the entire row; if a header is supplied for a row, it will appear instead of any label or data values supplied for that row.

Colour and style

highlighthex
Unstable This is a tricky/clever one which I know, with respect, that FeRDNYC will hate (made this saner). Don't worry, I intend to implement a fuller set of colour and styling parameters (Tick.png Done)! But honestly, take a look at the code. Clever, right? Single variable, and BAM, coherent colour scheme.
This parameter takes a six-character hex code for the highlight colour (headers, row labels), with a # in front, in #RRGGBB format. For example, |highlighthex=#FFBB88.
bodycolor
Unstable Sets a color for the background of the whole infobox. This color will be seen in any area where another color is not explicitly set. By default, the background is transparent; or, if |highlighthex= is set to any value, the background will default to a neutral white (#f8f9fa, same colour as a wiki page background).
headercolor
datacolor
Unstable These parameters can be used instead of |highlighthex=#RRGGBB to specify a color for the headers and labels (with |headercolor=) and the data cells (with |datacolor=). These parameters will cause |highlighthex= to be ignored in the relevant places.
Any valid HTML color value can be set here. Hex values including the leading # (#RRGGBB), color names (purple, slateblue), etc.
imagecolor
Unstable This parameter can be used instead of |highlighthex=#RRGGBB to specify a color for the background of the image and caption areas. If this parameter is not set, the |datacolor= and |highlighthex= parameters will be used in that order.
Any valid HTML color value can be set here. Hex values including the leading # (#RRGGBB), color names (purple, slateblue), etc.
bordercolor
Sets a color for the borders below each row of the infobox table. The default colour value used is #F4F6F6 or, if |highlighthex= is set, the border colour will be halfway between the label and data background colors (due to overlaid transparencies).
bodystyle
subheaderstyle
imagestyle
captionstyle
abovestyle
belowstyle
navstyle
headerstyle
labelstyle
datastyle
Know CSS? Want to place your own custom CSS into any of these fields? Go ahead! The contents of these parameters will be passed directly to {{Infobox}} after the default styles, meaning that the values you supply here will overwrite and replace what comes before them. This will allow you to create your own interesting, spectacular, creative and horrible styles for your Usergod infobox. With great power comes greatly uglified infoboxes.
Below is the way the style parameters here are placed, for clarity:
| bodystyle = background-color: {{#if:{{{highlighthex|}}}|#f8f9fa|transparent}}; {{{bodystyle|}}}
| subheaderstyle = background-color: {{{datacolor|{{#if:{{{highlighthex|}}}|{{{highlighthex}}}33|transparent}}}}}; border-bottom: 2px solid {{{bordercolor|{{#if:{{{highlighthex|}}}|{{{highlighthex}}}33|#F4F6F6}}}}}; {{{subheaderstyle|}}}
| imagestyle = padding: 0; background-color: {{{imagecolor|{{{datacolor|{{#if:{{{highlighthex|}}}|{{{highlighthex}}}33|transparent}}}}}}}}; border-bottom: 2px solid {{{bordercolor|{{#if:{{{highlighthex|}}}|{{{highlighthex}}}33|#F4F6F6}}}}}; {{{imagestyle|}}}
| abovestyle = background-color: {{{headercolor|{{{highlighthex|transparent}}}}}}; border-bottom: 2px solid {{{bordercolor|{{#if:{{{highlighthex|}}}|{{{highlighthex}}}33|#F4F6F6}}}}}; {{{abovestyle|}}}
| belowstyle = background-color: {{{headercolor|{{{highlighthex|transparent}}}}}}; {{{belowstyle|}}}
| navstyle = background-color: {{{headercolor|{{{highlighthex|transparent}}}}}}; padding-right:0.5em; {{{navstyle|}}}
| headerstyle = background-color: {{{headercolor|{{{highlighthex|transparent}}}}}}; border-bottom: 2px solid {{{bordercolor|{{#if:{{{highlighthex|}}}|{{{highlighthex}}}33|#F4F6F6}}}}}; {{{headerstyle|}}}
| labelstyle = background-color: {{{headercolor|{{{highlighthex|transparent}}}}}}; vertical-align: middle; min-width: 8em; border-bottom: 2px solid {{{bordercolor|{{#if:{{{highlighthex|}}}|{{{highlighthex}}}33|#F4F6F6}}}}}; {{{labelstyle|}}}
| datastyle = background-color: {{{datacolor|{{#if:{{{highlighthex|}}}|{{{highlighthex}}}33|transparent}}}}}; vertical-align: top; min-width: 12em; border-bottom: 2px solid {{{bordercolor|{{#if:{{{highlighthex|}}}|{{{highlighthex}}}33|#F4F6F6}}}}}; {{{datastyle|}}}

Subsection style parameters

emoji
Optional Don't love these new-fangled pictograms the kids these days use instead of words? No problem! Just set |emoji=no and they'll be disabled. (Default behaviour is the same as |emoji=yes.)
guildhighlighthex
guildheadercolor
guilddatacolor
guildbordercolor
Optional These parameters work as you expect to apply colours only to the Guild subsection of the infobox.
pantheonhighlighthex
pantheonheadercolor
pantheondatacolor
pantheonbordercolor
Optional These parameters work as you expect to apply colours only to the Pantheon subsection of the infobox.
customhighlighthex
customheadercolor
customimagecolor
customdatacolor
custombordercolor
Optional These parameters work as you expect to apply colours only to the Custom subsection of the infobox.

Misc

nocat
If set to any value, the template will not apply [[Category:Gods]] to the page in which it appears. The default behaviour for the template is to correctly categorise the page.

Next steps

Notey.png Feedback required

I intend to add:

  • Styling parameters that can set apart the Guild and Pantheons sections with their own highlighthex and style parameters. E.g., |pantheonhighlighthex=#AABBCC, or |pantheonheadercolor=lightblue, etc etc.
  • A set of |transparent=yes, |transparentheaders=yes, |transparentdata=yes which will make all/header/data cells transparent. I decided to make the template transparent by default. The cells in the current Usergod are transparent, and some users put background patterns etc. behind them. This template should allow people to make whatever cool, or ugly, or horrible style combinations that they want, and not ruin any existing layouts as far as possible. If they want to embed Usergod inside a <div>...</div> with a rainbow background, they can go for it.

I may still add:

  • Additional pantheons (short term, but not guild)
  • Achievements, see my rambling on talk page that mostly makes sense only to me.

Long-term goals:

  • Rework Template:Hero as well, and then consider the feasibility of WardPhoenix's suggestion to allow hero parameters in this template (probably best implemented through Template:Infobox#Subbox, and therefore part of redesign considerations for {{Hero}}).
  • And if we're going down that route, with {{Hero}} usable in a subbox of {{Usergod}}, why not break out a new {{Pet}} template that can become a subbox inside {{Hero}}? And, hell, while we're at it, why don't we have {{Ark}}, {{Lab-boss}}? With some planning and care, these can be made so they can be used stand-alone or be a sub-box within a superordinate template. (E.g., {{Ark|petname1=Nibbler|petclass1=Ballpoint Penguin|petlevel1=35|...}})