Universal non-scrolling headers

This is the place to share H&M templates and utilities with other users. Topic templates can be posted as text attachments (*.txt) or in the posting itself between

Code: Select all

 and 
tags. Print manual templates (*.mnl) are digital and can only be posted as attachments. Utilities and multiple files can be posted in ZIP archives. Please include plenty of comments so that users understand what you're doing! Registration is required to access this forum.

Moderators: Alexander Halser, Tim Green

User avatar
Tim Green
Site Admin
Posts: 23156
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Unread post by Tim Green »

Rossco,
Within that template, is there a way I can change the top/next/prev font and color?
The easiest way to do this is to create a style to be used for the navigation texts only. Here is an example, which you should add directly before the closing </style> tag in the main style block:

Code: Select all

.navlinks {
   font-size: 10pt;
	color:  Blue;
   }
	
.navlinks a {
	text-decoration: none;
}

.navlinks a:visited {
	color: Blue;
}

.navlinks a:hover {
	text-decoration: underline;
	color: Red;
}
Then locate the block of code that defines the navigation links and replace the <span style="font-size: 9pt"> tag with <span class="navlinks">, like this:

Code: Select all

     <span class="navlinks"> 
     <a href="<%HREF_DEFAULT_PAGE%>">Top</a>&nbsp; 
     <IF_PREVIOUS_PAGE><a href="<%HREF_PREVIOUS_PAGE%>">Previous</a>&nbsp;</IF_PREVIOUS_PAGE> 
     <IF_NEXT_PAGE><a href="<%HREF_NEXT_PAGE%>">Next</a></IF_NEXT_PAGE> 
     </span>
You can change the style settings in the style block to achieve any effect you want, of course. Note that the "a:visited" settings should always be the same as the plain "a" settings to prevent the appearance of the link from changing after the user has visited the page.
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.
Rossco
Posts: 185
Joined: Tue May 02, 2006 6:43 am
Location: Wellington, New Zealand

Unread post by Rossco »

Awsome,
thanks Tim, works great :)

I will now find the forum topic that says how to reference the "top" navlink to a topic of your choice, instead of going straigh to the introduction or welcome page,

thanks again,
regards
Rossco
Rossco
Posts: 185
Joined: Tue May 02, 2006 6:43 am
Location: Wellington, New Zealand

Unread post by Rossco »

Hi Tim,
I have just uploaded the site again, and in IE it works really well, however the header does still scroll in FF 1.5.04..

...is there something I should have done differently for FF?

cheers
Rossco
User avatar
Tim Green
Site Admin
Posts: 23156
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Unread post by Tim Green »

Rossco,
Rossco wrote:I have just uploaded the site again, and in IE it works really well, however the header does still scroll in FF 1.5.04..

...is there something I should have done differently for FF?
No, it works there fine. My suspicion is that you haven't actually updated all your files on your server -- you're probably using a smart FTP program that only uploads files whose timestamps have changed. However, H&M's topic files timestamps only change if you make editing changes to the topics. Template updates don't change the timestamps, so you need to do a full upload of all files in this case to update the changes properly.
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.
Rossco
Posts: 185
Joined: Tue May 02, 2006 6:43 am
Location: Wellington, New Zealand

Unread post by Rossco »

OK, Cheers Tim,

I was using dreamweaver. I will go back and do a complete site upload..

regards
Rossco
Rossco
Posts: 185
Joined: Tue May 02, 2006 6:43 am
Location: Wellington, New Zealand

Unread post by Rossco »

Hmmm wierd..

FF still scrolls

http://www.rhh.net.nz

If you get time, could you go to this site and try it in FF?

cheers
Rossco
User avatar
Tim Green
Site Admin
Posts: 23156
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Unread post by Tim Green »

Hi Rossco,

Works fine with my Firefox (latest). Note that you only have one page there that is long enough to scroll at all and that's "Clinics". Also, the NS region will only work if you have JavaScript turned on in Firefox. If it's deactivated you'll just get a normal scrolling header.
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.
Rossco
Posts: 185
Joined: Tue May 02, 2006 6:43 am
Location: Wellington, New Zealand

Unread post by Rossco »

Tim Green wrote:Hi Rossco,

Works fine with my Firefox (latest). Note that you only have one page there that is long enough to scroll at all and that's "Clinics". Also, the NS region will only work if you have JavaScript turned on in Firefox. If it's deactivated you'll just get a normal scrolling header.
Gidday Tim,
well now I am thumping my head into my monitor...;\ I think it should be a brick wall ..

talk about dumb, I have that little no script plugin in FF and I had not set it to allow for my site...!!

Talk about not being able to see the wood for the trees ;)

Yep, I know about the page sizes etc, I was just manually resizing the window to force a scroll bar etc..

Thanks Tim and sorry to get you checking things out for no reason...

cheers
Red Faced Roccso
User avatar
Tim Green
Site Admin
Posts: 23156
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Unread post by Tim Green »

Hi Rossco,

No sweat... 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.
vanwerkum
Posts: 192
Joined: Wed Oct 26, 2005 4:34 pm

Unread post by vanwerkum »

Re:

#idcontent div {
padding: 15px !important;
padding: 0px;
}

"padding: 15px !important;" seems to also affect the bullet line spacing in browsers other than IE. If you change to "0px" the bullet line spacing is OK, but then you lose the padding around the topic text.
User avatar
Tim Green
Site Admin
Posts: 23156
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Unread post by Tim Green »

