6 Replies Latest reply on Aug 18, 2016 11:17 AM by JaredHess

    How to retain user choice in a chm? Cookies don't work...

    JaredHess Level 1

      I have the latest RH 2015 (12.0.3.428) 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:

       

      Light theme:

       

      Dark theme:

       

      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?