Pages

Tuesday, May 22, 2012

How to Embed Mathematica CDF in a Blogger Blog Post

STEP 1:
In Blogger go to
Template-> Edit HTML-> Click "proceed" when warned about messing with your HTML

Insert the following code after <head>, like in the image below:
<script src='http://blog.wolfram.com/common/javascript/cdfplugin/1.0/cdfplugin.js?ver=2.8.4' type='text/javascript'/>

STEP 2:
Create a new post, and click Edit HTML for that post (different from the Edit HTML for the template), and then insert the following code into the body of your post where you want a CDF to appear:
<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('http://blog.wolfram.com/data/uploads/2011/07/Animation11.cdf', 400, 300); </script>
 Then, publish your post, and it looks like this:

STEP 3:
Now to put your CDF in your blog, just change "http://blog.wolfram.com/data/uploads/2011/07/Animation11.cdf" to the URL to your CDF, and change the values "400, 300" = "width, height" to the values that best fit your blog.
I get my URL by uploading my CDFs to the "public" folder of my free Dropbox account, and copy-pasting the "public link" of the file.


13 comments:

  1. I don't understand why in my Blogger, some Mathematica cdf emb appear with a scroll bar that is very convenient for viewing. Some, doesn't have a scroll bar despite the original cdf file is very long....!!!?? IS there any explanation?

    ReplyDelete
    Replies
    1. I'm not sure... whenever the CDF is larger than the "width,height" that I specify, it always automatically puts a scroll bar. Let me know if you figure it out

      Delete
    2. This is a sample.....the plugg-ins just doesn't put in a scroll bar...!

      http://hacaoidea.blogspot.com/2012/07/tap-huan-ai-so-tuyen-tinh.html

      Delete
    3. Is it not displaying everything that you want it to, ie it cuts off part of your CDF?
      Or do you just want the blog post to be shorter, and thus have a scroll bar for the CDF? How are you setting the size "width, height"?

      Delete
  2. It cuts off part of my CDF....:(

    ReplyDelete
  3. did this change? it doesn't work for me

    ReplyDelete
  4. I think this is a real great post.Really thank you! Much obliged.
    Mathematica

    ReplyDelete
  5. Good work. I tried this procedure for my blog name in All Url Opener. I also want to stop unwanted referrals. Thanks for sharing this information.

    ReplyDelete
  6. Research Paper Topics need to make just one examination paper toward the finish of the term, you can inhale out on the grounds that you are honored. Assuming more – a proper arrangement exists. Go to the expert internet composing organization. Reach them by means of email and get any school task settled inside the set timeframe! In this guide, we will address a few inquiries.

    ReplyDelete

  7. Thanks for sharing this useful information. I really appreciate your efforts and I will be waiting for further articles.  I feel great surfing from your updates. Also, visit is ritman post utme form out

    ReplyDelete

  8. The blog was absolutely fantastic! Lot of information is helpful in some or the other way. Keep updating the blog, looking forward for more content...Great job, keep it up. Thank you for this useful update. Meanwhile, visit kwararafa university school fees payment

    ReplyDelete
  9. The General Power of Attorney format for NRI can include powers to manage bank accounts, sign legal documents, and buy or sell property in India. These powers can easily manage with the help of a free pdf of gpa format from the official website of law phrase https://lawphrase.com/.

    ReplyDelete
  10. Thanks for sharing this useful information. I really appreciate your efforts and I will be waiting for further articles. I feel great surfing from your updates. Also, visit UNILAG Diploma in Human Kinetics & Health Edu Form

    ReplyDelete