I have the latest RH 2015 (22.214.171.1248) on a Windows 64 bit machine.
Our primary output is CHM.
We're working on dynamic documentation themes. We want to allow our users to choose between Light and Dark themed CSS files. I've modified our header in the .htt to load in the correct css file whenever they click on a Light or Dark link, like this:
Pretty nifty huh? Yeah, that part works great. (I have jQuery under the hood pulling in the right css filename.)
But it's not persistent, and is, frankly, useless without persistence. Any time I change to a new topic or reload the chm, the chosen css state goes away. So I thought Cookies should do the trick. And they do work... in normal chm-less topics. But they don't work in a chm. I cannot read or set cookie information in a chm (even though the same .htm outside of a chm works just fine). The minute I try to bring the file into a chm, and use it to set cookies, it doesn't work.
So, my question is this:
Has anyone come up with a different way of getting, storing, and retaining user-persistent information for a chm, even after you close down a chm or switch to a new topic?
Can you set the cookie in the folder the chm is located in somehow? I feel like people were doing something like that years ago, but I can't remember the details.
Oo, have a look on this page there's a section about persistence:
Thanks Amebr. I did find this info yesterday (quoted on other sites--but never found this direct page. Thanks). I'm interested in Scott Boggan's demo, but those links are, I believe, from 2002 or earlier. Most are dead.
I did try messing around with having a file outside of the chm handle the cookies and calling that file with iframe, as directed. I couldn't get it to work. The chm could never find the file specified in the iframe. But maybe I was doing something wrong. I'll look some more into it. It's likely I missed something.
Thanks Peter. Having different versions of the chm is not an option for us. We're trying to cut down on disk space in our downloads. Duplicating all our chms across all 16 languages will cause a spike in an undesired direction.
I spent another 3 hours on this today fiddling with iframes, trying to get a chm to recognize an .htm in the same directory. (One's patience begins to wear thin.)
The idea, from the link that Amebr posted (HH Tips & Tricks - Helpware Wiki - KB ), is to have an .htm outside of the chm handle the getting and setting of cookies. An iframe tag pulls that .htm into each chm topic, thereby allowing cookies to work, in a round-about way, inside of a chm.
From my tests, however, I'm becoming convinced that chms today cannot handle this kind of workaround. Perhaps someone else can confirm whether it's possible to do what I'm attempting? To pull in content from an .htm in the same dir as the chm, but that is not part of the chm project?
I feel like I'm pulling a chm kicking and screaming to places it was not meant to go.
Mmmmm yeah. Good luck with that!
Pulling from distant memory here. I believe there has always been an issue where CHM files have "issues" dealing with files outside the CHM itself. Basically it involves figuring out the path leading to the file. Depending on how the CHM was opened, it may actually misunderstand what that path is.
I'm not sure if you have tried this, but the stuff at the link below allows working past that:
If that's what you tried, I'm at a loss.
Thanks for the response Rick. This isn't what I was doing, but maybe it'll lead me to a breakthrough.