Editing Template:comic/sandbox
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
− | + | <metadesc>Explain xkcd is a wiki dedicated to explaining the webcomic xkcd. Go figure.</metadesc><!-- | |
Create the 'box' around the comic template | Create the 'box' around the comic template | ||
− | --><table class=" | + | --><table class="" cellspacing="5" style="background-color: #FFFFFF; |
border: 1px solid #AAAAAA; color: black; font-size: 88%; | border: 1px solid #AAAAAA; color: black; font-size: 88%; | ||
line-height: 1.5em; margin: 0.5em 0 0.5em 1em; padding: 0.2em; | line-height: 1.5em; margin: 0.5em 0 0.5em 1em; padding: 0.2em; | ||
− | text-align: center; width:98%; | + | text-align: center; width:98%; "><!-- |
This table will contain a table row (tr) and cell (td) | This table will contain a table row (tr) and cell (td) | ||
Line 15: | Line 15: | ||
Generate the |< and prev buttons, but only if {{{number}}} exists and is greater than 1 | Generate the |< and prev buttons, but only if {{{number}}} exists and is greater than 1 | ||
− | -->{{#ifexpr: | + | -->{{#ifexpr:-1>1<!-- |
{{{number}}} is greater than 1; make a list item and put a button in it that links to #1 | {{{number}}} is greater than 1; make a list item and put a button in it that links to #1 | ||
Line 47: | Line 47: | ||
Depending whether {{{number}}} exists or not, toggle between using wide link mode or number link mode. | Depending whether {{{number}}} exists or not, toggle between using wide link mode or number link mode. | ||
Wide link mode requires {{{lappend}}} to be set, while {{{ldomain}}} can default to www | Wide link mode requires {{{lappend}}} to be set, while {{{ldomain}}} can default to www | ||
− | -->[{{#ifexpr: | + | -->[{{#ifexpr:-1>=1<!-- |
Comic number is probably valid, use number link mode | Comic number is probably valid, use number link mode | ||
Line 53: | Line 53: | ||
Comic number is invalid or doesn't exist, use wide link mode | Comic number is invalid or doesn't exist, use wide link mode | ||
− | -->|http:// | + | -->|http://www.xkcd.com/{{{lappend}}}/}}<!-- |
Generate the title, with date if it exists | Generate the title, with date if it exists | ||
--><span style="color: #FFFFFF; padding: 0 12px;">Comic <!-- | --><span style="color: #FFFFFF; padding: 0 12px;">Comic <!-- | ||
− | -->{{#ifexpr: | + | -->{{#ifexpr:-1>= 1|#|}} {{#if:|({{#replace:{{{date}}}| | }})}}</span>]</li><!-- |
Now make the next and >| buttons provided comic number exists | Now make the next and >| buttons provided comic number exists | ||
− | -->{{#ifexist:{{#expr: | + | -->{{#ifexist:{{#expr:-2+1}}<!-- |
No numbers higher than LATESTCOMIC | No numbers higher than LATESTCOMIC | ||
Line 86: | Line 86: | ||
Comic title in =BOLD= | Comic title in =BOLD= | ||
− | -->{{#if: | + | -->{{#if:|<tr><td style="font-size: 20px; padding-bottom:10px">'''{{{title}}}'''</td></tr>}}<!-- |
Display the (optional) text just before the comic | Display the (optional) text just before the comic | ||
− | -->{{#if: | + | -->{{#if:|<tr><td style="padding-bottom:10px">{{{before}}}</td></tr>}}<!-- |
Almost done; just need to display the comic, title text and a bit more | Almost done; just need to display the comic, title text and a bit more | ||
Line 95: | Line 95: | ||
{{{custom}}} will replace the image with whatever it contains if it exists | {{{custom}}} will replace the image with whatever it contains if it exists | ||
− | -->{{#if: | + | -->{{#if: |<!-- |
Not going to replace the image, so let's draw that if it exists | Not going to replace the image, so let's draw that if it exists | ||
− | -->|{{#if: | + | -->|{{#if:|[[File:||]]}}}}<!-- |
{{{imagesize}}} will allow the comic to be shrinked if it's especially large | {{{imagesize}}} will allow the comic to be shrinked if it's especially large | ||
− | -->{{#if: | + | -->{{#if:|<br />[Click comic to enlarge]}}<!-- |
Final bit; if the comic has text on mouse-over, add that in a small print underneath the comic | Final bit; if the comic has text on mouse-over, add that in a small print underneath the comic | ||
− | -->{{#if: | + | -->{{#if:|<br /><span style=""><span style="color:grey">Title text:</span> {{{titletext}}}<!-- |
--></span>}}</td></tr></table><!-- | --></span>}}</td></tr></table><!-- | ||
Line 112: | Line 112: | ||
It otherwise sorts 'alphanumerically'; as in since the first char of 10 is 1, it would normally be placed before 9 | It otherwise sorts 'alphanumerically'; as in since the first char of 10 is 1, it would normally be placed before 9 | ||
The padding turns each into 0009 and 0010 etc. and since 0 is less than 1, #9 gets sorted before #10. | The padding turns each into 0009 and 0010 etc. and since 0 is less than 1, #9 gets sorted before #10. | ||
− | -->{{#ifexpr: | + | -->{{#ifexpr:-1>=1|{{DEFAULTSORT: {{padleft:{{{number}}}|4}}}}|<!-- |
-->}}<!-- | -->}}<!-- | ||
Line 119: | Line 119: | ||
Don't try to categorise the main page nor the extra comics | Don't try to categorise the main page nor the extra comics | ||
− | -->|{{#ifeq:{{FULLPAGENAME}}|{{int:mainpage}}||{{#ifeq: | + | -->|{{#ifeq:{{FULLPAGENAME}}|{{int:mainpage}}||{{#ifeq:|yes|[[Category:Extra comics]]|<!-- |
Alright, start putting it in the appropriate date categories | Alright, start putting it in the appropriate date categories | ||
− | -->[[Category:All comics]]{{#if: | + | -->[[Category:All comics]]{{#if:|[[Category:Comics from {{#time:Y|{{{date}}}}}]]<!-- Years |
-->[[Category:Comics from {{#time:F|{{{date}}}}}]] <!-- Months | -->[[Category:Comics from {{#time:F|{{{date}}}}}]] <!-- Months | ||
-->[[Category:{{#time:l|{{{date}}}}} comics]] <!-- Weekdays | -->[[Category:{{#time:l|{{{date}}}}} comics]] <!-- Weekdays | ||
-->}}}}}}|}}<!-- | -->}}}}}}|}}<!-- | ||
− | -- | + | --> |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− |