User talk:WardPhoenix

From GodWiki
Revision as of 20:59, 20 April 2019 by FeRDNYC (talk | contribs) (→‎Navbox formatting: new section)
Jump to navigation Jump to search

This is a talk page. Maybe. Or not. Don't know. Leaving this just in case : GodWardPhoenix (U • C • T) 

This page has an archive

Old and/or inactive discussions have been moved to the /Archive subpage.

Leave a note for me there

Navbox formatting

Hey, {{Navbox pets}} is a great idea! How did we not think of that sooner?

I made a couple of changes to the code, just wanted to fill you in on them.

  1. Group names (especially if they're wide or nested) tend to be a problem on mobile, since they end up eating all of the available width of the table. I realized with {{Navbox JanuWiki 2019}} that it made more sense to use the |above=title parameter with {{Navbox subgroup}}, and create a separate row for the heading, instead of burning up width. So, I made the same change at {{Navbox pets}}. See what you think. (I'm questioning whether the "Normal" is even really necessary, or just implied...)

  2. You DEFINITELY want to use {{Navbox items}}, instead of {{Navbox list}}, when building infoboxes. {{Navbox list}} was Djonni's first version of the template, and we addressed a lot of its shortcomings with the replacement {{Navbox items}}. (The documentation unfortunately didn't all get updated to reflect that change.) Our plan, way back when, was to go through and replace all of the {{Navbox list}} transclusions with {{Navbox items}}, and then deprecate that template. Unfortunately that never got done either.

    The biggest advantage to {{Navbox items}} is that it'll autolink the parameters for you (unless you turn that off with |mode=nolink), so for example this:

    {{Navbox list| [[Ballpoint Penguin]] || [[Biowolf]] || [[Bipolar Bear]] | [[Crypt Creeper]] | [[Dreaded Gazebo]] | [[Dust Bunny]] | [[Firefox]] | [[Hyper Lynx]] | [[Lightsaber-Toothed Tiger]] | [[Ninja Tortoise]] | [[Rocky Raccoon]] | [[Santa Claws]] | [[Satan Claus]] | [[Significant Otter]] | [[Sun Dog]] | [[Talking Donkey]] | [[Terror Bull]] | [[Vogon Poet]] | }}
    becomes this:
    {{Navbox items| Ballpoint Penguin || Biowolf || Bipolar Bear | Crypt Creeper | Dreaded Gazebo | Dust Bunny | Firefox | Hyper Lynx | Lightsaber-Toothed Tiger | Ninja Tortoise | Rocky Raccoon | Santa Claws | Satan Claus | Significant Otter | Sun Dog | Talking Donkey | Terror Bull | Vogon Poet | }}

    The other advantage is that {{Navbox items}} by default allows the items to be word-wrapped, which (again, for mobile) tends to be better since it means less space is wasted. That can also be turned off if needed with |wrap=no.

Anyway, I pulled the code into an editor and converted all of the lists to {{Navbox items}} with a quick regexp to drop the square brackets. -- FeRDNYC (talk) 20:59, 20 April 2019 (UTC)