Manual:Using content from Wikipedia

Wikipedia, a Wikimedia project, uses a large number of extensions, a very up-to-date copy of the MediaWiki software, and a number of hacks and add-ons that make duplicating its layout and content output rather difficult.

However, there are some common issues that come up frequently enough to warrant a manual page on how to steal content from Wikipedia.

Template theft
There are a few likely issues if you have copied templates from Wikipedia and they do not seem to be working as expected.

{ {#if: ...
If you have copied templates directly from Wikipedia and you see output like and  it means that you do not have the ParserFunctions extension installed.

Odd colors and floating
Wikipedia uses site-wide CSS pages for things such as class="infobox". They are located at w:MediaWiki:Common.css and w:MediaWiki:Monobook.css. The latter is obviously only necessary if you're using MediaWiki's default skin, Monobook.

Show/hide links
The show / hide links are controlled using site-wide JavaScript. The relevant page is w:MediaWiki:Common.js.

HTMLTidy
Wikimedia wikis (like Wikipedia) use an program called HTMLTidy that cleans up markup and validates it. If a template you have lifted from Wikipedia contains code that uses both wiki markup and HTML, you'll need to enable HTMLTidy in order for it to work. See also: Manual:$wgUseTidy.

Template dependencies
At times, templates will call sub-templates or other templates on a wiki. If you click the edit tab and look at the bottom of the page below the edit text area, new versions of MediaWiki will list other templates called by the current template. These may need to be copied over as well for the template to work. Documentation subpages (Template:Foobar/doc) are generally not needed, though they can be helpful for more complex templates.

Outdated templates
If the templates were added to your wiki a long time ago, you may run into issues from their being outdated. You can try to figure out which sub-template is causing the problem and try to fix it, or you can follow this procedure, which assumes you are an administrator on your wiki and that Extension:BatchDelete is installed:
 * 1. Go to w:Special:Export (Wikipedia's export page). Enter the name of the template, e.g. Template:Citation. Check all three checkboxes: Include only the current revision, not the full history; Include templates; and Save as file.
 * 2. Go to Special:Import (on your wiki). Import the file. You'll get a list of imports that went through and imports that didn't, e.g.:

* Template:Citation 1 revision * Template:AuthorMask doc 1 revision * Template:Citation/authors 1 revision * Template:Citation/core All revisions were previously imported.
 * 3. Check to see if the template works now. Make a small edit to a page that transcludes the template and it should reload.
 * 4. If it's still not working (as it probably won't be), follow the rest of the steps below.
 * 5. Fire up OpenOffice spreadsheet, or Microsoft Excel, or whatever.
 * 6. Copy and paste the list from step 2 into column A of this spreadsheet. In cell B1, put this formula: =IF(RIGHT(RIGHT(A1,LEN(A1)-6),9)="imported.",LEFT(RIGHT(A1,LEN(A1)-6),LEN(RIGHT(A1,LEN(A1)-6))-40),LEFT(RIGHT(A1,LEN(A1)-6),LEN(RIGHT(A1,LEN(A1)-6))-11))
 * 7. Copy and paste that formula all the way down column B, or at least far enough that it's even with the end of the list in column A.
 * 8. Now copy the content of column B into Special:BatchDelete. Delete them all.
 * 9. Now do the import in step 2 again.
 * 10. Check to see if the template works now. (See step 3)

Generic duplication
Wikimedia's configuration files are available at http://noc.wikimedia.org/conf/

The extensions currently enabled on a specific project are located at Special:Version (e.g., http://en.wikipedia.org/wiki/Special:Version).

Wikimedia wikis use short URLs. More information regarding those is available at Manual:Short URL.