Difference between revisions of "Template:comic"

Explain xkcd: It's 'cause you're dumb.
Jump to: navigation, search
(Better subst the {{PAGENAME}} when using this template, to avoid problems with transclusions (such as the latest comic in the main page, displaying "Main Page" as the title). Comic title won't change, whereas the page using {{comic}} could be renamed)
(fixed an error in the "ifexist previous comic" test: it did exactly the opposite of expected, displaying a link when there is *not* a page for the previous comic, and not displaying it when there is one.)
Line 3: Line 3:
 
--><tr><td><ul style="text-align: center; margin-bottom: 10px;">
 
--><tr><td><ul style="text-align: center; margin-bottom: 10px;">
 
{{#ifexist:{{#expr:{{{number|}}}-1}}
 
{{#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;">&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>}}
 
   |<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>}}
 
<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;">[http://www.xkcd.com/{{{number}}}/ <span style="color: #FFFFFF;">Comic &#35;{{{number}}} {{#if:{{{date|}}}|({{{date|}}})}}</span>]</li>

Revision as of 13:42, 6 August 2012

Usage

{{comic
| number    = 
| date      = 
| title     = {{subst:PAGENAME}}
| image     = 
| imagesize = 
| alttext   = 
}}

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")