Forgotten Realms Wiki
Advertisement
Forgotten Realms Wiki
Forums: Helping Hand > New infobox scheme

Use the following template for a nicely presented post:

{{Forum post|Write your message here!|~~~~}}

You may or may not have noticed that Wikia is pushing out a new scheme for creating infoboxes that are portable and look better on mobile devices. I have no idea how many of our users access FRW on their mobile devices, but Wikia says the rise in usage is quite dramatic of late. So, they came up with this idea to make infoboxes more standard and "portable" between devices and to the next generation of interfaces (one of their developers has been quoted saying that wikis should be able to render on a washing machine). I read the (very long) forum discussion on it and decided to try it out with one of our infoboxes and present it to the community for feedback. It is important to note that this change is optional, but also that the old style wiki markup for infoboxes is quirky and held together by bubble gum and bailing wire. I have no idea how long it will continue to work; probably a long time, but eventually technology will leave it behind. So without further ado, allow me to present some visual aids:

Visual Aids

  • Click here to see the old {{Item}} infobox with all parameters filled out.
  • Click here to see the new infobox style of the same data. If you open it in a new tab, you can flick back and forth to see the differences. NOTE: I modified the infobox slightly to show off one of its features: the horizontal layout. This is why the 1st Edition Statistics block looks completely different between old and new. I chose it because it had only two values to display and it demonstrates something that I believe was desired by at least one of our users (but can't remember who). Don't get too excited, if you use this for more than one row of data, the alignment of the columns becomes an issue (I think).
  • Click here to see a random member of Category:Items displayed using both styles side-by-side. Click the "Re-roll" link to generate a new random selection. NOTE: the new infobox code is not 100% compatible with the scripting language I used to create this demo, so you will notice things in the OLD box that are missing in the NEW box, namely, citations and anything after a <br /> tag. Citations leave a string of garbage in the output so I had to strip them out, which is why anything after a "<" symbol is missing. This is a problem with my scripting and not the new infobox scheme, which works just fine, as you can see in the Longsword examples.

Some Observations

  1. You might need to update your browser to see the correct formatting. I'm not sure what browsers are supported by this new code. They use some CSS I've never seen before, but it works in Windows 10 on Firefox 40.
  2. Not all Category:Items use the Item template, so you might find a few random pages that do not display two infoboxes side-by-side. Just hit Re-roll.
  3. You don't have to learn anything about these new infoboxes unless you want to create one. You will use them in the same manner as you have always done, i.e., cut and paste the blank template from the doc page and fill out the fields.
  4. It took me a good part of a day to get the CSS working to make the default infobox look like our old infobox, and it's not perfect. Modifying the way it looks will be heavily dependent on CSS which I think only admins can modify on a wiki. This means non-admins can move fields around but cannot alter the look (colors, sizes, margins, etc.). This is probably a good thing considering how much damage you can do to an entire wiki if you can edit the Common.CSS file, but it does limit how much freedom non-admins have to customize things for themselves.
  5. With a few minor adjustments, I got it to work in he monobook skin also. Append "?useskin=monobook" to any wiki URL to see what the page looks like in Monobook. Append "?useskin=wikiamobile" to see how it looks on a mobile device. Be forewarned, the new infobox takes up the full width of the preview box with the mobile skin.
  6. If an image is wider than it is tall, then the new infobox renders it without any border, so it fills to the edges of the infobox, making the image look bigger (and it is). If the image is taller than it is wide, then it fits it vertically into the box and sometimes that appears smaller than the old way.
  7. Tabbers are reported to work with the new infoboxes, but I haven't tried one yet.
  8. The width of the left and right columns is computed by black magic as far as I can tell. If your label (left column) is too long, it might disappear behind the right column. Let me know if you find a page where this is a problem.
  9. I added a slight tint to the background of the image caption, because I thought it needed it. I think the new way will uniformly make all captions (for all uses of {{Item}}) italicized, regardless of the input, but I haven't investigated it yet.
  10. The new infobox includes a way to use a switchable theme, so the {{Spell}} and {{Creature}} templates can still change color schemes if they wish. We'll know if it works if/when I try to convert them.
  11. The new infobox is slightly thinner and slightly longer than the old one for the same data (but not always, see #4). I could probably squash it some more if there is a demand.
  12. The new scheme may break some of the fancy scripting that I've used here and there, but since it is optional, we can keep the old stuff for as long as possible or until it gets rewritten.

Under the Hood

If you are interested in writing an infobox template, here are some things to look at and compare:

  • Click here to see the new infobox template code in all its glory. Note that there is very little wiki markup necessary, at least for this one.
  • Compare that to the old infobox.
  • If you can view it, the Special:CSS page shows all the CSS classes I had to alter and override to get it to look like our original infobox. Scroll down to the bottom of the page.
  • To see the heavily modified (kluged) template that I used to generate the side-by-side comparison, click here. The calling function is here.

Questions

So what do you think of the new infobox? Are there specific things you would like to see tweaked? Would you rather stick with the old format? Is it good enough to roll out to the users? Do you care about mobile devices?

Moviesign (talk) 05:09, August 24, 2015 (UTC)


I use my pad to look at the wiki sometimes, though not for anything serious, and it's too small to work on. I'm logged in and on Monobook there too, so I don't see anything different from what I do at a PC. But I can see how it would be useful to ordinary non-accounted users in tabletop gaming, etc., and the mobile skin has always looked shitty, so any improvement is worthwhile.

I prefer the old-style infobox, but then, I dislike change at the best of times, so eh. It looks better in the Mobile skin at least.

Shouldn't the image be fixed to the specified size? Most are set at 250 pixels (the max size of the old infobox, and this should stay as a grandfathered default). I'd hope that image size can be specified and kept constant in the new infobox. Automatically shrinking or blowing up the image will appear very untidy across different pages, and very small images will look awful if expanded like this.

— BadCatMan (talk) 08:06, August 24, 2015 (UTC)


I can keep tweaking the CSS to get it closer to the original look, but what specifically do you not like? What should I try to duplicate? (Or were you referring to the wiki markup way of doing infoboxes, as opposed to the new way? Is your objection cosmetic or functional?)

I tried putting in a really huge image (File:Map - Faerun - 3E.jpg) and a really small image (File:AL-Qadim Expert.png) and the new infobox took both in stride. It did not stretch the smaller image to fit the box. On the other hand, I'm not sure we could make it bigger even if we wanted to, without going into the CSS to do it. The "active viewing area" seems to be a few pixels wider in the new box, which is why images seem a bit bigger (subject to the H vs W note I made above).

Moviesign (talk) 17:21, August 24, 2015 (UTC)


Just minor cosmetic preferences. I prefer the font on the old infobox; the latter reminds me of Apple MacIntosh. The white gaps between boxes are also just nicer, so things aren't glued together. But that's pretty minor, and I don't know what the current thinking on web design is.
— BadCatMan (talk) 08:01, August 25, 2015 (UTC)


It's our style, we can make it look how we want, it's just a matter of effort. The font should be easy, I'm surprised I didn't do that already. I'll play with it as soon as I get some time, probably later today.
Moviesign (talk) 13:32, August 25, 2015 (UTC)


Okay, I looked at the fonts and they are supposedly the same in both old and new infoboxes. I checked Monobook and they were also the same (but specified differently than the Oasis skin), so I'm not seeing a difference in font style between the two, only a slight size difference. I'll fiddle with the white gaps next.
Moviesign (talk) 00:13, August 26, 2015 (UTC)


White gaps are back!
Moviesign (talk) 01:34, August 26, 2015 (UTC)


Great work guys! I returned after nearly 2 years of absence and i like how you keep up with editing and organizing this wikia and with keeping up with some important quides - changes in the whole wikia. I don't have a problem with this new infobox, not that i have checked it throughtoutly. I just feel like the size of the fonts is slightly smaller...
Jandor (talk) 16:45, August 26, 2015 (UTC)
Update: The visual is different for mobiles, I just watched your example pages of old and new infoboxes in my smartphone. Don't know which is better, do you want me to upload any screenshots? If not, try to watch them through a mobile phone
Jandor (talk) 18:21, August 26, 2015 (UTC)


Wikia makes the new infoboxes take up the whole screen when viewed on a mobile device I think. I can see it when I use the Mobile Preview button in the editor. I wouldn't worry about screen shots, it is what it is and we don't have much control over it, except to use the new infobox scheme.

Moviesign (talk) 19:35, August 26, 2015 (UTC)


Font: Okay, it might just be an artefact of the increased font size. Okay. It's looking fine now with those white gaps.

I checked on an actual mobile device – well, my Android pad – and the new infobox is much better than the old. Well, anything's better than the old mobile-skin infobox, so eh. But logging out only showed me the Oasis skin in the Android browser, so I imagine anything pad- or tablet-sized will work like a desktop PC as far as wiki skins go for anonymous users. Actual mobiles or Apple devices might work differently.

In the mobile skin, the image is resized to its maximum horizontal width to fit the orientation of the screen. On a vertical screen, the longsword image looks fine. But on a horizontal image, it's blown up huge, the low resolution is revealed, and the bottom is cut off, as it is actually bigger than the page can show until the infobox is shown in full. It also seems to distort the page when the infobox is shrunk again. The image weirdness is my biggest concern with the new infobox. The image shouldn't be blown up past its size or the borders of the screen. But maybe that depends on Wikia people.

Jandor: Welcome back!
— BadCatMan (talk) 12:44, August 27, 2015 (UTC)


If there is no further discussion, I'm going to roll this infobox out to the wiki. Please notify me of any problems you find.
Moviesign (talk) 16:17, August 29, 2015 (UTC)


Well, a problem has arisen that may require heavy use of a bot. Images are not showing up on pages that use an [[Image:]] link instead of a [[File:]] link for the image parameter in the infobox. I'm not sure why this is yet, I'm waiting to hear an official response to my forum post at Community Central. I will let you folks know as soon as I do.
Moviesign (talk) 01:30, September 8, 2015 (UTC)


Ah. Okay. I can fix that with the bot. Just let me know when and the details, perhaps at User talk:UnseenServantBot.
— BadCatMan (talk) 08:51, September 8, 2015 (UTC)


Good news! The Powers That Be have been listening and I believe a fix for the problem will happen on Thursday (2015-09-10). I would hold off on firing up the bots until after we see if that takes care of everything. Apparently the [[Image:]] tag is deprecated but still supported, so they just have to add it to their filter and Images will come through like Files do now. Please stand by for further developments.

Moviesign (talk) 17:36, September 8, 2015 (UTC)


Ahhh, so this is the reason for the vanishing images... thanks, Movie :)

Darkwynters (talk) 02:08, September 9, 2015 (UTC)


Okay. If it is deprecating, then we should update the Image/File thing anyway, for further future-proofing.

But it's an annoying problem for another reason: clicking on the image in the updated template will bring up a full-page image, not the details page for the image. For example, for the {{Book}} template at "Summer in the City", clicking on the image will show only the expanded image, not File:ADDcomic33.jpg. For the {{Item}} template at Ilbratha, clicking the image shows the full image, not File:Ilbratha-Dragon407.jpg. Instead, you need to edit the page, copy the filename, and search for File:filename. That's very inconvenient when trying to view or update image details.

— BadCatMan (talk) 10:06, September 9, 2015 (UTC)


I don't see that behavior. When I click on the image, a pop-up appears with a larger version of the image, links in the upper right corner to File:ADDcomic33.jpg, "See full sized image", and "Added by User:BadCatMan posted in Summer in the City". Down at the bottom is a scrolling list of thumbnails for adjacent images (most of which are the stupid videos that show up in the right rail in the Oasis skin, but that's another matter). This is the way it has always been for me, at least for that past couple years. Apparently the behavior you are seeing only happens in Monobook. Let me investigate a way to fix this. There is a tag that might do it.
Moviesign (talk) 12:47, September 9, 2015 (UTC)


