29
$\begingroup$

The new CDF (computable document format) lets you embed a Manipulate or other interactive graphics on your website, and users can play around with your little script using the free player.

What steps do I need to follow to

  1. Create the CDF file correctly so that it displays a static picture (that I choose) if the user doesn't have the player and fires up the player if they do?
  2. Make the necessary changes to my website/server to enable this?
$\endgroup$

3 Answers 3

14
$\begingroup$

UPDATE

See: Why does Wolfram Research no longer support the CDF plugin?

Then: Web Delivery: Cloud

Also: Wolfram Notebook Embedder

LEGACY

This is just to update everyone on this topic. Wolfram Research released detailed blog and video tutorial "CDF Embedding in a Nutshell". It shows how to use built-in Mathematica wizard to deploy CDF online into HTML pages and Word Press blogs. URL:

http://blog.wolfram.com/2012/02/22/mathematica-qa-series-cdf-embedding-in-a-nutshell/

$\endgroup$
5
  • $\begingroup$ I followed your CDF Embedding video and tried to do the same thing but I faced a problem. After copying the Interactive Cell, I went to FIle then tried to find Deploy but I cannot find the Deploy option. I am using MMA 11.03 version. What should I do now? Thanks. $\endgroup$ Commented Sep 10, 2020 at 16:43
  • $\begingroup$ @TugrulTemel I updated my post, see above. $\endgroup$ Commented Sep 10, 2020 at 17:25
  • $\begingroup$ Thanks for your prompt reply. $\endgroup$ Commented Sep 10, 2020 at 17:30
  • $\begingroup$ I deployed my Manipulate code to WolframCloud. No problem. But how can I: (1) allow non-Mathematica users to use it and (2) embed it into my own Webpage? Really, I tried many things but no success. $\endgroup$ Commented Sep 10, 2020 at 17:39
  • $\begingroup$ I think EmbedCode[] does the job. Thank you for your time. $\endgroup$ Commented Sep 10, 2020 at 17:53
13
$\begingroup$

For part 2, you must add the following to your <head> section

<script type="text/javascript" src="http://www.wolfram.com/cdf-player/plugin/v2.1/cdfplugin.js"></script>
<script type="text/javascript">
    var cdf = new cdfplugin();
    cdf.embed('/path/to/filename.cdf', width, height);
</script>

For part 1, you can embed a static picture for people with no CDF plugin by using the cdf.setDefaultContent function:

cdf.setDefaultContent('<p>Your replacement content</p>');
cdf.embed('/path/to/additional.cdf', width, height);

For more details, see the Web Delivery page.

$\endgroup$
7
$\begingroup$

You could look at the following:

http://reference.wolfram.com/mathematica/howto/CreateAComputableDocumentFormatFile.html

That also explains, the wizard to create the html code for your web page.

Edit: OP wanted a precis:

Select you manipulate cell and choose (v.8.0.4): File -> Deploy. That will generate the HTML automaticaly.

$\endgroup$
2
  • $\begingroup$ I do not see it in 8.0.1 on OS X. is this Deploy menu item only in 8.0.4, only in windows, or am I missing something else? $\endgroup$
    – acl
    Commented Jan 23, 2012 at 14:57
  • $\begingroup$ @acl, yes, this is one of the few new features in V8.0.4 $\endgroup$
    – user21
    Commented Jan 23, 2012 at 16:47

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