Skip to main content
New Participant
October 21, 2020
Question

Master page not being applied when publishing in v2020

  • October 21, 2020
  • 6 replies
  • 355 views

I have a 2017 version RoboHelp project that uses a master page and css style sheet. When I first developed the project (about 9 years ago), the master page I used for topics had a yellow background colour (#ffffe5) and included an image in the page heading. I changed this to white (#ffffff) and removed the image about 5 years ago. So when editing topics in RoboHelp, I have the topics created prior to me amending the master page with a yellow background colour and the image, with the newer topics having a white background and no image. This doesn’t bother me, as when I publish to Responsive HTML5 in version 2017, I select the master page to be applied to all topics and it has applied the updated master page properties, generating all topics with a white background and no image.

 

I upgraded my project to version 2020 and have found that when I generate the output, the system is not applying the current master file across all topics, even though I have specified this in the output options. I then have a mix of yellow and white background topics, some with and others without the image. I have tried all sorts of options – removing the master page from topics and adding a different one, but it doesn’t seem to have any effect. The existing source code of a topic (which specifies the yellow colour) seems to take precedent.

 

Does anyone have any suggestions as to what I can do, as I don’t want to have to manually adjust the source code for hundreds of topics.

    This topic has been closed for replies.

    6 replies

    Peter Grainge
    Community Expert
    October 24, 2020

    If you are still stuck can you share the project? If you can, then see the Contact page on my site and send the project as instructed there. Do make sure you include a link to this thread and please do not email the project direct.

     

    Please point to two topics one of which is correct and one of which is not.

     

    Help others by clicking Correct Answer if the question is answered. Found the answer elsewhere? Share it here. "Upvote" is for useful posts.
    Community Expert
    October 23, 2020

    I can't figure out any way to do multiline search and replace in RH2020.

     

    However, the following should work in Notepad++. Do have a safe backup of your project. I'd recommend doing a Find only first, just to check what it finds. And perhaps test on one or two topics to make sure it only picks up the intended information.

     

    In this case I'm just targeting:

    body {

    background-colour: #xxxxxx;

    }

     

    Use Search > Find in Files.

    Find what: body\s*{\s*\n\s*background-color:\s*#[0-9A-Fa-f]{3,6};\s*\n\s*}

    Replace with: leave blank

    Filters: *.htm
    (so you don't pick up any css or master pages.)

    Directory: the contents folder of your project

    Select In all sub-folders

    Search mode: select Regular expression

     

    This should only touch body styles that exactly match the sample you provided with any background colour specified. It should find the body style regardless of any indenting or other spacing differences.

     

    I could make one that that finds any body style, for example that include a font-family or font size, but it has a greater risk of deleting the wrong thing.

     

    Known Participant
    October 26, 2020

    Thank you, thank you, thank you Amebr!

    That worked a treat! All fixed. 

    Now when I update my other two help projects I know what to do 🙂

    Peter Grainge
    Community Expert
    October 22, 2020

    When you create a topic and apply a master page anything in its body section becomes part of the body of the topic but it's a one off. If later you change the header and/or footer that the changes will get applied to the output. Changes to the body of the master page do not get applied. It's always been that way. 

     

    What happens when you generate is explained in the About RoboHelp sample project. 

     

    Help others by clicking Correct Answer if the question is answered. Found the answer elsewhere? Share it here. "Upvote" is for useful posts.
    Community Expert
    October 22, 2020

    It's probably because RH2020 is more strict about following CSS and HTML standards. It is also a complete rewrite of Robohelp - I think Adobe's done a poor job of warning people before they upgrade.

     

    In any case, I'll poke around after work to see what I can figure out

    Community Expert
    October 22, 2020

    Probably you will need a RegEx to remove the code - slightly different spacing in each topic would mean it can't be found, or perhaps there is a limitation in the find and replace functionality (pretty common). I can try to work out what you need later today (AEST).

    Known Participant
    October 22, 2020

    Thanks Amebr. Any help is appreciated.

    It does however, highlight that a change has been made in v2020 (from 2017) as to how a master page which is specified to be applied to all topics at time of generation, is working..... 

    Community Expert
    October 21, 2020

    Sometimes in the past the master page settings could get copied into the topics, I'm not sure how. But if you can find the right code, you should be able to do a find and replace in RH2020 to remove it pretty easily. At a guess, it's probably on the <body> tag.

     

    The find and replace functionality includes a setting "Find in source view" which will let you search for the code you need to replace.

     

    Post back with what you find in the source code, if you're not sure how to proceed.

    CathrynWAuthor
    New Participant
    October 22, 2020

    Thank you Amebr.  I'm not an expert on source code but I located the code that included the background colour and did try a find and replace to try to remove the whole code of: 

     

    /*<![CDATA[*/
    body {
    background-color: #ffffe5;
    }
    /*]]>*/

     

    but the system didn't find any matches even though it appears in each topic. Perhaps it doesn't like the line breaks. I tried removing empty spaces etc, but still didn't find any matches. So I opted for simply replacing '#ffffe5' with '#ffffff' which has worked OK. I then did a find and replace for the image path that was in each source code and replaced it with 'nothing' (left the replace field blank), This seems to have worked OK for now, but to me this is a messy fix.

     

    I would appreciate any suggestions to remove the whole code above, but can't seem to get it to work.