Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Can I share a "global" CSS among multiple RH projects?

Explorer ,
Apr 09, 2025 Apr 09, 2025

RoboHelp 2022.5.28, Windows 11

I have developed a CSS that is used for all of my company's RoboHelp output; let us call it c:\RH_projects\global\...\company_name.css. 

 

For each RH project we create, I would like the CSS to either:

  • Be linked in the HTML to c:\RH_projects\global\...\company_name.css (using either an absolute or relative link), or, 
  • Be a read-only symlink to c:\RH_projects\global\...\company_name.css.

This guarantees that company_name.css can only be changed in the global project (so that local CSS changes aren't allowed), and more importantly: any changes that are made to company_name.css in the global project will be "automatically" promulgated through the entire suite of documents produced out of RoboHelp.

 

Neither of these methods works. RoboHelp is reluctant to hop out of a project to a CSS elsewhere on the filesystem, and I don't know what exactly Windows is doing when it creates a symlink, but whatever it is, the RoboHelp editor is not interpreting it as a CSS (although as best I can tell, output generates correctly, but, obviously, we want the editor to work correctly). 

 

RoboHelp doesn't seem to have the option to import an RH project into another RH project, which is how I've done this in the past.

Has anyone found any way to do what I'm proposing in RoboHelp? 

410
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Explorer , Apr 14, 2025 Apr 14, 2025

Just a final followup, I've tested this thoroughly and it works great. 

 

1. Create a project called global.

2. Create a CSS in the global project named assets/css/company_name.css.

3. Add and push global to the git repository (or however you share your projects amongst your writers).

4. Writers pull global from the git repo.

5. Writers create a directory in their project called assets/global:

      a. Right-click assets and select New > Folder.

      b. Name the folder global.

6. Writers create linked v

...
Translate
Community Expert ,
Apr 10, 2025 Apr 10, 2025

I had a quick look at linking but it does seem to have some issues as you say. I did find one way that looked promising. That is by using the Link options.

 

Work on this a bit.

  1.  Link to an external CSS in a topic folder. That way you get the red and green arrows to show the CSS is synced. You don't get that in the CSS folder.
  2. Duplicate it. It will add "copy" to the file name. Accept that.
  3. Move the copy to the CSS folder and remove "copy" as it is now in a different folder.
  4. Select that in a topic.

That appears to work but I didn't test making changes to the source and then repeating the above.

Let us know if that does work in an acceptable way.

 

You talk about importing a project into another project. Did you mean that or importing a CSS file from another project? That is possible.

 

image.png

________________________________________________________

My site www.grainge.org includes many free Authoring and RoboHelp resources that may be of help.

 

Help others by clicking Correct Answer if the question is answered. Found the answer elsewhere? Share it here. "Upvote" is for useful posts.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 10, 2025 Apr 10, 2025

Interesting, I'm selecting File > Import and seeing: 

DavidKinyon_0-1744314946257.png

I didn't realize that there was also an Import option on the context ("right-click") menu with different available options:

DavidKinyon_1-1744315018161.png

If anyone from RoboHelp development happens to be reading, this is an example of GUI design in RoboHelp that drives me batty. There should be the same Import options available regardless of the route I take to get to the Import menu.

 

Thanks for your thoughts, Peter, you've definitely given me some lines of inquiry to investigate further. Thanks! I'll report back shortly.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 11, 2025 Apr 11, 2025

Using the Link feature outside of the contents/assets/css was the key. Here's the steps I've done so far:

 

  1. Create two projects, test and global.
  2. In the global project:
        A. Create the CSS assets/css/company_name.css.
        B. Use Windows Explorer to set company_name.css to read only.
  3. In the test project:
        A. Create a folder named assets/global.
        B. In assets/global, link the css folder from the global project (right-click > Link > Link Folder)
        C. Create an individual HTML file (assets/test.htm) and set the css for this file to assets/global/css/company_name.css. (I did this in the source editor, <link rel="stylesheet" type="text/css" href="global/css/altowav.css" />, but you can also do it in Topic Properties as well).

 

The result of the above is:

  • Correct display in the WYSIWYG editor.
  • A read-only css that cannot be saved in the test project.
  • So far with fairly limited testing, it appears to generate HTML and PDF correctly as well.
  • Writers will need to sync the local CSS with the global CSS whenever global is updated (which is fine; I don't know if RoboHelp automatically syncs on update but I would prefer it if it doesn't, so that a writer knows that their project is going to be updated).

 

So far, this is working great. I'm going to do some further testing before rolling this out, and see how sourcing everything in git impacts it (which ought to be fine). It will require editing all the existing HTML to point to the new CSS but we'd have to do that anyway, and it can be scripted.

 

Thanks again Peter for the help! Much appreciated.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 11, 2025 Apr 11, 2025

The first copy you linked to before copying it to the CSS folder will have a green arrow as I explained. Keep the linked copy with that arrow. When it goes red that means it is out of sync because the original has been changed. Your team need to watch for that and seek your instructions as to whether or not to repeat the process of creating another copy and moving that to the CSS folder, deleting the old file and renaming the new one. You also need to test that bit works.

________________________________________________________

My site www.grainge.org includes many free Authoring and RoboHelp resources that may be of help.

  

Help others by clicking Correct Answer if the question is answered. Found the answer elsewhere? Share it here. "Upvote" is for useful posts.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 14, 2025 Apr 14, 2025
LATEST

Just a final followup, I've tested this thoroughly and it works great. 

 

1. Create a project called global.

2. Create a CSS in the global project named assets/css/company_name.css.

3. Add and push global to the git repository (or however you share your projects amongst your writers).

4. Writers pull global from the git repo.

5. Writers create a directory in their project called assets/global:

      a. Right-click assets and select New > Folder.

      b. Name the folder global.

6. Writers create linked version of company_name.css.

      a. Right-click the new global directory and select Link > Link Folder.

      b. Browse to and select global/contents/assets/css.

7. Link all files in the project to global/css/company_name.css:

      a. Run a script that updates the CSS link in all files in the project.* 

      b. Set the default CSS for future files:

            i Open File > Project Settings.

            ii. Change Default Stylesheet to contents/assets/global/css/altowav.css.

8. Profit.

 

* I'm doing the updating myself. It's pretty simple, the main task is to add 
<link rel="stylesheet" type="text/css" href="assets/global/css/company_name.css" /> to the <head> section of each file. I'm also removing all other CSS from the <head> section, just to make sure that every file is actually using the same CSS. This could cause some problems, if writers are using a custom CSS that has formats that don't exist in company_name.css. This isn't a big problem our projects already use the same CSS, it just isn't managed globally. But if someone else is doing this, you do need to keep in mind that sufficiently complex implementations might be broken by this step.

 

Note 1: I've decided to abandon the whole "read-only" aspect of this, since it caused weird problems with synching linked files (you have to change the permissions to get it to work correctly, and RoboHelp's messages weren't helpful and sometimes reported that the sync failed even though it didn't). So now, writers will be able to change their local version of company_name.css, but then if they synch to the global version, they'll lose their local changes. I'm not terribly happy with this outcome but it's still pretty good, all things considered. Most writers aren't going to go changing the stylesheet. They'd much rather have me deal with it.

 

Note 2: This same process can be used for other files that you want to be global and static. I haven't started testing this, but I ought to be able to also do this with the cover page, so that we can centrally manage all of our cover pages, which will be pretty slick.

 

quote

Your team need to watch for that and seek your instructions as to whether or not to repeat the process of creating another copy and moving that to the CSS folder, deleting the old file and renaming the new one.

 

If you look at my step 7, above, you'll see that this isn't how I'm implimenting it. I'm using the linked file for the CSS, rather than copying it into assets/css. Interestingly, RoboHelp doesn't seem to care where the CSS is stored, so long as it is stored within the project somewhere. So it can be assets/css, or assets/foo/css, or whatever you'd like.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
RoboHelp Documentation
Download Adobe RoboHelp