Difference between revisions of "Template:comic/doc"
(→Usage) |
|||
| Line 1: | Line 1: | ||
| − | <noinclude><big><big>This page WILL BE transcluded into [[Template:comic]] as its documentation. (once the changes are approved by an admin)</big></big> | + | <noinclude><big><big>This page WILL BE transcluded into [[Template:comic]] as its documentation. [[User_talk:Kynde#Another_template_improvement|(once the changes are approved by an admin)]]</big></big> |
---- | ---- | ||
Revision as of 18:16, 20 April 2025
This page WILL BE transcluded into Template:comic as its documentation. (once the changes are approved by an admin)
This template has an associated sandbox, available at Template:comic/sandbox. This is the basic infobox-style header template used to display xkcd comics on their own pages, including the comic number (with external link to xkcd), publication date, title, comic image, and title text.
Usage
{{comic
| number =
| date =
| title =
| oglink =
| ogtitle =
| before =
| image =
| custom =
| imagesize =
| noexpand =
| titletext =
| ttstyle =
| extra =
| ldomain =
| lappend =
}}
number, title, and image are the comic number, comic title, and comic image. In normal circumstances, they should always be defined.
date is the date the comic was first published and should be written in the form mmmm d, yyyy (full month name, day number without padding, 4-digit year; i.e. January 1, 2006). If the comic has no date or has not been released, it should be omitted.
oglink must always be used alongside ogtitle. Otherwise, chaos will ensue. They should only be used for the early xkcd comics, not when Randall changes the title of an existing comic. (Or maybe they should? That's interesting now that I think about it!) These parameters are optional.
before is used to insert text before the comic, usually to insert a link to skip to the explanation on extremely large comics like 1732: Earth Temperature Timeline. The text provided to this parameter is placed on the line between the title and the image. This parameter is optional. The wikitext used to jump to the ==Explanation== is [[#Explanation|↓ Skip to explanation ↓]].
imagesize limits the size of the image in units of pixels. This parameter is optional.
- To limit the width, simply list the width. E.g.:
350px - To limit the height, prepend an "x" to the desired height. E.g.:
x400px - Warning: If the
imagesizeis larger than theimage, the image will be stretched.
noexpand is a boolean parameter indicating whether the "Click comic to enlarge" button is hidden, usually used when imagesize is limiting the size of the comic. To hide the button, set this to true. This parameter is optional.
custom overrides the image parameter and replaces the image with the text provided. This parameter is optional.
titletext sets the title text of the comic. ttstyle (title text style) will set the style of titletext that appears beneath the comic via the style attribute of the span object. This parameter is optional.
extra is a boolean parameter that will automatically add the page to the Extra comics category when it is set to yes. This parameter is optional.
If number is left undefined, at least lappend must be defined. The comic link will be set using "wide link mode" [What does this mean?], and most of the navigation bar will be disabled.
-
lappend(link append) is the text that is appended toxkcd.com/in the link. This parameter is required when using "wide link mode". -
ldomain(link domain) is the subdomain of the link, defaulting towww. For example, if the link is to a blog post (blog.xkcd.com),ldomainshould be set toblog. This parameter does not have to be explicitly set. - The resulting link will be:
https://ldomain.xkcd.com/lappend
Example 1
| Suspension Bridge |
Title text: As a first step, they can put in a secondary deck, to help drivers try it out and find out how fun the jumps are. After a while no one will use the old flat deck and they can remove it. |
The example above is produced by the following code:
{{comic
| number = 3048
| date = February 7, 2025
| title = Suspension Bridge
| image = suspension_bridge_2x.png
| imagesize = 362x365px
| noexpand = true
| titletext = As a first step, they can put in a secondary deck, to help drivers try it out and find out how fun the jumps are. After a while no one will use the old flat deck and they can remove it.
}}
Example 2
| Pi Equals |
| Original title: Pi equals |
![]() Title text: My most famous drawing, and one of the first I did for the site |
The example above is produced by the following code:
{{{comic
| number = 10
| date = September 30, 2005
| title = Pi Equals
| oglink = https://web.archive.org/web/20070927001941/http://xkcd-drawings.livejournal.com/?skip=40#:~:text=8%3A44%20pm-,Pi%20equals,-(4%20Comments
| ogtitle = Pi equals
| image = pi.jpg
| titletext = My most famous drawing, and one of the first I did for the site
}}

