Copy link to clipboard
Copied
Not really sure how the multiple stylesheets got assigned to most topics, but they need to be removed across the project.
Is there a way to do that without having to open each indivicual topic and deleting the incorrect stylesheet?
Also, I noticed that even if the stylesheet has been removed from the topic and saved, when I close and re-open the project, the stylesheets are back again.
Any thoughts how this can be resolved?
Copy link to clipboard
Copied
You will need to use Find and Replace.
Open a topic and find the CSS references in Source View. Locate one of the CSS files you want to remove. It will be something like the line below.
<link rel="stylesheet" type="text/css" href="../assets/css/filename.css" />
Enter that in the Find and leave Replace blank.
In the Find and Replace Settings make sure that Find in Source View is selected.
Make sure you have a backup before you start.
I would deselect the two backup options as that will create loads of files that you don't need if you create the backup.
________________________________________________________
See www.grainge.org for free Authoring and RoboHelp Information
Copy link to clipboard
Copied
Do I enter the entire line in the Find field? I got an error that the string could not be found.
<link rel="stylesheet" type="text/css" href="../assets/css/filename.css" />
Thank you.
Copy link to clipboard
Copied
@bronxguys02 I'll assume you changed filename to whatever. 🙂
Compare that string with one of the topics that has the filename to be removed.
Update.
You could also select all the topics in a folder, right click and select Properties. That will show you topics with multiple CSS and you can delete from there.
Only one CSS will be shown initially but the down arrowhead lets you change that. Then you can delete.
________________________________________________________
My site www.grainge.org includes many free Authoring and RoboHelp resources that may be of help.
Copy link to clipboard
Copied
Yes, I copied from the Source view. 🙂
Copy link to clipboard
Copied
Were you in the Source (or Code) view? Did you find the offending line in there first?
Another method relies on the fact that if a referenced CSS file doesn't exist, it just follows whatever one does exist - so you can do a bulk deletion of the extra CSS in the output files all at one time outside of RH entirely. I just search for *.css in File Explorer, Ctrl-A to select them all, and delete all the ones it finds in the topic folder.
Copy link to clipboard
Copied
Thank you all so much! All of these were good solutions and I appreciate the prompt replies.
Copy link to clipboard
Copied
I will try this and will let you know! Thank you so much!
Copy link to clipboard
Copied
I'm not sure if this helps, but if you go in to the Topic List report, select a bunch of topics then right-click and select Properties, the Stylesheets section will show stylesheets that are common to all the selected topics. You should then be able to delete from all at once.
Do note that it only shows stylesheets that have been applied to ALL the topics selected though.
(Also, I could only test this on RH2019 New UI right now, so maybe it changed in RH2020 or RH2022...)
Copy link to clipboard
Copied
Thanks for the note! Otherwise, I would have assumed they were all correct already. And it worked perfectly in RH2020.
"Do note that it only shows stylesheets that have been applied to ALL the topics selected though."