Adding space at the top of hmpagebody_scroller

This forum is for discussions on the Help & Manual Premium Pack and the Premium Pack Toolbox configuration utility introduced with Premium Pack 3

Moderators: Alexander Halser, Tim Green

Post Reply
User avatar
Olivier Beltrami
Posts: 393
Joined: Mon Jul 15, 2002 3:30 pm
Location: Nantes, France
Contact:

Adding space at the top of hmpagebody_scroller

Unread post by Olivier Beltrami »

Hi Tim,

In my webhelp project (based on Flat_Blue_Diamond_WebHelp.hmskin), and also ideally in my CHM project (based on CHM_LightBlue.hmskin), I would like the first line of the topic to be separated from the header by more than the current 0.5rem.

Looking at the webpage topics I see that the element I need to change is hmpagebody_scroller, whose style is controlled by hmwebhelp_main_desktop.css, as shown below.

Code: Select all

div#hmpagebody_scroller {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 0.313rem 0.5rem 0.313rem 0.5rem;
    overflow-y: scroll;
    overflow-x: auto;
}
However, the top padding is overridden in the final generated html file, by an inline setting:

Code: Select all

<div id="hmpagebody_scroller" style="padding-top: 0.5rem;"></div>
And, as a consequence, any tweak of the top padding in the CSS makes no difference, and the resulting inspected object is:

Code: Select all

element.style {
    padding-top: 0.5rem;
}
div#hmpagebody_scroller {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 0.313rem 0.5rem 0.313rem 0.5rem;
    overflow-y: scroll;
    overflow-x: auto;
}
My question is, where can I adjust this in-line setting of the padding-top property of the hmpagebody_scroller object ?

Very best regards,

Olivier
Olivier Beltrami
https://www.qppstudio.net
Worldwide Public Holidays and Calendar Data
User avatar
Martin Wynne
Posts: 2656
Joined: Mon May 12, 2003 3:21 pm
Location: West of the Severn, UK

Re: Adding space at the top of hmpagebody_scroller

Unread post by Martin Wynne »

Hi Olivier,

Try adding

Code: Select all

div#hmpagebody_scroller {
padding-top: 1.5rem !important;
}
after the existing settings.

Any subsequent inline changes will then be ignored.

cheers,

Martin.
User avatar
Olivier Beltrami
Posts: 393
Joined: Mon Jul 15, 2002 3:30 pm
Location: Nantes, France
Contact:

Re: Adding space at the top of hmpagebody_scroller

Unread post by Olivier Beltrami »

Thank you very much, Martin.
Works fine.
Very best regards,

Olivier
Olivier Beltrami
https://www.qppstudio.net
Worldwide Public Holidays and Calendar Data
User avatar
Olivier Beltrami
Posts: 393
Joined: Mon Jul 15, 2002 3:30 pm
Location: Nantes, France
Contact:

Re: Adding space at the top of hmpagebody_scroller

Unread post by Olivier Beltrami »

Hi Martin,

Actually, for some reason, it is being ignored.
I had to go into the baggage file hmpagebody_scroller.js and patch it.

Tim: any thoughts ? Also, where can I make the change for my CHM skin ?

Very best regards,

Olivier
Olivier Beltrami
https://www.qppstudio.net
Worldwide Public Holidays and Calendar Data
User avatar
Tim Green
Site Admin
Posts: 23156
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Adding space at the top of hmpagebody_scroller

Unread post by Tim Green »

Hi Olivier,
I had to go into the baggage file hmpagebody_scroller.js and patch it.
I'm a little confused here -- there is no file with that name in the baggage of those skins, so I'm not quite sure what you are patching here. :? Also, in the current version of the skin there is definitely no inline setting that you need to override. Changing the CSS padding for hmpagebody_scroller is really all you need to do.

Based on your earlier postings I suspect that you have been trying to combine your additions to the older version of the skin using a merge program -- possibly even by updating the old version of the skin. That would be the wrong direction. You always need to use the new version as the basis and even then it's very easy to make errors.
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
User avatar
Olivier Beltrami
Posts: 393
Joined: Mon Jul 15, 2002 3:30 pm
Location: Nantes, France
Contact:

