Difference between revisions of "Template:CalCell"

From Twilight Heroes Wiki
Jump to: navigation, search
m (table and format fix)
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<includeonly>{{#ifeq:{{#time: j F Y|{{{1}}} {{{2}}}}} | {{THDay}} | style="background: {{{4}}}; color: {{{5}}}; height: 75px; width: 75px" valign="top" align="left" | style="background: {{{6}}}; color: {{{7}}}; height: 75px; width: 75px" valign="top" align="left" | style="height: 75px; width: 75px" valign="top" align="left"}} |<big>'''{{{1}}}'''</big>{{#if:{{{3}}} | <br> {{{3}}} | }}<br></includeonly><noinclude>
+
<includeonly>{{#ifeq:{{#time: j F Y|{{{1}}} {{{2}}}}} | {{THDay}} | style="background: {{{6}}}; color: {{{5}}}; border-top:3px solid {{{4}}}; border-right:3px solid {{{4}}}; border-bottom:3px solid {{{4}}}; border-left:3px solid {{{4}}}; height: 75px; width: 75px" valign="top" align="left" | style="background: {{{6}}}; color: {{{7}}}; height: 75px; width: 75px" valign="top" align="left" | style="height: 75px; width: 75px" valign="top" align="left"}} |<big>'''{{{1}}}'''</big>{{#if:{{{3}}} | <br> {{{3}}} | }}<br></includeonly><noinclude>
 
==Usage==
 
==Usage==
 
This template formats a cell.<br>
 
This template formats a cell.<br>
 
Syntax:<br>
 
Syntax:<br>
<nowiki>{{CalCell|Day|Month Year|Description|Background1|Color1|Background2|Color2}}</nowiki><br>
+
<nowiki>{{CalCell|Day|Month Year|Description|DayBorder|DayText|Background|TextColor}}</nowiki><br>
 
<b>Day</b>: The number of the day<br>
 
<b>Day</b>: The number of the day<br>
 
<b>Month Year</b>: The month and year; the first letter of the month should be capitalised.<br>
 
<b>Month Year</b>: The month and year; the first letter of the month should be capitalised.<br>
 
<b>Description</b>: Content of the cell<br>
 
<b>Description</b>: Content of the cell<br>
<b>Background1</b>, <b>color1</b>: The colours of the cell when it is that date<br>
+
<b>DayBorder</b>: The border of the cell when it is that date<br>
<b>Background2</b>, <b>color2</b>: The colours of the cell when it is NOT that date<br>
+
<b>DayText</b>: The colour of the cell text when it is that date<br>
 +
<b>Background</b>: The colour of the cell<br>
 +
<b>TextColor</b>: The colour of the text, normally<br>
  
 
==Sample==
 
==Sample==
 
<nowiki>{|-</nowiki><br><nowiki>
 
<nowiki>{|-</nowiki><br><nowiki>
|{{CalCell|2|November 2008|Description|black|white|green|red}}</nowiki><br><nowiki>
+
|{{CalCell|</nowiki>{{#time: j| {{THDay}} -2 day}}|{{#time: F Y|{{THDay}} -2 day}}<nowiki>||black|blue|lime|red}}</nowiki><br><nowiki>
|{{CalCell|</nowiki>{{#time: j| {{THDay}}}}|{{#time: j|{{THDay}}}}|{{#time: F Y|{{THDay}}}}<nowiki>||black|white|green|red}}</nowiki><br><nowiki>
+
|{{CalCell|</nowiki>{{#time: j| {{THDay}} -1 day}}|{{#time: F Y|{{THDay}} -1 day}}<nowiki>|Description|black|blue|lime|red}}</nowiki><br><nowiki>
 +
|{{CalCell|</nowiki>{{#time: j| {{THDay}}}}|{{#time: F Y|{{THDay}}}}<nowiki>||black|blue|lime|red}}</nowiki><br><nowiki>
 +
|{{CalCell|</nowiki>{{#time: j| {{THDay}} +1 day}}|{{#time: F Y|{{THDay}} +1 day}}<nowiki>||black|blue|red|lime}}</nowiki><br><nowiki>
 +
|{{CalCell|</nowiki>{{#time: j| {{THDay}} +2 day}}|{{#time: F Y|{{THDay}} +2 day}}<nowiki>|Description<br>with line break|black|bluelime|red}}</nowiki><br><nowiki>
 
|}</nowiki><br>
 
|}</nowiki><br>
 
returns:<br>
 
returns:<br>
 
{|-
 
{|-
|{{CalCell|2|November 2008|Description|black|white|green|red}}
+
|{{CalCell|{{#time: j| {{THDay}} -2 day}}|{{#time: F Y|{{THDay}} -2 day}}||black|blue|lime|red}}
|{{CalCell|{{#time: j| {{THDay}}}}|{{#time: F Y|{{THDay}}}}||black|white|green|red}}
+
|{{CalCell|{{#time: j| {{THDay}} -1 day}}|{{#time: F Y|{{THDay}} -1 day}}|Description|black|blue|lime|red}}
 +
|{{CalCell|{{#time: j| {{THDay}}}}|{{#time: F Y|{{THDay}}}}|Today|black|blue|lime|red}}
 +
|{{CalCell|{{#time: j| {{THDay}} +1 day}}|{{#time: F Y|{{THDay}} +1 day}}||black|blue|red|lime}}
 +
|{{CalCell|{{#time: j| {{THDay}} +2 day}}|{{#time: F Y|{{THDay}} +2 day}}|Description<br>with line break|black|blue|lime|red}}
 
|}
 
|}
</noinclude>
+
[[Category:Utility Templates|{{PAGENAME}}]]</noinclude>

Latest revision as of 08:46, 22 February 2010

Usage

This template formats a cell.
Syntax:
{{CalCell|Day|Month Year|Description|DayBorder|DayText|Background|TextColor}}
Day: The number of the day
Month Year: The month and year; the first letter of the month should be capitalised.
Description: Content of the cell
DayBorder: The border of the cell when it is that date
DayText: The colour of the cell text when it is that date
Background: The colour of the cell
TextColor: The colour of the text, normally

Sample

{|-
|{{CalCell|18|September 2024||black|blue|lime|red}}
|{{CalCell|19|September 2024|Description|black|blue|lime|red}}
|{{CalCell|20|September 2024||black|blue|lime|red}}
|{{CalCell|21|September 2024||black|blue|red|lime}}
|{{CalCell|22|September 2024|Description<br>with line break|black|bluelime|red}}
|}
returns:

18
19
Description
20
Today
21
22
Description
with line break