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 import content from Wikipedia.
There are a few likely issues if you have copied templates from Wikipedia and they do not seem to be working as expected.
If you have copied templates directly from Wikipedia and you see output like {{#if: ...}} and {{#ifeq: ...}} it means that you do not have the ParserFunctions extension installed.
If you have copied templates directly from Wikipedia and you see output like {{#invoke: ...}} it means that you do not have the Scribunto extension installed.
<templatestyles />[edit]If you have copied templates directly from Wikipedia and you see output like <templatestyles src="..." /> it means that you do not have the TemplateStyles extension installed. This will also cause #Odd colors and floating below, since the CSS used for many of these templates will not be loaded.
If you copy templates from Wikipedia and then get a big red "Script error" where the Scribunto invocation (e.g. the template that uses {{#invoke:}}) should be, that probably means that you didn't import everything you needed. Make sure that you tick the "Include templates" box at wikipedia:Special:Export when you export.
Odd colors and floating[edit]Wikipedia uses site-wide CSS pages for some things such as class="infobox", although this has mostly been deprecated in favor of TemplateStyles. They are located at w:MediaWiki:Common.css and w:MediaWiki:Vector.css. The latter is obviously only necessary if you're using MediaWiki's default skin, Vector.
The show / hide links are controlled using site-wide JavaScript. The relevant page is w:MediaWiki:Common.js.
Template dependencies[edit]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. When you use Special:Export on Wikipedia, you can check a box to import sub-templates. Note that in some cases, you will want to open the downloaded XML file with your favorite text editor and do a search and replace. E.g., you may want to replace all mentions of "Wikipedia" with the name of your wiki and all "en.wikipedia" urls with the url of your wiki. Watch out for the difference between spaces and underscores if your wiki name consists of more than one word; there may be urls in that XML file that will break if you put a space in the middle of them. If the XML file consists of a lot of pages, to save work correcting it later, you may want to scroll down the XML file one last time before import as a sanity check to make sure you didn't forget anything that needed to be changed. On the other hand, if a mistake does slip through and you import a lot of faulty template pages, there's always Extension:DeleteBatch (see below).
Images used in templates[edit]Many templates include images, which are not exported using Special:Export, so you will need to locate and import the images as a separate step. The special page Wanted files can be used as an aid to determining what image files are needed. There are a number of methods including using Upload file and the maintenance script importImages.php.
Outdated templates[edit]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:DeleteBatch is installed:
* Template:Citation 1 revision * Template:AuthorMask doc 1 revision * Template:Citation/authors 1 revision * Template:Citation/core All revisions were previously imported.
Be careful about mixing and matching templates from different wikis, as you may cause
script errorsor other problems if there are incompatibilities between imported templates and imported dependencies. This can be hard to troubleshoot and fix without doing mass deletions.
Generic duplication[edit]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., w:en:Special:Version).
Wikimedia wikis use short URLs. More information regarding those is available at Manual:Short URL.
Harvest all of Wikipedia's gadgets by going to w:Special:Export and grabbing all the pages that start with MediaWiki:Gadget- from AllPages, or if you prefer, from PrefixIndex or from the API. If you pick the latter option, and want to use Calc, copy and paste that API output into column A, put in column B =SEARCH("title=",A1)
, put in column C =SEARCH("/>",A1)
, and put in column D =MID(A1,B1+7,C1-B1-9)
. That should give you what you need to copy and paste into Special:Export.
Of course, it will still be necessary to make the necessary changes in MediaWiki:Common.css, MediaWiki:Common.js, and MediaWiki:Vector.css as the case may be. Also, a lot of those description pages, e.g. MediaWiki:Gadget-HotCat, have links that will break when imported, so you'll probably want to edit those.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4