My Little Pony Friendship is Magic Wiki
Advertisement
Forums: Index > Wiki discussion > Appearances template

I told you I love working on templates. I have created in my userspace Template:Appearances as well as a utility subpage Template:Appearances/Apps (and the documentation). This will reduce as much as possible the amount of code and repetition in appearance lists, especially as the number of season increases, and hopefully make it easier to use. I can update the template for new seasons and if space for more characters is needed. A demonstration of this template in both types can be seen at my sandbox. Let me know if anything needs to be changed; otherwise, as the template is fully operational, if I have approval I will move it to the template namespace and can begin converting old code to it. Anyone can help with that if they so desire. Thanks, ~Bobogoobo (talk new) | 02:33, June 25, 2012

I'm not sure how this is significantly different from or easier to use than what we have now... other than the old "templates in a template make the visual editor go kablooey" problem, which is not exactly a positive. --Tulipclaymore 03:01, June 25, 2012 (UTC)
It's about a third of the code, so it's neater, and it's harder to mess up. Having to copy table code like that can be difficult, I like to have templates instead. I've never encountered that problem, I guess most people have enough sense not to use visual editor? I doubt people using it would be editing stuff like that anyway. ~Bobogoobo (talk new) | 03:14, June 25, 2012
You're wrong, unfortunately. Lots of people use the visual editor, particularly young and inexperienced ones. If you put one such complex template on a page, the entire page is rendered incompatible with the visual editor unless people edit section-by-section. Such a situation should be avoided if at all possible, and your template isn't enough of an improvement to warrant an exception. I'm not opposed to utilising templates for these tables at all (changing only a central template page is certainly easier than having to change twenty individual tables every time a new episode title is announced), but it needs to be easier to use and more accessible. List of ponies and its sublists are hideously complex under the hood, but we still manage to make it viewable (and most of its elements editable) in visual mode. --Tulipclaymore 04:16, June 25, 2012 (UTC)
Okay. I never heard about this problem on the other wiki I edit on, strangely. I guess there's nothing to be done, then, unless we wanted to maintain a central page that would use a switch to display each character's appearances based on the pagename (that would make the character appearances page more efficient, at least), or put the template call on a subpage of each page and transclude that. Still, that seems easier than having to change every single page every time there's a new season/episode/whatever, especially when more pages use the appearances table. Okay, to figure this out, I need to know the limitations of visual mode. Is it only nested templates (transclusions) that break it, or would a template within a parser function break it as well? And is there anything else? A template within a parser function seems like it should work. If so, maybe I could put together a demo of that central page idea, because I think that could work just as well as the thing I just set up. Sigh, I just want to make a template and make things efficient, Wikia breaking their own stuff does not make this easy. :( ~Bobogoobo (talk new) | 04:44, June 25, 2012
If the issue is just updating the charts with new episodes, that can be done easily with a bot. I really wish the visual editor supported templates better. What would really be neat is side-by-side code and rendering windows so when you hit "preview" it refreshes the rendered page while the code view is still available, instead of in a pop-up that stops you from editing. I should put in a feature request. –Throwawaytv 06:39, June 25, 2012 (UTC)
Doing it with a bot is what I did last season (and will probably do next season) with the background pony tables. For the less elaborate tables, that is of course also a possibility, but doing it with a single template would be more elegant. --Tulipclaymore 15:14, June 25, 2012 (UTC)
The wikia software is very inconsistent when it comes to what it does and doesn't consider complex code. Putting Template A on a page and Template B inside Template A when it is already on the page breaks editing; combining the two on the Template namespace and putting the combined Template A+B on a page is fine, however. So transcluding sections of a master page would probably work, but isn't my idea of elegant or accessible. What may work better would be one template with one row per season which is editable in visual mode, can recognise the input in each individual cell, and change the background colour of any given cell according to that input. It's possible ({{PonyComparison}} has partially the same concept), but annoying to code what with the constant switching I imagine would be required for 5 different kinds of input and the added difficulty of mouse-over text. --Tulipclaymore 15:14, June 25, 2012 (UTC)

Okay, here's attempt #2. This is compatible with visual mode when editing pages that use this. You can see the syntax and comparison of old vs. new in my sandbox here. This will suffice for the main purpose, which is a single central source that transcludes most of the code and all the episode names and everything for these appearances lists; that is at the template currently in my sandbox here. The latter can't be edited in visual mode, but I assume most or all people of authority here use source mode, and those are the people who would be trusted to update something like that anyway. Also, this works the same way on Character appearances, but I can't show a demo because it uses the {{PAGENAME}} variable. Hopefully this time, this will be 100% beneficial over the current method. With approval, I can go convert pages to it, but of course I'll wait for any concerns there might be. Also, let me know if you have any other ideas for templates, and I'll see what I can do with consideration for the visual editor. ~Bobogoobo (talk new) | 04:11, June 27, 2012

Well, it solves the episode title issue and the visual editor issue (at least for article pages). I would still prefer a single template because it would be more user-friendly, but this will have to do. I would get rid of the "See also: Character appearances", though, because not all characters with these mini tables are actually represented on the big page; it can be added manually where applicable. --Tulipclaymore 17:02, June 28, 2012 (UTC)
Done, thanks for pointing that out. What do you mean by preferring a single template? Anything more efficient than this would break the visual editor, I'm pretty sure :/ Also I had an idea to make it a little cleaner, I could automatically add the table close code for any season after the first, so that it would only need to be used once at the end of each appearances section. The only problem is that this would break in the event that a single season after the first is displayed alone - is that likely to happen? ~Bobogoobo (talk new) | 23:54, June 28, 2012
Not likely, but theoretically possible with characters introduced in season 2 and utilised more frequently in season 3. Though I suppose a row full of N's would avert that. Regarding the single template, I described something like it upthread (15:14, June 25). --Tulipclaymore 00:35, June 29, 2012 (UTC)
Okay, well I added it with a way to make it not auto-close (I'll include that in the documentation if this thing gets approved). Also, tested this in preview on the character appearances page and it works. That description sounds pretty complicated, haha. I'm not entirely sure what you mean by it, though; could you map out some kind of flowchart-type thing or something? ~Bobogoobo (talk new) | 01:26, June 29, 2012
Advertisement