Difference between revisions of "Template:comic"

Explain xkcd: It's 'cause you're dumb.
Jump to: navigation, search
(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.)
(I don't think we should display the alt-text in italic: it's not the case on xkcd.com / m.xkcd.com, so there could be some visual effect lost.)
Line 10: Line 10:
 
<tr><td>{{#if:{{{title|}}}|<span style="font-size:20px">'''{{{title|}}}'''</span>}}</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:{{{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:{{{image|}}}|[[File:{{{image|}}}{{!}}{{{alttext|}}}{{#if:{{{imagesize|}}}|{{!}}{{{imagesize|}}}}}]]{{#if:{{{alttext|}}}|{{#if:{{{imagesize|}}}|<br />[Click comic to enlarge]}}<br /><span style="{{{captionstyle|}}}">Alt text: ''{{{alttext|}}}''</span>}}}}
+
{{#if:{{{image|}}}|[[File:{{{image|}}}{{!}}{{{alttext|}}}{{#if:{{{imagesize|}}}|{{!}}{{{imagesize|}}}}}]]{{#if:{{{alttext|}}}|{{#if:{{{imagesize|}}}|<br />[Click comic to enlarge]}}<br /><span style="{{{captionstyle|}}}"><span style="color:grey">Alt-text:</span> {{{alttext|}}}</span>}}}}
 
</td></tr></table><noinclude>
 
</td></tr></table><noinclude>
 
==Usage==
 
==Usage==

Revision as of 13:51, 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")