Re: Adding space at the top of hmpagebody_scroller

Unread post by Olivier Beltrami »

Hi Tim,

Sorry for the confusion.

I was patching the file hm_webhelp.js and more specifically the code

Code: Select all

if(!hmDevice.phone){$("div#hmpagebody_scroller").css({"padding-top":"0.5rem"});}else{$("div#topicbox").css({"padding-top":"0.5rem"});
Patching the CSS did not work because this JS code inserts an inline override of the padding-top directly in the html file.

Very best regards,

Olivier

PS: do you know when I can do a similar patch for the CHM ?
Olivier Beltrami
https://www.qppstudio.net
Worldwide Public Holidays and Calendar Data
User avatar
Olivier Beltrami
Posts: 393
Joined: Mon Jul 15, 2002 3:30 pm
Location: Nantes, France
Contact:

Re: Adding space at the top of hmpagebody_scroller

Unread post by Olivier Beltrami »

Hello again,

Over the weekend, I have retrofitted all my webhelp skin changes from 3.5 to 4. I'm almost getting there.

However, I notice that the generated webhelp now puts the plain text topic name in the topic header, and I cannot remember what I did to have the full header (including images and formatting appear there (for an example, see https://www.qppstudio.net/webhelp_xv4/r ... un-tim.htm or https://www.qppstudio.net/webhelp_xv4/q ... atting.htm).

Very best regards,

Olivier
Olivier Beltrami
https://www.qppstudio.net
Worldwide Public Holidays and Calendar Data
User avatar
Tim Green
Site Admin
Posts: 23156
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Adding space at the top of hmpagebody_scroller

Unread post by Tim Green »

Hi Olivier,
I was patching the file hm_webhelp.js and more specifically the code
Ah yes, that code was introduced to clean up in WebHelp where the featured image is turned off. The 0.5rem value there should be replaced with a variable. I'll add it to the next update. It's not a variable because a) half a rem is a good value, b) I try to keep the number of variables as low as humanly possible, and c) no customer has ever wanted to change this before. 8)

You can patch it there for the moment if you want, but in the long run you should avoid changing anything in the script files as that will block access to future updates.
PS: do you know when I can do a similar patch for the CHM ?
There you just need to adjust the top (first) padding value of the div#innerdiv container in the hm_topic.css file.
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
User avatar
Olivier Beltrami
Posts: 393
Joined: Mon Jul 15, 2002 3:30 pm
Location: Nantes, France
Contact:

Re: Adding space at the top of hmpagebody_scroller

Unread post by Olivier Beltrami »

Hi Tim,

Thank you very much.

For me, the 1.5REM is needed to have the same separation between the topic header and the first paragraph of the topic, as exists between subsequent paragraphs. Otherwise, one wonders why is the first paragraph squished against the topic header ?

Very best regards,

Olivier

PS: the v4 generated webhelp now puts the plain text topic name in the topic header, and I cannot remember what I did to have the full header (including images and formatting appear there (for an example, see https://www.qppstudio.net/webhelp_xv4/r ... un-tim.htm or https://www.qppstudio.net/webhelp_xv4/q ... atting.htm).
Olivier Beltrami
https://www.qppstudio.net
Worldwide Public Holidays and Calendar Data
User avatar
Tim Green
Site Admin
Posts: 23156
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Adding space at the top of hmpagebody_scroller

Unread post by Tim Green »

Hi Olivier,
I cannot remember what I did to have the full header
The old Skin Include Options are now in an internal group of settings so that you no longer have to remember to set them every time you compile a new project. Hit the Skin Options button, then activate the OPT_HDFORMAT option ("Use formatted topic title from project"). 8)
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
User avatar
Olivier Beltrami
Posts: 393
Joined: Mon Jul 15, 2002 3:30 pm
Location: Nantes, France
Contact:

Re: Adding space at the top of hmpagebody_scroller

Unread post by Olivier Beltrami »

Hi Tim,

Great, thank you very much.
I have now finished porting my skins to v.4 PP.
Very best regards,

Olivier
Olivier Beltrami
https://www.qppstudio.net
Worldwide Public Holidays and Calendar Data
Post Reply