Hi Van,
vanwerkum wrote:"padding: 15px !important;" seems to also affect the bullet line spacing in browsers other than IE. If you change to "0px" the bullet line spacing is OK, but then you lose the padding around the topic text.
Aaaarrrrggh!!! :frustration: Of course! It's not actually the value, it's the way it's defined. The problem is that #idcontent div {...} defines a style for all DIVs within the outer #idcontent DIV, and H&M sometimes uses DIVs in lists, in some formatting situations. This will then add additional padding to these DIVs and since this setting only applies in Firefox and other standards-compliant browsers you only see the effect there.

Thanks a lot for posting this! I've already updated the template to correct it. What you need to do is this:

Replace the original #idcontent {...} and #idcontent div {...} blocks with this (I've also fine-tuned the padding values a little):

Code: Select all

   /* Set the padding in the OUTER div for MSIE and CHM to prevent the 
           width bug and the horizontal scrollbar bug from activating. */ 
    
  #idcontent {    
      width: 100%; 
      padding: 0px !important; 
      padding: 10px 18px 5px 10px; 
   } 
        /* Set the padding in the INNER div for all other browsers. */ 

  #innerdiv {    
      padding: 10px 5px 5px 10px !important;  
      padding: 0px; 
   } 
Then add the "innerdiv" ID to the inner DIV around the <%TOPIC_TEXT%> variable, like this:

Code: Select all

<div id="idcontent"><div id="innerdiv"> 
<%TOPIC_TEXT%> 
</div></div> 
Really solving the width problem in MSIE and CHM:

The values used in these DIVs only really achieves a compromise solution for the "width problem" in MSIE and CHM. When a topic contains a wide graphic and/or table that extends beyond the window border, text in other paragraphs will still just touch the window border, particularly when the user resizes the window. The solution for this is to change the right border padding value for MSIE in the #idcontent block to 25px. However, this makes the right margin too large in all other topics.

The solution is to define an additional help window type in Project Properties - Help Windows. Then apply the same HTML template to this new window type and use the following values for the #idcontent block:

Code: Select all

  #idcontent {    
      width: 100%; 
      padding: 0px !important; 
      padding: 10px 25px 5px 10px; 
   } 
Then only use this version of the template in topics containing wide graphics etc. (Select it in the Help Window: field in the Topic Options tab.) If you do this you can also use a lower value for the right border for MSIE and CHM the standard version, like 15px or even 10px.
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.
vanwerkum
Posts: 192
Joined: Wed Oct 26, 2005 4:34 pm

Unread post by vanwerkum »

Using that latest template (July 15) with IE,

The topic header width is restricted if there is a vertical scrollbar. This effectively moves the location of the Top, Previous, Next links if swapping between a page with a vertical scrollbar and one without.
You do not have the required permissions to view the files attached to this post.
Last edited by vanwerkum on Mon Jul 17, 2006 5:33 am, edited 1 time in total.
User avatar
Tim Green
Site Admin
Posts: 23156
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Unread post by Tim Green »

Van,
vanwerkum wrote:The topic header width is restricted if there is a vertical scrollbar. This effectively moves the location of the Top, Previous, Next links if swapping between a page with a vertical scrollbar and one without.
I can't confirm this. This is a typical phenomenon if the code is not set up right -- my guess is that you "integrated" the code in your own template rather than overwriting your existing template with the new one. In particular, it's very important that the call to nsrInit at the end of the template really comes right before the closing </body> tag.

I've just updated the version in this posting to reflect the final version in the new thread, by the way. The change affects the nsrInit call down at the bottom of the template, replacing this code:

Code: Select all

<IF_TOPIC_HEADER><script type="text/javascript">
<!--
    nsrInit();
--> 
</script></IF_TOPIC_HEADER>
with this:

Code: Select all

<IF_TOPIC_HEADER><script type="text/javascript">
<!-- 
var lastSlashPos = document.URL.lastIndexOf("/") >
document.URL.lastIndexOf("\") ? document.URL.lastIndexOf("/") :
document.URL.lastIndexOf("\");
if( document.URL.substring( lastSlashPos + 1, lastSlashPos + 4
).toLowerCase() != "~hh" )
{
    nsrInit();
}
-->
</script></IF_TOPIC_HEADER>
Without this change, if you try to print multiple topics (i.e. and entire chapter) in HTML Help you will have to click away a script error for every topic you want to print before you can print.
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.
vanwerkum
Posts: 192
Joined: Wed Oct 26, 2005 4:34 pm

Unread post by vanwerkum »

Tim,

I used your code unmodified. I am using IE 6.

HTML Help output is OK. The problem is only with Browser-based Help.
User avatar
Tim Green
Site Admin
Posts: 23156
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Unread post by Tim Green »

Van,
vanwerkum wrote:I used your code unmodified. I am using IE 6.
It works perfectly on IE6 with BB Help (also in IE7, I just checked it). I suspect some problem with your output. Try the following
  1. Clear the cache in your browser. You may be viewing left-over parts of a previous build with other templates, and that would confuse the issue.
  2. Do a clean compile of the new version, either to an empty folder or by using the "Delete all files in target folder" option in the Compile dialog. This will make sure that you are not viewing files left over from an old compile.
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.
Post Reply