Skip to main content
Jared Hess
Legend
August 16, 2016
Question

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

  • August 16, 2016
  • 1 reply
  • 986 views

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?

This topic has been closed for replies.

1 reply

Community Expert
August 17, 2016

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:

HH Tips & Tricks - Helpware Wiki - KB

Peter Grainge
Community Expert
Community Expert
August 17, 2016

If the above doesn't help, could you not create two CHM outputs and set up something to call the chosen file?


See www.grainge.org for RoboHelp and Authoring information

@petergrainge

Use the menu (bottom right) to mark the Best Answer or Highlight particularly useful replies. Found the answer elsewhere? Share it here.