Ah, makes sense, because Oasis does that pop-up image thing. Changing my skin to Oasis shows it working the normal way. Unfortunately, Wikia's now lost my widget for switching between skins. I suppose I should get used to Monobook being increasingly forgotten and unsupported. Except it's the basic mechanic behind the system, and is so much cleaner and easier to use. :(
— BadCatMan (talk) 13:15, September 9, 2015 (UTC)


In case you hadn't noticed, Images are back in the Book and Item pages. Thanks Wikia Team!
Moviesign (talk) 18:20, September 10, 2015 (UTC)


Hey BadCat! I have something I think you will love. It works for me when I look at pages in Monobook, so I'm hoping it will work for you. You will have to enable your personal JavaScript by going to Special:Preferences, click the "Under the Hood" tab, and check the box next to "Enable personal JavaScript". Then you need to add the following to your User:BadCatMan/common.js file:
var portbox = document.getElementsByClassName("portable-infobox");
if (portbox.length > 0) {
    var list = portbox[0].getElementsByTagName("FIGURE");
    var i;
    for (i = 0; i < list.length; i++) {
        list[i].className += " article-thumb show-info-icon";
        var img = list[i].getElementsByTagName("IMG")[0];
        img.className += " thumbimage";
        var node = document.createElement("A");
        node.href = "/wiki/File:" + img.getAttribute("data-image-name");
        node.className = "sprite info-icon";
        if (list[i].getElementsByTagName("FIGCAPTION").length <= 0) {
            list[i].appendChild(document.createElement("FIGCAPTION"));
        }
        list[i].getElementsByTagName("FIGCAPTION")[0].appendChild(node);
    }
}

and the following to your User:BadCatMan/monobook.css file:

.sprite.info-icon{
    background-position:-1227px 0;
    height:18px;
    width:18px;
}
 
.sprite{
    background-color:transparent;
    background-image:url(http://slot1.images.wikia.nocookie.net/__cb1441875458/common/skins/shared/images/sprite.png);
    background-repeat:no-repeat
}
 
.article-thumb.show-info-icon .info-icon {
    margin-right: 0;
}

Once you do this, images that are contained in the new portable infoboxes will have an "info icon" (an i inside a circle) that appears in the lower right corner of the image when you hover your mouse over it. Click the icon and voila, you are taken to the File: page for that image. Does that give you back the capability you lost? This is a mashup of old techniques that I hope will continue to be supported. My code is probably held together by bubble gum and bailing wire, but it works! Try it out and let me know if you have any problems.

Moviesign (talk) 02:20, September 11, 2015 (UTC)


It was so faint I missed it at first, but it works perfectly. Fantastic! Thank you so much! And Wikia's returned my skin-switching tabs, awesome.
— BadCatMan (talk) 06:17, September 11, 2015 (UTC)


I'm guessing that your skin-switching tabs were turned off because your personal JavaScript was turned off. They did this Wikia-wide as a security precaution, forcing people to opt-in. Glad to hear it works :)
Moviesign (talk) 13:08, September 11, 2015 (UTC)


Ah. I don't pay much attention to what goes on with Wikia, unfortunately. Doing spells today, I noticed that, while we've updated many of our infoboxes to have tabs for each edition, our {{Spell}} template still has the edition information arranged sequentially. We're argued for it at the time of the last development, but that was before tabs came in. Do you want to update this as well, alongside the new scheme?
— BadCatMan (talk) 09:42, September 12, 2015 (UTC)


Neither do I, which is why I didn't hear about Image: being deprecated. I'm trying to keep abreast of this portable infobox thing, however. Tabbers don't work in them yet (at least for images) but they say it's coming.

I like seeing all edition info at once, so I vote no. {{Spell}} is one of our more complex infoboxes and will be one of the last to be converted, so we have plenty of time to decide.

Moviesign (talk) 11:43, September 12, 2015 (UTC)


I'm seeing something odd in the new {{Item}} template – images in the infoboxes are being pushed to the left. See Tome of Torment, Ilbratha, Sarghathuld, and Quiver of plenty. However, some, like Death Moon Orb and Thakorsil's Seat are fine. It occurs in both Monobook and Oasis skins. I think if the image is set to a size less than 250 pixels, it's being pushed to the left rather than centred.
— BadCatMan (talk) 11:33, September 23, 2015 (UTC)


All those pages have perfectly centered images when I view them in Oasis or Monobook. Maybe try a different browser to see if that's the problem. It might also be a CSS conflict, if you have a personal CSS file.
Moviesign (talk) 14:32, September 23, 2015 (UTC)


This is primarily for User:Terrorblades, but if you find a page that uses an infobox and the image is missing, it could be because of the change noted above (in which case, just purge the page) or it's because <tabber> is not yet supported by the new infobox style. I have delayed converting some of our most-used infoboxes because it would break a number of pages that use <tabber>. They say support is coming, but I have no idea how soon. I suspect we are going to have to oil up the bots and make some sweeping changes when some of the few remaining infoboxes are converted. Stay tuned; I will try to coordinate changes with a time that is convenient for our bot operators so we minimize the duration that dozens of our pages are broken.
Moviesign (talk) 02:19, October 3, 2015 (UTC)


I got back and checked the image alignment problem – it occurs in three different browsers, but only when I'm logged in as BadCatMan. My UnseenServantBot is unafflicted. I'm not sure I have a personal CSS file (not least because I'm not certain what that is; my website training didn't extend that far). Ah, it's my personal JavaScript for Monobook hacks; with personal JavaScript switched off, the images appear centred. I'll just have to live with it like the Monobook diehard I am. :)

Okay, let me know when you want me to put UnseenServantBot to work and the changes to make. There's also User:Jandor's StoneGolemBot.

If I can automate it (and trust it do the right thing!), I can run it any time, which is easier with simple changes. Semi-automated and manual changes are more time-consuming (though faster than editing directly through the webpages). We can discuss time-zones and hours if it comes to it.
— BadCatMan (talk) 12:28, October 3, 2015 (UTC)


Wikia has released <tabber> and <gallery> support for images inside the new infoboxes. However, it does not work in monobook. I've been waiting for this to be released before converting the rest of our infoboxes, but since monobook is not yet supported (no clue if it will be) I'd like to hear what people think before I go and make sweeping changes.

As a separate issue, the style of the tabber is completely different than a normal tabber outside an infobox. I have kludged up some CSS to make it look like the original style, so I'd like to hear opinions on that also. See this demo page for examples. Yes, I know Orc is not a class, it was just a convenient cut and paste.

Moviesign (talk) 20:35, November 4, 2015 (UTC)


I prefer the existing tab style (of course), which makes Monobook's own tabs. I like what you did to recreate it, but it only works in Oasis, not Monobook for me. I just see some bland squares. I guess that's to be expected? At this point, I'm not sure there can be victory for us Monobook users, so, shrug. BTW, for some reason, in Monobook, this very forum page has some strangely distorted formatting: the margins and panels are one, two steps smaller in font and size, while the top tabs are disconnected and floating away. It's been doing it for a while. I guess it's a weird by-product of some code on this page.
— BadCatMan (talk) 12:44, November 7, 2015 (UTC)
Advertisement