For a class I am teaching I would like to deploy CDFs on a website (BlackBoard-driven, if it matters), and I am running into two issues at this point:
A) I would like to have the CDFs styled according to a custom stylesheet of mine, but this only seems to work if that stylesheet is present on the target computer. I did follow the workflow suggested here, but I still get a message saying
The stylesheet "" depends upon a stylesheet named "
name.nb" which cannot be found by the Wolfram System.
and no styles are applied to the content of the CDF.
B) When someone clicks on the link to a CDF, the results look disastrous: Not only are there no styles applied at all, but the CDF Player toolbar itself is messed up, like so:
I note that this does not happen if I provide a link to a notebook; it's only CDFs that result in the broken CDF Player toolbar.
If I choose "Web embeddable..." during the CDF creation process, things go a little better, in that in this case I get a CDF that seems to have style information embedded. However, the browser plugin opens the CDF such that it fits the entire document in the browser window so no scrolling is required, which makes the CDF (and its toolbar) unreadable. In addition, if I open the CDF file that's created directly, while I do get a properly styled layout, but with all input cells revealed and open.
Ideally, what I would like is for people to see a nice rendering, with styles applied, of the CDF in the same way I see it if I click on the "Open in Player" icon. I guess my question is, what is the secret to producing a usable CDF? Is this possible? The methods provided by the frontend interface certainly do not result in such CDFs.
Update: I spent more time troubleshooting this, and here's my latest findings: I realized that I don't really understand the mechanics of embedding stylesheets into notebooks at all. It appears that somehow, and I really don't know how that happened, I was able to create a notebook that has the stylesheet information embedded. If I open this on a machine with the stylesheet in question, I get a "ding" when opening it, but no error messages, and the styling is applied as it should. However, I have another notebook, that I had thought I had treated the same, and this one insists on the stylesheet being present, or else it will not format correctly.
By now I'm pretty sure that one of the fundamental questions here is: Why the hell is there no straightforward way to embed entire custom stylesheets in a notebook? You know, something as amazingly nifty as a menu item saying "Embed style definitions in this notebook". What this function would do is simply copy all of the style definitions in the notebook's custom Stylesheet into its private style definitions, and then switch the stylesheet in use to the Standard Stylesheet. This way we will have created a portable notebook that will render its styles the same on any machine with a standard Mathematica installation.
I also found that the CDFs produced as "Standalone" or "Web embedded" versions are quite different, and that I get yet a third version if I use the Save button in the CDF player from within the browser. I can find no rhyme or reason behind any of these.