Forum:Help with copying Wikipedia's ship infobox template

I'm an administrator at the Last Exile Wiki and I'm trying to make an infobox for the ships that appear in the show. I'm not good with templates and infoboxes, but Wikipedia's ship infobox is perfect for what I need. It's got all of the necessary parameters.

Now, I've copy/pasted Wikipedia's four ship infobox templates: Infobox ship begin, Infobox ship image, Infobox ship career, and Infobox ship characteristics to the wiki without changing their names.

Links to them on the wiki: Infobox ship begin, Infobox ship image, Infobox ship career, and Infobox ship characteristics.

The problem starts with Infobox ship career template. As soon as I start entering in information to go into the fields, the infobox freaks out. Infobox ship characteristics does this too. It starts displaying " " and "   " stuff.

Any help for figuring out why this freaks out is appreciated.

--TheBelgianGuy 19:24, November 1, 2011 (UTC)
 * Wikipedia's templates are hidiously complex, and it's probably better to design your own with the default Wikia one --  Random Time  19:26, November 1, 2011 (UTC)
 * Well, I need to learn how to make these things sometime. I'm just bummed because I got another template of theirs to work just fine.TheBelgianGuy 03:46, November 2, 2011 (UTC)


 * Do you have an example of the error? ForestMonthZero 04:31, November 2, 2011 (UTC)


 * Did you import all the relevant templates, CSS classes, etc? I notice that you're missing str find, str len , str left , str ≤ len , italics after . ForestMonthZero 04:43, November 2, 2011 (UTC)
 * Beside what forestmonthzero says, you are forgetting about two very important rule of thumb when using wikipedia information: Attribution (giving credits to the original creator) is a neccessity and using documentation is vital. You can do that in two ways:
 * - Export the page from wikipedia and import it on your wiki (find out how)
 * - Copy paste information from WikiPedia with using the comments to add an URL with timestamp to the moment you copied the template, and it's documentation. Do not forget to add a comment in the source stating your original source of the information.
 * You are violating the Terms of Use of both Wikia and Wikipedia if you are not attributing.
 * Beside that, Wikipedia is using a Page Protect template, WPMILHIST (=WikiPedia Military History) infobox style template, Ship image and ship caption template, and at the ship career template there are about 27 other templates in use not copied by you, which could hold other templates (also DO copy their documentation, and then you are likely to be needing to copy their documentation templates as well). It's not without reason above has been mentioned those templates used on wikipedia are quite extended and difficult to comprehend, because used and changed by very experienced long term wikipedia users over the course of sometimes years.


 * Wikipedia is very lax on histories of templates. Wikipedia frequently deletes template histories of templates that are merged, since they aren't "content". Though I think template code is under GFDL/CCbySA and not GPL on wikipedia.
 * Also, template documentation can start out on a talk page, so just importing the doc can be missing some documentation history, especially on old templates.
 * ForestMonthZero 10:42, November 5, 2011 (UTC)


 * Note as soon as you start copying the documentation from wikipedia the problem just gets worst. Wikipedias version of documentation runs to 10 + main templates. the p-protected group run to 30 + (just delete it as all it does is display an icon if the page is protected so its not needed) then when you start adding actual doc pages you get into needing all the Mbox suite of templates which runs to another 20 main templates etc. Its a like an iceberg - you only see the tip.


 * The simplest solution is to get a wikia compatible version of infobox (not the one you currently have or the standard 'starter wiki' one that uses different parameter names to wikipedia) Get the one that replicates wikipedia's version without all the complex sub templates & the same for Template:documentation, which hada simpler version built. Then build ontop of the Infobox template a new template called 'infobox ship' with the same input parameters as used in the wikipedia one (for compatability) without having all sub-the modules that they have added over time to wikipedias version. The code within the wikipedia one is prone to failure on here as it has a lot of HTML creating tables instead of just wiki code. (I have several templates were various  and   and similar appear within them in error after a number of people have tried to fix them). I managed to get som of wikipedia main meta template creators to help on a couple of them. Problems can be caused by just having a space in some of them in the wrong place !!


 * I originally copied the wikipedia infobox over & got into right tangle trying to get it to work, as at that time the two sites were not running the same version of mediawiki software. There are now several Wikia(fied) versions on various wikia wikis. The templates wiki has a number of 'simplified' templates that can replace the common wikipedia ones. New wikis come with some standard templates but this changes over time so which you have depends when the wiki was created.


 * Alternately Look around on wikia fora site with a template that looks like (visualy) what you want (the actual data subjects not important) then have alook at the template in edit mode & check how many templates it calls by clicking 'show all templates used' in the templates section on the right. If its long list - run. The names used for the inputs can be changed to suit on your wiki. The original infobox template on my wiki is Here (note it has been renamed to free up infobox) it used the format

Wikipedias version used header1, lable1 and dat1 etc - like this

See full example - here

a custom infobox is then created from it like -


 * The user places this in the page for the input


 * See template here - Infobox steam


 * This is fairly simple to construct & sits on top of Infobox but is easy to add new rows & headings to - But it lacks error checking and 'if - then' functionality. But Minimal coding skill is needed to update it. The catch with this version is it used wikipedias Infobox as the core - but any functional version of infobox will do just change the input parameters to match.


 * An alternative infobox method is used here as Infobox Event but the internal code is more complex - here but is similar to how the basic Infobox templat is built.


 * There are a 101 ways of building infoboxes but the main thing is how it looks in the article and ease of data entry for the users.


 * Can you point us to the page you are testing it on and Make a list of the headings and the data labels you actually need (wikipedia one is over long for the full list) & we can start one off for you. One could be built from your existing Character infobox by changing the data input names & row labels & headings. BTW were are you inputing your data to the ship templates as with no documentation page you have not got the input list part to copy into an article anyway ?


 * Others here may be able to fix the wikipedia version for you or suggest a more suitable alternative to build on from another wiki. I've added wikias version of Documentation template for you - (out of time to do more now) - 02:56, November 3, 2011 (UTC)


 * All right. This is what I've been able to do. Sorry about all the documentation legality but I wanted to get this working before adding documentation since it wasn't working.

