Manual:Importing Wikipedia infoboxes tutorial

This tutorial outlines steps to import infoboxes used by Wikipedia.

Prerequisites
Before using this tutorial, you should familiarize yourself with the MediaWiki features it will be utilizing:
 * meta:Help:Export
 * meta:Help:Import
 * Help:Editing pages
 * Help:Templates
 * Manual:Using content from Wikipedia
 * Wikipedia infoboxes
 * Designing infoboxes

You must also have these extensions installed, setup and working:
 * Extension:ParserFunctions
 * Extension:Scribunto

CSS
Either manually create or Export/Import the CSS from the source wiki; e.g., https://en.wikipedia.org/wiki/MediaWiki:Common.css. (this is optional; importing may be necessary to properly display some templates).

JS
Either manually create or Export/Import the JS from the source wiki; e.g., https://en.wikipedia.org/wiki/MediaWiki:Common.js. (this is optional; importing may be necessary for some template functionality).

Extensions
required
 * Extension:ParserFunctions
 * Extension:Scribunto

recommended
 * Extension:InputBox
 * Extension:TemplateData

Commons Templates
if copying templates from commons, either Special:Export/Special:Import these pages or create them manually in your local wiki:
 * https://commons.wikimedia.org/wiki/MediaWiki:Lang
 * https://commons.wikimedia.org/wiki/MediaWiki:Editsection-brackets

Step 1: Determine info boxes needed

 * Find all infoboxes used on Wikipedia at w:Category:Infobox templates
 * If there's an info box being used in a Wikipedia article you'd like to import:
 * Visit the page's edit screen
 * Scroll to the bottom and find the appropriate page name for the infobox template you'd like to import

Step 2: Export Wikipedia templates

 * Go to Wikipedia's Special:Export page and enter the full page names of the infobox templates from step 1.
 * For your first infobox to work, you'll also need to include the master infobox template,
 * Be sure to check the Include templates checkbox to include other necessary templates
 * Note that required templates may also include Scribunto modules in the module namespace
 * Most templates put their documentation in a subpage, so you may want to include  subpage for each template you're importing
 * Example: for  you should also download

Step 2a: Export Wikipedia Modules
It appears that many of the collapsible templates used in Wikipedia, that utilize Sribunto, also require a number of lua modules, like Module:Hatnote, and Module:citation. Without these modules installed, the templates will produce lua error message, like {#invoke:Hatnote|hatnote}. This section should be expanded to identify the list of Modules used by infobox templates that need to be imported.

The following is a list of some modules that need to be imported:
 * Module:Citation
 * Module:Hatnote
 * Module:Unsubst
 * Module:Sidebar
 * Module:Message_box
 * Module:navbox
 * Module:Navbox

Notably, when attempts are made to import the XML file created by the Export function, the error message "Import failed: No handler for model 'Scribunto' registered in $wgContentHandlers" may come up. At this time, the solution is not clear.

Step 3: Import infobox templates

 * Go to your wiki's Special:Import page and select the file you created from the export in step 2.

Step 4: De-Wikipediaify

 * You may want to review all of the files that you just imported for references to Wikipedia pages.
 * You can certainly leave them in place - and are encouraged to update them as links to the appropriate Wikipedia article (possibly using interwiki links)
 * Pay special attention to categories, which may be buried in the template's code, and may include reference to Wikipedia
 * Again, you can leave them, but you may wish to update them to your wiki's name or categorization policy

Step 5: Additional templates needed

 * Once your import is complete, you should check the template on your wiki to see if it functions correctly
 * A helpful step is to once again refer to the edit page's templates list
 * If there are redlinks, go back to step 2 and repeat this process to import the missing templates

Step 6: Enjoy success
That's it! Enjoy your infoboxes!