# CDF and MediaWiki

Recently there was a handful of CDF embedding-related topics. However I would like to ask whether anyone has succeeded in embedding CDF into MediaWiki page?

I've attempted to do so with the Widget extension but it fails to load fully. Is there any way to fix this?

-
The link (in Russian -- is that your site?) looks like it is unable to find the CDF so perhaps a path issue?? –  Mike Honeychurch Mar 15 '12 at 20:27
@MikeHoneychurch, seems to be that way. I have uploaded the CDF to the wiki itself and that solved the problem. –  iav Mar 16 '12 at 11:05
You might find this useful: groups.google.com/d/topic/comp.soft-sys.math.mathematica/… –  Szabolcs Apr 27 '12 at 10:55
@user829438 you might consider using a name that's easier remembered and that has more personality than your current one... –  Sjoerd C. de Vries Apr 27 '12 at 20:55
@Sjoerd - If you were from .ru you might need to obfuscate too!? Just a lighthearted observation. :) –  telefunkenvf14 Sep 15 '12 at 3:14

I am the author of the comp.soft-sys.math.mathematica message linked by Szabolcs, wherein I briefly mentioned a CDF extension for MediaWiki I have developed. In the few days since I sent that message, I have improved the extension so that meets MediaWiki's best practice guidelines for extensions, and added new features: it can show CDF files uploaded to a wiki in wiki pages using a simple syntax, it can optionally show CDF files from other servers, and you can configure it to show a 'download' link beneath each CDF so that users may view the file offline if they want.

Full documentation for the extension, including installation instructions and examples, is given on the extension's page on mediawiki.org at http://www.mediawiki.org/wiki/Extension:WolframCDF but a brief summary of the page follows.

Note that this extension will only work with MediaWiki 1.17 or later. Earlier versions of MediaWiki do not include the Resource Loader system this relies on.[/edit]

require_once("$IP/extensions/wolfram_cdf/CDF.php"); You will also need to ensure that file uploads are enabled, and .cdf file extensions are allowed, to do this your LocalSettings.php will need to include code like: $wgEnableUploads  = true;
$wgUseImageMagick = true;$wgFileExtensions = array( 'png', 'gif', 'jpg', 'jpeg', 'txt', 'cdf' );

You may also need to either ensure that your webserver serves up .cdf files with the mime type application/x-netcdf or, if that is not possible, you may need to modify your wiki's includes/mime.types to contain

text/plain txt cdf

otherwise uploading CDF files may fail. Once the extension is installed, you can show CDF files in wiki pages by following these steps:

• place a <cdf width="width in pixels" height="height in pixels">filename</cdf> tag in the page where you want the CDF file to appear.
MyDemonstration.cdf