Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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?

share|improve this question
2  
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

1 Answer 1

up vote 10 down vote accepted

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.

[edit]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]

To install the extension, download a zip archive of the latest version, unpack it and place the wolfram_cdf directory in your mediawiki extensions directory. Add the following to your wiki's LocalSettings.php file:

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:

  • upload your CDF file to the wiki
  • 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.

For example, if you upload a 500x600 pixel CDF file called "MyDemonstration.cdf" to the wiki, you can show it in a page using

MyDemonstration.cdf

More configuration options and examples are provided on the MediaWiki.org page linked above.

share|improve this answer
    
Thank you! Though the widget works I'll certainly try your extension. –  iav Apr 27 '12 at 17:22
    
@The Watcher will your extension work with the Turnkey Linux's MediaWiki bundle? I am planning to install MediaWiki in AWS, and the Turnkey's bundle is available in the aws marketplace as a ready to be deployed software - aws.amazon.com/marketplace/pp/B0078U8W14/… –  Murali Jul 20 '12 at 9:37
1  
@Murali my apologies for the delay in replying, it has taken me some time to get hold of the Turnkey Mediawiki bundle and determine exactly which version of MediaWiki it includes. Unfortunately, it is very unlikely that the extension will work with the Turnkey bundle: the bundle includes MediaWiki 1.15.1, while my extension relies on features added to MediaWiki in 1.17. I have now updated my answer to include this version information. –  The Watcher Jul 24 '12 at 12:42

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.