Difference between revisions of "explain xkcd:Community portal/Design"

Explain xkcd: It's 'cause you're dumb.
Jump to: navigation, search
(Header template: new section)
 
(38 intermediate revisions by 9 users not shown)
Line 1: Line 1:
<noinclude>__NEWSECTIONLINK__
+
#Redirect [[Explain XKCD:Community portal/Proposals]]
{{Community portal}}</noinclude>
 
 
 
== Header template ==
 
 
 
Hi, I've created a template called [[Template:ComicHeader]], which might make things easier when creating comic pages (and also provide better consistency between the pages). I've used it on the [[Internal monologue]] page, to display the comic number and the date it was published. The template also adds the page to the [[:Category:Comics|Comics]] category.
 
 
 
You just need to add:
 
<pre>{{ComicHeader|1089|August 1, 2012}}</pre>
 
…to the start of the page (replacing the comic number and date).
 
 
 
I'll try to make the template look a bit nicer, but the great thing about templates of course, is that once they're updated, the changes are reflected on all the pages that include that template. --[[User:Yirba|Yirba]] ([[User talk:Yirba|talk]]) 18:46, 1 August 2012 (EDT)
 
 
 
:By the way, I'm thinking of maybe programming something that would allow you to easily import the comic image and alt text from xkcd without having to upload the images manually and the like. You'd just have to host a single PHP file on your server and make a few changes to the MediaWiki configuration. Of course, you'd be able to see source code and everything to make sure I'm not trying to do something fishy. :-P Let me know what you think. :-) --[[User:Yirba|Yirba]] ([[User talk:Yirba|talk]]) 18:54, 1 August 2012 (EDT)
 
::Yirba - I like the idea.  My email is [email protected] - send me what you put together and we can sort it out. --[[User:Jeff|Jeff]] ([[User talk:Jeff|talk]]) 19:37, 1 August 2012 (EDT)
 
