Forums:Yew Grove > Condensing Infoboxes with Switch Template
This page or section is an archive. Please do not edit the contents of this page. This thread was archived on 30 July 2012 by Thebrains222.
Some of our articles, particularly monsters and NPCs, have tons of information that we try to force into one infobox.
Let's take Bolrie for an NPC example. It appears he has three stages - young during cutscenes, old in prison, and old after all the gnome quests involving him are completed. For this, we have multiple images, multiple examine texts, the multiple quests he's involved in should be mentioned, and he should have multiple locations listed. Obviously we've not done a good job cramming this all into one infobox. The infobox is almost as long as the page itself when viewing the page as an IP.
The spiritual warrior page is a good example for monsters. For whatever reason, we have one article for all the different types of spiritual warriors (I guess they have the same drops). To make up for this, our infobox suffers by listing all the combat levels, LPs, slayer xp, attack styles, max hits, weaknesses, examines... *Facepalm*. Don't even get me started on the images.
I've come across several wikis which make use of the Switch template for infobox use. In this example, the switch coding is used to allow people to change between the pre-timeskip and post-timeskip pictures, with the post-timeskip being the selected default. If we incorporate the use of this template into our infoboxes, we won't have these endless discussions over the messiness of articles of creatures with lots of information. We could provide all information into one neat little infobox that has some sort of tabs at the top which allow people to switch between, say, human-form and mahjarrat-form(s); pre-quest, during-quest and post-quest; tiers, etc.
As this would be a big change to the way our infoboxes and spoiler information work, I decided to take it to the YG (also I'm no coding genius, so it'd be great if some mockups were discussed). (: 06:09, June 24, 2012 (UTC)
Partial support - To start with a notice, we can also use the tabber, which has easier coding (images page in my signature is an example and no, it is not laggy). But when only infoboxes are significantly different, e.g. GWD monsters-non-GWD versions, I'd gladly see this. Ali and Wahisietel should remain split though, even if only because people may want to seek information on Wahisietel through, say, the Mahjarrat navbox, and be redirected to Ali the Wise, thinking "what the hell" (even if they don't care about spoilers) before noticing the little click thingy at the top of the infobox. But yes, for things like Bolrie and turoths and ESPECIALLY articles like Sir Bedivere and other Camelot knights, this should be implemented. Fswe1Lore project•Fun gallery My quests•Cutscenes 07:02, June 24, 2012 (UTC)
Note about the tabber, in case people think tabber loads slowly because of Fswe's page, the tabber doesn't show up as long as there are still images within that haven't fully loaded yet. Because Fswe uses tabber to store lots of images within, this makes the tabber show up after every single image on the page has loaded, which might take a while. For normal pages, this shouldn't be such a big problem and tabber is indeed a possibility. The switch template is still better in my opinion though. JOEYTJE50TALK 11:59, June 24, 2012 (UTC)
That's why you put "Ali the Wise, also known as Wah-whatever" in the first sentence. Problem solved. 16:07, June 24, 2012 (UTC)
Which'd leave them wondering where the information on Wahisietel is. Moreover, removing spoiler alerts is one thing, knowingly and purposefully throwing them in the face is just wrong. (metaphor: removing the DANGER! warnings from a mine field is fine, but that'd be deliberately placing a mine at the entrance) Fswe1Lore project•Fun gallery My quests•Cutscenes 16:14, June 24, 2012 (UTC)
This discussion is not about spoilers, it's about condensing infoboxes. Since Ali & Wah are on the same page, they would benefit in being in one infobox, and it would also help reduce the "messiness" of the article as argued in RuneScape:Requests for splitting/Ali the Wise 2. 16:34, June 24, 2012 (UTC)
Support - Although I'd like to add that this is probably unnecessary for inventory sprites in infoboxes. Never have I seen a case where it looks cluttered enough to warrant this (I know it wasn't put in the proposal, but I wanted to put it out there). Cåm09:08,24/6/2012 (UTC)
You want a separate infobox for each inventory sprite there? O_o Them being small icons, the current situation is still better than having even one NPC image in there. Fswe1Lore project•Fun gallery My quests•Cutscenes 15:39, June 24, 2012 (UTC)
I was thinking separate boxes for each color. Have the chathead, inventory image and NPC image all in one box. I didn't put it up in the examples because I wasn't sure how good it'd look. But anyway, that'd fix the issue. 16:06, June 24, 2012 (UTC)
Support - I'm trying to make a mockup of it now. MattTalk 09:15, June 24, 2012 (UTC)
Support - The switch template seems to be a superior idea to any tabber or whatnot. Just make sure that the page really needs the coding. 222talk 12:14, June 24, 2012 (UTC)
Support - This would make pages a bit more organized from what I see. --SpineTalk 16:47, June 24, 2012 (UTC)
(Strong) Support - I think this is a very elegant solution for a messy problem. And in a similar way, I think it may also be used in this discussion: Forum:Suggested_gear . Yours, . AddictEnkidu Talk . 17:32, June 24, 2012 (UTC)
Another use - Perhaps it can also be of use with these pages Dyed brown d'hide blessed set where there are three noteworthy images on the page. A characters wearing the full set (1 male, 1 female) and an image of the 'whole set' in the box that you can buy at the G.E. There might be a forth option, too, the individual items. They could all be shown in the Template:Infobox item on the right. . Yours, . AddictEnkidu Talk . 19:44, June 24, 2012 (UTC)
Strong Support - These infoboxes have been chaotic for far too long. — Enigma 20:17, June 25, 2012 (UTC)
Comment - Kay, mockup time. The template's at User:Matthew2602/Sandbox/b, and the js behind it is at User:Matthew2602/wikia.js. You can import it to use the template yourself by adding importScript('User:Matthew2602/wikia.js') to your wikia.js/monobook,js. The template supports up to 10 different options to switch between, though that number is not hard to change. The parameters it supports are as follows:
The item parameters define the actual content that will be switched, and the text parameters define what will appear on the buttons used to switch to that content. The type parameter is used to optimise the template for a particular application. Right now, the only value it supports is "infobox", which will put the buttons under the name of the item/monster/whatever, but above the actual infobox table. It should be compatible with most infoboxes. If a type parameter is not specified, the buttons just flow in the page as if they were normal text.
The template appears as a single button that just says "Loading..." until the elements that the script depends on load, then it disappears to reveal the buttons and the content. The first item will display by default.
A good proof of concept of this is at User:Matthew2602/Sandbox/a. I took one of the articles Fergie talked about above and redid the infobox to use the template.
Each use of the template has to have an id parameter, a number anywhere from 0 to 25, to stop it conflicting with other switch templates on the page. The id has to be unique relative to the page -- You can't have two templates with the same id. If the id parameter is not defined, it defaults to 0. This is fine for just one on a page, it's fine for more. It just means you can't not define the id parameter on any of the other templates, nor can you give them an id of 0. The limit of which the id's go up to (ie. 25) is very very easy to change. An example of how id's enable you to use multiple templates on the same page is at User:Matthew2602/Sandbox
In case you haven't noticed yet, I've designed this to not just be used for infoboxes. I think there's real potential in having a universally applicable switch template like this, that can switch out any content. I'm all ears for suggestions for changes to the template and the code or whatever.
And yes, I am aware there is a large gap under the buttons when they are put in an infobox. There are still some kinks to iron out. This is just a rough draft.
I know what you're saying. "But Matthew! I don't wanted to switch a whole infobox! I just want to change the content of one parameter!". In that case, instead of encompassing the whole infobox with the template, you can just put it in the parameter you want to switch, as seen [[User:Matthew2602/Sandbox/c|here]]. The template doesn't currently support chaining together multiple switch templates with the same id's and switching them with one set of buttons, but I could probably do that if people are interested.
Or you can just use tabber. MattTalk 23:28, June 26, 2012 (UTC)
Honestly, if a discussion involves javascript that doesn't affect any existent features, just add it to the common.js – it's far less complicated and can always be removed -- 17:08, June 27, 2012 (UTC)
The code is being loaded sitewide for autoconfirmed users while this discussion is ongoing, like Henney suggested. You can go to User:Matthew2602/Sandbox, or just use the template to the side of this to try it out for yourself. User:Matthew2602/Sandbox/a shows what using it would be like in an actual article.
I think those are all the points I wanted to cover. Anyways, I think this script is pretty much ready to go. It just needs the consensus. Leave any suggestions you have for it below, and if you find a bug, please point it out. .-.
Come on guys, don't let this thread die pls MattTalk 08:29, July 10, 2012 (UTC)
Support - Looks kewl. Haidro(talk) 08:36, July 10, 2012 (UTC)
Support - Looks better, although the infobox contains alot of information, so maybe you could come up with a way to highlight the data that changes between two tabs. This avoids the situation where the user has to look back and forth to check each and every detail. Otherwise, good job! --Alchez 10:40, July 11, 2012 (UTC)
Comment - The buttons looks awful, I would prefer if it looked like tabs instead that was connected to the box. Also use the same background color of the infobox when you are currently on that tab and a darker one for the other tabs. TyiloTalk 23:54, July 16, 2012 (UTC)
Comment - I agree with Tyilo, tabs that are connected to the box would look better. Assuming they are of similar design and colour. 222talk 07:11, July 17, 2012 (UTC)
Suggestion - Would is be possible to combine different infoboxes into a switch-thing? For example, Vanstrom has a monster and an NPC infobox, could those be stuffed together? Fswe1Lore project•Fun gallery My quests•Cutscenes 08:26, July 17, 2012 (UTC)
What about in terms of the rest of the article? I mean like having monster/strategy information as well as history and general NPC information... 18:09, July 19, 2012 (UTC)
Good point, it might confuse people to have monster information with a "hidden" infobox. This is where the tabber comes in handy... Fswe1Lore project•Fun gallery My quests•Cutscenes 05:53, July 20, 2012 (UTC)
From what I've seen/understand, tabber isn't really customizable. We could just use the switch template, which completely is. 07:29, July 20, 2012 (UTC)
Support - Support, though I would like to see what it would like attached to the box. —The preceding unsigned comment was added by Blaze fire12 (talk).
Support - Makes things much neater, assuming it works for everyone. Sentra246 11:15, July 21, 2012 (UTC)
Closed - There is consensus to implement the second proposal. Minor aesthetic changes can be discussed by the implementing editors. 222talk 11:33, July 30, 2012 (UTC)