Template:comic title

explain xkcd: It's 'cause you're dumb.
Jump to navigation Jump to search

Helper function for {{comic}}.

Wikilinks the title to point to the explanation if the comic is transcluded. But how do we find out if it's transcluded? The logic is: if we're already on the canonical [[number: title]] page, show the title as-is. If the page name starts with the comic's number but differs from [[number: title]], check if a page with that canonincal title exists and link to it if the page exists, otherwise show plain text.

Numbered comics: it checks whether the canonical page (e.g., 10: Pi Equals) exists on the wiki. If yes, the title renders as [[10: Pi Equals|Pi Equals]]; if no, plain text.

Unnumbered comics: checks whether a page named exactly {{{title}}} exists. If yes, [[Pi Equals]]; if no, plain text again.