Forum:Need opinions on a new "cite/source" template

As most of you probably have noticed, most simple citations are being replaced by more complex one. The current version is better, no doubt here.
 * Before: The Last Guardian, page page number
 * Now:

But it's a hell of a mess to have to copy paste all that info again and again, when it's always the same, and doesn't change.

So I decided to create a template, that would output all the info with simply typing the name of the book.

My first "sketch" of it is here: source

It's very basic:. If BookName is empty, a "citation needed" tag appears. If PageNumber is empty, a "??" appears instead. If both fields work properly, it displays "ExtendedBookName, page PageNumber".

It only works for some novels/manga/comics, but should work for every single official material, including games and the RPG.

But I'm having some design doubts, and I'd prefer to clear up them before improving it:
 * Should BookName be the complete name of the book?
 * Should books that are part of a series have unique name (ie, Sundering) or should they follow the series' name (ie, WotA3)?
 * Should monthly comic issues be in, or just the volumes?
 * Should I add a new "SourceType" field to make the generation faster? Right now, it has to look for the source between all the existing sources. With a SourceType field, it would look only between manga/novels/comics.

Those are all for now.--Lon-ami (talk) 14:05, 18 November 2010 (UTC)


 * Some tests of the template:
 * Seems I have to fix something, "check empty" is giving problems :P.--Lon-ami (talk) 14:07, 18 November 2010 (UTC)
 * Eww, use #switch instead of chained #ifeq. -- 14:47, 18 November 2010 (UTC)
 * Seems I have to fix something, "check empty" is giving problems :P.--Lon-ami (talk) 14:07, 18 November 2010 (UTC)
 * Eww, use #switch instead of chained #ifeq. -- 14:47, 18 November 2010 (UTC)
 * Seems I have to fix something, "check empty" is giving problems :P.--Lon-ami (talk) 14:07, 18 November 2010 (UTC)
 * Eww, use #switch instead of chained #ifeq. -- 14:47, 18 November 2010 (UTC)
 * Seems I have to fix something, "check empty" is giving problems :P.--Lon-ami (talk) 14:07, 18 November 2010 (UTC)
 * Eww, use #switch instead of chained #ifeq. -- 14:47, 18 November 2010 (UTC)
 * Seems I have to fix something, "check empty" is giving problems :P.--Lon-ami (talk) 14:07, 18 November 2010 (UTC)
 * Eww, use #switch instead of chained #ifeq. -- 14:47, 18 November 2010 (UTC)
 * Seems I have to fix something, "check empty" is giving problems :P.--Lon-ami (talk) 14:07, 18 November 2010 (UTC)
 * Eww, use #switch instead of chained #ifeq. -- 14:47, 18 November 2010 (UTC)
 * Seems I have to fix something, "check empty" is giving problems :P.--Lon-ami (talk) 14:07, 18 November 2010 (UTC)
 * Eww, use #switch instead of chained #ifeq. -- 14:47, 18 November 2010 (UTC)
 * Seems I have to fix something, "check empty" is giving problems :P.--Lon-ami (talk) 14:07, 18 November 2010 (UTC)
 * Eww, use #switch instead of chained #ifeq. -- 14:47, 18 November 2010 (UTC)


 * Aw, sorry, I copy-pasted it from another one I had where I used number ranges. Changing it asap.--Lon-ami (talk) 15:43, 18 November 2010 (UTC)
 * Even number ranges should use #switch if its written like that... o.O -- 15:45, 18 November 2010 (UTC)


 * Nop, I tried a template like that, and it failed again and again. Here it is:
 * User:Lon-ami/Template:User SoL Rank
 * User:Lon-ami/Template:User SoL Rank/ranks
 * User:Lon-ami/Template:User SoL Rank/doc
 * Forum:Give templates different use choices: how?
 * I was busy at thinking at further design that I forgot about switch xD (funny, I originally used switch on that one). You can tell I don't make complicate templates often :P.
 * Anyway, any idea on detecting fields not being used?--Lon-ami (talk) 15:53, 18 November 2010 (UTC)
 * Fixed both templates for you... -- 16:01, 18 November 2010 (UTC)


 * Ah, I see it now. Thanks a lot.
 * So empty space at gets fixed with  . No idea, great to know.
 * Just one last question: what's that "1" directly after "switch" for? (at User SoL Rank)
 * Thanks again :).--Lon-ami (talk) 16:12, 18 November 2010 (UTC)
 * #expr evaluates as 1 if true, so that's how you do number ranges in #switch. -- 16:14, 18 November 2010 (UTC)


 * Ah, now I understand. Instead of switching from variable to value, you switch from value to variable. That way, you pick the first option in which the expr is true/1.
 * The more you know.--Lon-ami (talk) 16:20, 18 November 2010 (UTC)


 * I think the template is fine now. It shows PageNumber even when it's letters instead of numbers and when the book isn't recognized, but well, no need to complicate the code even more to fix human errors. "The book doesn't exist" says enough, imo.--Lon-ami (talk) 16:26, 18 November 2010 (UTC)


 * Don't forget to document the parameters clearly. Otherwise, it looks very nice. --[[Image:gengar orange 22x22.png]] Fandyllic (talk &middot; contribs) 10:32 AM PST 18 Nov 2010


 * Some more things:
 * Should I include a "text fragment" option in the template, or leave it for outside the template?
 * I'm thinking about writing the output text in subpages, and linking them to the template itself, to save space for the main code. Any preferred name for the subpages (complete, part, shortcut...)?
 * Finally, should this template work with shortcuts (TLG) or complete names (The Last Guardian)?
 * Thanks for the feedback :).--Lon-ami (talk) 19:27, 18 November 2010 (UTC)

Ideally, as many of the "simple citations" should be converted to the more formal complex one as possible. I do not particularly like Source in its current incarnation. People are going to have to memorize the abbreviations, like they had to with "Cite". I suppose the abbreviations are obvious enough... but as "Cite" proved, annoying variation will occur with continued usage. The template seems only for books, so what about things that are not books? Also, if you are going to make a template that allows for easier citation like this, I think that the template should be make so that the end result is the more complex citations, not just a short name of the book. That would be both formal and assessable. As for the name of the book displayed, I would actually prefer the complete full name of the book, despite our consensus on page names.-- 19:50, 18 November 2010 (UTC)


 * Yeah, once I finish with design decisions, I'm going to include as information as possible, like authors and the likes. Right now, it's in "beta" stage, but it will include all the information pointed above, in the first "post".
 * Regarding abbreviations, that's one of my problems, too. I think people will make a mess out of it. That's why I ask what to choose as input: abbreviations or complete name.
 * In the long term, I would like to have this work for every kind of source, but again, input is one of my main problems right now.--Lon-ami (talk) 19:57, 18 November 2010 (UTC)
 * Accepting both abbreviations and full book names would be a reasonable choice. In addition, because it is likely that the template would not be edited immediately upon appearance of new books, it should treat unknown titles as valid anyway -- link to "Lulz, page 42" if that's what the user gives you :) &mdash; foxlit (talk) 22:43, 18 November 2010 (UTC)