I have created a test page with the infoboxes together as they would appear and function on Wikipedia. I've also added ship information as to how I'd like to see it on a ship page. This is the error. --TheBelgianGuy 19:42, November 3, 2011 (UTC)


 * It appears to be mixing wiki table and HTML table coding. I've noticed, for some reason, Wikia doesn't play nice when you mix HTML and wiki coded table parts... and also Wikia doesn't have the ( and ) templates... even though it has !... You might need to covert all the HTML table code into wikitablecode. ForestMonthZero 10:21, November 4, 2011 (UTC)


 * How would I go about doing that? --TheBelgianGuy 18:58, November 4, 2011 (UTC)


 * Well, you should copy ( and ) to your wiki for one thing. You should eliminate transclusions you don't need, like pp-semi, if you're not planning to implement Wikipedia's protection template scheme. To make things simpler, you should safesubst WPMILHIST Infobox style into your templates. That will eliminate some complexity. I would recommend that you place the $($| into your Infobox ship begin, since the way Wikipedia does that makes no sense. You should also create an Infobox ship end with the code |$)$ as its sole contents. This will make the code on your pages much cleaner (there's an obvious start and end, instead of wiki table coding hanging out in the middle of nowhere). After you've implemented ( and ), I can give more details. ForestMonthZero 11:28, November 5, 2011 (UTC)

All right. With the kind help of Bulldozer, the template now looks a lot better and actually works. Here it is in action: w:c:lastexile:User:TheBelgianGuy/Testingpage. The only problem now is that entries that are not used that sit between other entries that are used seem to increase the amount of white space. It might just be an optical illusion, but it looks like the spaces in between Complement, Armament, and Armor are not the same size. Thanks for all your help! --TheBelgianGuy 03:16, November 8, 2011 (UTC)


 * Congrats on getting a usable infobox, Ship Infobox. The problem seems to be the way Bulldozer is hiding the fields that aren't being used. They aren't displayed, but they seem to still have the rows being formatted in. The code is pretty clean the way it is, but if you move it the other way around, the code will be messier and harder to read, since you'll need to use ! in alot of places. ForestMonthZero 12:33, November 8, 2011 (UTC)


 * How would I go about adding the !? I've added the ! and !! templates to the wiki. --TheBelgianGuy 21:45, November 8, 2011 (UTC)


 * Well, you have code that looks like:

! style= |
 * - class="hiddenStructure" align=left valign=top
 * which hides the output, but still creates the row. It should instead hide the entire row, so you need to move the if-statement to hide the row.
 * like


 * which should reduce the amount of excess whitespace, but you'd need to redo every if-statement that way.
 * ForestMonthZero 08:21, November 9, 2011 (UTC)


 * There seems to be an error on your ship infobox documentation. There's extra &lt;/small&gt; on it... without matching &lt;small&gt; You should either add the missing small or delete the extra /small tags. ForestMonthZero 08:54, November 11, 2011 (UTC)


 * I noticed that error but didn't really care about it since I'm looking at my Testingpage. I replaced everything with the #if statements, copy/pasting what you wrote and just changing the names. It fixed the spacing issue between Complement, Armament, and Armor that I had noticed, but now there are large spaces in certain spots and I don't understand why. Thanks again for all your help! --TheBelgianGuy 18:04, November 11, 2011 (UTC)


 * The vertical spaces are caused by using lots of #if statements, but usually putting linebreaks before each one occurs.
 * Try changing to something like this whe you use #if:

 ! style= | Name Only add linebreak if "Japanese ship name" supplied -->&lt;!-- Only add linebreak if "Greek ship name" supplied -->
 * &lt;!-- Warning:- Name missing !!
 * Note the use of HTML comments to separate occurrences of the #if statements. This prevents the linebreaks from getting used, if the #if is not triggered to add some new stuff. Does that make sense?
 * -- Fandyllic (talk &middot; contr) 11 Nov 2011 3:16 PM Pacific


 * I added the HTML to a few of the parameters and now it's starting to freak out. I don't know if I added them incorrectly or what. It seems to have gotten rid of the white space problem, but now the tables are not displaying correctly. Thanks! --TheBelgianGuy 22:42, November 11, 2011 (UTC)

The big problem is that these templates use wikimedia markup to create the tables - it's a disaster, crap, almost no one knows how to make it work and the workarounds (like Fandyllic's) only work in limited scenarios. But every time this comes up people will flood you with wrong code, like this one:


 * I'm starting to enjoy your 1-man war against wiki-markup tables Nidek. There's really nothing wrong with them, it's just personal preference which one to pick. On the thread subject - seems that there were simply too many cooks in the kitchen. I simplified the template to what I consider an acceptable appearance. If something is missing/not working/not looking as you wanted, feel free to undo my changes and/or write about your concerns here. — Sovq 08:27, November 13, 2011 (UTC)


 * Thanks for your help! It finally looks and acts how I wanted it to be! --TheBelgianGuy 05:42, November 14, 2011 (UTC)