Difference between revisions of "Template:comic"

Explain xkcd: It's 'cause you're dumb.
Jump to: navigation, search
(This probably should be a subst, given that a lot of people are starting with the page number at this point, and then doing a move to the comic title, the subst will stick the comic number.)
Line 1: Line 1:
<table class="{{{bodyclass|}}}" cellspacing="5" style="background-color: #F9F9F9; border: 1px solid #AAAAAA; color: black; font-size: 88%; line-height: 1.5em; margin: 0.5em 0 0.5em 1em; padding: 0.2em; text-align: center; width:98%;  {{{bodystyle|}}}"><!--
+
<table class="{{{bodyclass|}}}" cellspacing="5" style="background-color: #F9F9F9; border: 1px solid #AAAAAA; color: black; font-size: 88%; line-height: 1.5em; margin: 0.5em 0 0.5em 1em; padding: 0.2em; text-align: center; width:98%;  {{{bodystyle|}}}">
Navbar
+
<tr><td><ul style="text-align: center; margin-bottom: 10px;"><noinclude>
--><tr><td><ul style="text-align: center; margin-bottom: 10px;">
+
 
{{#ifexist:{{#expr:{{{number|}}}-1}}
+
<!-- NAVBAR: If there is an article for the comic prior to this one, create a "prev"-->
   |<li style="background-color: #6E7B91; border: 1.5px solid #333333; border-radius: 3px 3px 3px 3px; box-shadow: 0 0 5px 0 gray; display: inline; font-size: 16px; font-variant: small-caps; font-weight: 600; margin: 0 4px; padding: 1.5px 12px;">[[{{#expr:{{{number|}}}-1}}|<span style="color: #FFFFFF;">&lt; Prev</span>]]</li>|<li style="border: 1.5px ; border-radius: 3px 3px 3px 3px; box-shadow: 0; display: inline; font-size: 16px; font-variant: small-caps; font-weight: 600; margin: 0 4px; padding: 1.5px 12px;"><span style="color: #FFFFFF;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></li>}}
+
</noinclude>{{#ifexist:{{#expr:{{{number|}}}-1}}
<li style="background-color: #6E7B91; border: 1.5px solid #333333; border-radius: 3px 3px 3px 3px; box-shadow: 0 0 5px 0 gray; display: inline; font-size: 16px; font-variant: small-caps; font-weight: 600; margin: 0 4px; padding: 1.5px 12px;">[http://www.xkcd.com/{{{number}}}/ <span style="color: #FFFFFF;">Comic &#35;{{{number}}} {{#if:{{{date|}}}|({{{date|}}})}}</span>]</li>
+
   |<li style="background-color: #6E7B91; border: 1.5px solid #333333; border-radius: 3px 3px 3px 3px; box-shadow: 0 0 5px 0 gray; display: inline; font-size: 16px; font-variant: small-caps; font-weight: 600; margin: 0 4px; padding: 1.5px 12px;">[[{{#expr:{{{number|}}}-1}}|<span style="color: #FFFFFF;">&lt; Prev</span>]]</li>|<li style="border: 1.5px ; border-radius: 3px 3px 3px 3px; box-shadow: 0; display: inline; font-size: 16px; font-variant: small-caps; font-weight: 600; margin: 0 4px; padding: 1.5px 12px;"><span style="color: #FFFFFF;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></li>}}<noinclude>
{{#ifexist:{{#expr:{{{number|}}}+1}}
+
 
 +
<!-- NAVBAR: Create a centre button with comic #, date (if exists) and link-->
 +
 
 +
</noinclude><li style="background-color: #6E7B91; border: 1.5px solid #333333; border-radius: 3px 3px 3px 3px; box-shadow: 0 0 5px 0 gray; display: inline; font-size: 16px; font-variant: small-caps; font-weight: 600; margin: 0 4px; padding: 1.5px 12px;">[http://www.xkcd.com/{{{number}}}/ <span style="color: #FFFFFF;">Comic &#35;{{{number}}} {{#if:{{{date|}}}|({{{date|}}})}}</span>]</li><noinclude>
 +
 
 +
<!-- NAVBAR: If there is an article for the comic following this one, create a "next"-->
 +
 
 +
</noinclude>{{#ifexist:{{#expr:{{{number|}}}+1}}
 
   |<li style="background-color: #6E7B91; border: 1.5px solid #333333; border-radius: 3px 3px 3px 3px; box-shadow: 0 0 5px 0 gray; display: inline; font-size: 16px; font-variant: small-caps; font-weight: 600; margin: 0 4px; padding: 1.5px 12px;">[[{{#expr:{{{number|}}}+1}}|<span style="color: #FFFFFF;">Next &gt;</span>]]</li>|<li style="border: 1.5px ; border-radius: 3px 3px 3px 3px; box-shadow: 0; display: inline; font-size: 16px; font-variant: small-caps; font-weight: 600; margin: 0 4px; padding: 1.5px 12px;"><span style="color: #FFFFFF;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></li>}}
 
   |<li style="background-color: #6E7B91; border: 1.5px solid #333333; border-radius: 3px 3px 3px 3px; box-shadow: 0 0 5px 0 gray; display: inline; font-size: 16px; font-variant: small-caps; font-weight: 600; margin: 0 4px; padding: 1.5px 12px;">[[{{#expr:{{{number|}}}+1}}|<span style="color: #FFFFFF;">Next &gt;</span>]]</li>|<li style="border: 1.5px ; border-radius: 3px 3px 3px 3px; box-shadow: 0; display: inline; font-size: 16px; font-variant: small-caps; font-weight: 600; margin: 0 4px; padding: 1.5px 12px;"><span style="color: #FFFFFF;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></li>}}
 
</ul></td></tr>
 
</ul></td></tr>
<tr><td>{{#if:{{{title|}}}|<span style="font-size:20px">'''{{{title|}}}'''</span>}}</td></tr>
+
 
<tr><td>{{#if:{{{date|}}}|[[Category:Comics{{!}}{{{number|(missing parameter 1)}}}]][[Category:Comics from {{#time:Y|{{{date|(missing parameter 2)}}}}}]][[Category:Comics from {{#time:F|{{{date|}}}}}]][[Category:Comics|{{Num4|{{{number|}}}}}]][[Category:{{#time:l|{{{date|}}}}} Comics]]}}
+
<tr><td>{{#if:{{{title|}}}|<span style="font-size:20px">'''{{{title|}}}'''</span>}}</td></tr><noinclude>
{{#if:{{{image|}}}|[[File:{{{image|}}}{{!}}{{{titletext|}}}{{#if:{{{imagesize|}}}|{{!}}{{{imagesize|}}}}}]]{{#if:{{{titletext|}}}|{{#if:{{{imagesize|}}}|<br />[Click comic to enlarge]}}<br /><span style="{{{captionstyle|}}}"><span style="color:grey">Title-text:</span> {{{titletext|}}}</span>}}}}
+
 
</td></tr></table><!--
+
<!--  Displays comic image, and title text-->
 +
 
 +
</noinclude>
 +
<tr><td>{{#if:{{{image|}}}|[[File:{{{image|}}}{{!}}{{{titletext|}}}{{#if:{{{imagesize|}}}|{{!}}{{{imagesize|}}}}}]]{{#if:{{{titletext|}}}|{{#if:{{{imagesize|}}}|<br />[Click comic to enlarge]}}<br /><span style="{{{captionstyle|}}}"><span style="color:grey">Title-text:</span> {{{titletext|}}}</span>}}}}
 +
</td></tr></table><noinclude>
 +
 
 +
<!-- Adds categories to comic based on date field-->
 +
 
 +
</noinclude>
 +
{{#if:{{{date|}}}|[[Category:Comics{{!}}{{{number|(missing parameter 1)}}}]][[Category:Comics from {{#time:Y|{{{date|(missing parameter 2)}}}}}]][[Category:Comics from {{#time:F|{{{date|}}}}}]][[Category:Comics|{{Num4|{{{number|}}}}}]][[Category:{{#time:l|{{{date|}}}}} Comics]]}}<!--
  
 
-->{{#if:{{{alttext|}}}|<span class="error">'''Error:''' The alttext= parameter to the {{tl|comic}} template was deprecated. Please edit this page and replace alttext= with titletext=.</span>}}<noinclude>
 
-->{{#if:{{{alttext|}}}|<span class="error">'''Error:''' The alttext= parameter to the {{tl|comic}} template was deprecated. Please edit this page and replace alttext= with titletext=.</span>}}<noinclude>

Revision as of 16:07, 7 August 2012




Usage

{{comic
| number    = 
| date      = 
| title     = {{PAGENAME}}
| image     = 
| imagesize = 
| titletext = 
}}

Note: If the page title is not the comic title, change the "title" field.

The imagesize field is optional for larger comics. The larger dimension (height or width) will be limited to the size. Warning: If the size is larger than the image, the image will be stretched. Format must be in pixels (eg: "350px")