::Ditto on the Template.  Up-vote.  Any thought on harvesting the pre-wiki content from ExplainXKCD with some sort of a Python, Perl, or PHP script?  (That sounds more like a 'bot than something that would have to be hosted, though.) [[User:IronyChef|IronyChef]] ([[User talk:IronyChef|talk]]) 01:52, 2 August 2012 (EDT)
 
 
 
::: I was thinking of putting it into a infobox, please [[#Idea|see above]]. I also intended to automatically extract data from xkcd, which would lack descriptions, but at least we would have data like title, image and transcripts. Also, there are some other data like links (e.g. 832), news (which are displayed in xkcd's header, e.g. 739) and titles which contain HTML (259 and 472). I also extracted all those data. When we agree on a page layout, I could begin programming a bot. --[[User:SlashMe|SlashMe]] ([[User talk:SlashMe|talk]]) 06:54, 2 August 2012 (EDT)
 
 
 
::::Hmmm… an infobox may be a good idea. And a bot that imports data from xkcd might be handy. Anyway, here's something I programmed that would allow for access to the xkcd API from the wiki itself. Essentially, you'd put this xkcdinfo.php ([http://gist.github.com/3239432 source], [http://github.com/downloads/Yirba/yirba.github.com/xkcdinfo.php download]) file somewhere on the server (e.g. at http://www.explainxkcd.com/xkcdinfo.php) and [http://www.mediawiki.org/wiki/Manual:Interwiki#Adding_a_new_website_for_interwiki_linking include it in MediaWiki's interwiki table] (ensuring iw_trans == 1):
 
<pre>INSERT INTO interwiki (iw_prefix, iw_url, iw_local, iw_trans) VALUES ('xkcdinfo', 'http://www.explainxkcd.com/xkcdinfo.php?input=$1', 0, 1);</pre>
 
::::After [http://www.mediawiki.org/wiki/Manual:$wgEnableScaryTranscluding enabling scary transclusion] in LocalSettings.php, you'd then be able to send queries to the xkcd JSON API via this file. In other words, <code><nowiki>{{xkcdinfo:32-title}}</nowiki></code> would make comic 32's title appear. <code><nowiki>{{xkcdinfo:55-alt}}</nowiki></code> would make comic 55's image text appear. I've also set it so you could enter <code><nowiki>{{xkcdinfo:100-embed}}</nowiki></code>, and it would make the comic 100 image appear on the wiki page. Feel free to use it however you want (if at all), and modify the code should you wish. (Hint: Using the number 0 for the comic number will query the most recent comic, so <code><nowiki>{{xkcdinfo:0-num}}</nowiki></code> will return the current comic number. Also, adding "raw:" before "xkcdinfo:" might be more useful in some instances. E.g.: <code><nowiki>{{raw:xkcdinfo:555-title}}</nowiki></code>)--[[User:Yirba|Yirba]] ([[User talk:Yirba|talk]]) 14:50, 2 August 2012 (EDT)
 
 
 
::::: Nice idea, altough this would mean to load all data from xkcd whenever a page is <del>viewed</del><ins>edited</ins> (I think this is the way MediaWiki caches the data). This is a lot of traffic for little data. I'd say to include the metadata statically, but linking the external image seems a good thing to me. Again, it'd be great if you gave me feedback for [[User:SlashMe/Testpage|my idea]]. --[[User:SlashMe|SlashMe]] ([[User talk:SlashMe|talk]]) 15:54, 2 August 2012 (EDT)
 
 
 
::::::Yes, the data would be loaded from xkcd for each edit. You can, however, substitute (subst) the template for data that is unlikely to change. And therefore the data would indeed be stored statically. I like the layout you've come up with. It could perhaps do with a bit of tweaking here and there, but the general idea is good. --[[User:Yirba|Yirba]] ([[User talk:Yirba|talk]]) 17:16, 2 August 2012 (EDT)
 
 
 
::::::: What kind of tweaking do you mean? I know the code is a bit messy, if you have a better idea, please tell me (or do it yourself - hey, it's a wiki!). The CSS should be placed in an external file, but for now, it's ok. --[[User:SlashMe|SlashMe]] ([[User talk:SlashMe|talk]]) 17:51, 2 August 2012 (EDT)
 
 
 
Looks like there is another/newer template called [[Template:Comic]] that includes prev/next buttons as well.
 
You add it with:
 
<pre>{{comic
 
| number    = 1
 
| date      = September 30, 2005
 
| title    = {{PAGENAME}}
 
| image    = barrel_cropped_(1).jpg
 
| imagesize =
 
| alttext  = Don't we all.
 
}}
 
==Description==
 
xxxxxxxxxxx
 
</pre>
 
No need to include the alt text separately, as the template does it for you.  It also includes the comic category, but only if the first 4 fields are filled out.
 
--[[User:Bpothier|B. P.]] ([[User talk:Bpothier|talk]]) 18:47, 3 August 2012 (EDT)
 
 
 
: Yes, but that is not necessarily an advantage. My template only creates the infobox, so you are still able to create an introductory text or other sections, for special comics that need a more detailed description. I can also add categories if needed. --[[User:SlashMe|SlashMe]] ([[User talk:SlashMe|talk]]) 19:02, 3 August 2012 (EDT)
 
 
 
::I think it is a major advantage to make the thing easier to use and more consistant site-wide.
 
 
 
::As the creator of the new one, I'm obviously biased, but I created it because I think it's better. Not putting your work down, it was a great piece of code that I put to work in my template. But I think if there's need for pre-text of any kind (not sure there is, as the articles probably should all open with the comic itself as presented on XKCD), a pre-comment can be added into the template, but I'm not sure what that would be. Perhaps there would be a requirement for special circumstances like the comic a few weeks ago where there were a million iterations depending on locality, browser, etc. But that's the rarity. I think the new one simplifies it for users. They need only one template to post the comic, alt text title and nav buttons. What could be easier? [[User:TheHYPO|TheHYPO]] ([[User talk:TheHYPO|talk]]) 19:08, 3 August 2012 (EDT)
 
 
 
::: As the creator of the other one, I'm equally biased. What about a "main template", which then calls one or two other templates (e.g. one for the infobox, another for image and alt text? For most comics, this main template could be used, but if absolutely needed, it would still be possible to use the underlying templates with custom sections/text. --[[User:SlashMe|SlashMe]] ([[User talk:SlashMe|talk]]) 19:15, 3 August 2012 (EDT)
 
 
 
::::I just now saw your request for feedback on your new comic page with the sidebar. I honestly am not sure which format is better. I kind of like my format for the fact that it basically presents the comic as it was originally posted, but your infobox does provide some additional stuff like 3D link (not sure what "news" is, of where the "link" comes from but...) Perhaps we could integrate the two. I like that the comic is visble right away on my template, but on your page it's down below the first header. I don't think the comic itself needs an "image" heading. No disrespect, but I think your sidebar, esp. because of the "news" field is a bit chunky - too wide for most of its content.
 
 
 
::::I think we could easily add things like a "3d" link into {{tl|comic}} as part of the next/prev bar where a "3D" field in the template is non-blank. Similarly, original title could read something like (Originally titled: xxxxx) below the primary title in a smaller font. Other than the "link" and "news" fields (which again, I'm not sure what they are), I think that would inclde all the same info as your infobox into my template. Thoughts?
 
 
 
::::As to your other comment about compartmentalizing the template, I have nothing against that, but which parts of the template would you want to be able to use separately (and can you suggest an example where that might be necessary?) Subdividing the template can always be done later if it becomes needed; just trying to get an idea of what you have in mind by compartmentalizing it. Cheers [[User:TheHYPO|TheHYPO]] ([[User talk:TheHYPO|talk]]) 19:43, 3 August 2012 (EDT)
 

Latest revision as of 10:31, 6 August 2012