Date stamp in WinHelp output

Please post all questions and comments regarding Help & Manual 7 here.

Moderators: Alexander Halser, Tim Green

Date stamp in WinHelp output

Unread postby Dave Gehman » Mon Feb 19, 2018 7:21 pm

How do I go about showing a date stamp or a version stamp in the page header of WinHelp? Right now, we mean the date or version of the help file. Later we'll want the program version number (that is, the program for which the help file exists).

Or in any upper part of page real estate, if the header cannot be invaded in this way?
Dave Gehman
 
Posts: 252
Joined: Sat Sep 23, 2017 9:05 pm

Re: Date stamp in WinHelp output

Unread postby Dave Gehman » Wed Feb 21, 2018 1:33 pm

How do I go about showing a date stamp or a version stamp in the page header of WinHelp?


Anyone?
Dave Gehman
 
Posts: 252
Joined: Sat Sep 23, 2017 9:05 pm

Re: Date stamp in WinHelp output

Unread postby Tim Green » Wed Feb 21, 2018 1:44 pm

Hi Dave,

There are a lot of variables you can use for this:

https://helpandmanual.com/help/index.ht ... global.htm

You can also define your own variables. See the rest of that chapter for details on how to use them. Basically pretty much anywhere -- you can use the Variables tool in the topic editor but that is just a convenience. You can also type variables in, using the syntax <%VARIABLE_NAME%>. In your topics it's easy. In WebHelp -- it depends where you want to put the information.

Generally speaking, you can use variables in HTML templates . However, there are restrictions on their use in the HTML topic page templates in V3 skins. That is because what is in the template is not part of the topic content that gets swapped out when you browse from one topic to another in V3 WebHelp. So if you put a variable in the topic page template there, one of two things will happen: Either it will disappear when the user browses to another topic, or it will stay put and retain the data of the original page the user visited. The bottom line here is, in V3 you can't use topic-based variables in the topic page template that need to change when the topics change and display data from each topic dynamically. At the moment, if you want topic page variables that are different for every topic you need to insert them in the topic itself in the project, not in the template. You can do that automatically for new topics by creating a topic content template:

https://helpandmanual.com/help/index.ht ... ontent.htm

We may add support for dynamic topic variables in V3 later, but it also needs to be supported by Help+Manual itself so that it integrates when the WebHelp is actually published with the skin.
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
Tim Green
Site Admin
 
Posts: 19992
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany

Re: Date stamp in WinHelp output

Unread postby Dave Gehman » Wed Feb 21, 2018 2:41 pm

Tim Green wrote:Generally speaking, you can use variables in HTML templates....


Thanks. We need only <%VERSION_BUILD%> to appear in the running header at the top of all topics.

What I'm not clear on is how / where to insert this variable. Right now, I'm using a V2 skin, WebHelp_SlateGrey.hmskin. Is it perhaps HM_HEADERBOX.html - and something like inserting
Code: Select all
"V." <VERSION_BUILD>
... but I'd like it at the bottom of the header box at the right: what's the incantation to make this positioning happen?

Plus, it looks as though we'll be moving to a V3 for the responsive features. Is there a HM_HEADERBOX.html in every skin, every version?
Dave Gehman
 
Posts: 252
Joined: Sat Sep 23, 2017 9:05 pm

Re: Date stamp in WinHelp output

Unread postby Tim Green » Wed Feb 21, 2018 3:17 pm

Hi Dave,

If you're just using the version and it's global for the entire project then that's fine in both V2 and V3.

Is it perhaps HM_HEADERBOX.html - and something like inserting

Yes, but you missed the formatting requirement for the variable name and left out the % characters. <VERSION_BUILD> won't work, but <%VERSION_BUILD%> will. Also, you can't insert just plain text in HTML. You need some tags to tell it what to do. Also, you could only put it at the bottom right in the header box if you turn off the drop-down menus there. Otherwise it will be on top of or behind the menus.

So if the menu is OFF you could do this (note that only the <p> and </p> tags and what is between them is what you add to what is already there):

Code: Select all
<a href="//www.ec-software.com/" title="EC Software Website" target="_blank"><img id="bannerlogo" src="background-logo.png" height="40" border="0" style="margin: 3px 0 0 3px"/></a>
<p style="position:absolute; right: 5px; bottom: 5px; text-align: right: white-space: nowrap;">Version <%VERSION_BUILD%></p>
<IF_OPT_3FRAMEMENU>

However, if the menu is on you need to put it at the top right of the box instead, like this:

Code: Select all
<a href="//www.ec-software.com/" title="EC Software Website" target="_blank"><img id="bannerlogo" src="background-logo.png" height="40" border="0" style="margin: 3px 0 0 3px"/></a>
<p style="position:absolute; right: 5px; top: 5px; text-align: right: white-space: nowrap;">Version <%VERSION_BUILD%></p>
<IF_OPT_3FRAMEMENU>

There is a HM_HEADERBOX.html in the V3 skins as well, but you may need to adjust the HTML a little there.
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
Tim Green
Site Admin
 
Posts: 19992
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany

Re: Date stamp in WinHelp output

Unread postby Dave Gehman » Wed Feb 21, 2018 4:02 pm

VERY much appreciated.

The %s apparently were stripped by the forum software in the Code formatting -- didn't notice that.
Dave Gehman
 
Posts: 252
Joined: Sat Sep 23, 2017 9:05 pm

Re: Date stamp in WinHelp output

Unread postby Dave Gehman » Wed Feb 21, 2018 9:21 pm

Tweaked some of the distances and made it work - thanks again.

A final question: the text appears in Times New Roman.

I expect the font name and style for the headerbox is somewhere in a CSS (and have no idea how to find it - or reference it). I'd like it to be the font used in the body of the Web-based help file, if that's possible... ?
Dave Gehman
 
Posts: 252
Joined: Sat Sep 23, 2017 9:05 pm

Re: Date stamp in WinHelp output

Unread postby Tim Green » Thu Feb 22, 2018 9:28 am

Add the font-family and optionally also font-size and color attributes to your style information in the code itself:

Code: Select all
<p style="font-family: Arial,Helvetica,Sans-Serif; font-size: 12pt; color: #000000; position:absolute; right: 5px; top: 5px; text-align: right: white-space: nowrap;">Version <%VERSION_BUILD%></p>

The first font in the list that the browser finds available on the user's computer will be used. Please only use web-safe fonts. See here on W3Schools for a list of web-safe fonts and color codes:

https://www.w3schools.com/cssref/css_websafe_fonts.asp

https://www.w3schools.com/cssref/css_colors.asp


W3Schools is the best general reference for things like this. Always check there first. 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
Tim Green
Site Admin
 
Posts: 19992
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany

Re: Date stamp in WinHelp output

Unread postby Dave Gehman » Thu Feb 22, 2018 1:15 pm

Thanks.

Didn't realize it was straight HTML coding right there in the baggage file.

Is there a way to tell where a given style setting is controlled (e.g., Configuration in the H+M project, CSS sheet somewhere in a skin, or directly on a given HTML baggage file)? Or a best practice for the process by which one can dig this info out?
Dave Gehman
 
Posts: 252
Joined: Sat Sep 23, 2017 9:05 pm

Re: Date stamp in WinHelp output

Unread postby Tim Green » Thu Feb 22, 2018 2:55 pm

Dave Gehman wrote:Didn't realize it was straight HTML coding right there in the baggage file. Is there a way to tell where a given style setting is controlled (e.g., Configuration in the H+M project, CSS sheet somewhere in a skin, or directly on a given HTML baggage file)? Or a best practice for the process by which one can dig this info out?

Not really. There are a number of ways to apply CSS formatting, and most of them are indirect. The only direct way is to put the CSS attributes inside the tag you are formatting with a style="" attribute, as I showed you there. In this case that would be the quickest way to do it, because you are creating the paragraph, so none of the CSS in the skin knows anything about your paragraph. You would have to either give it a known CSS class (class="") inside the tag, then you would get the formatting of that ID or class as defined in the CSS of the page, or invent your own ID or CSS class, but then you would have to both reference them in your paragraph tag and add your CSS definitions to the central CSS for the page, which is more complicated. That is why, in this case, I suggested you just add the formatting you want to have directly to the paragraph you are creating.
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
Tim Green
Site Admin
 
Posts: 19992
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany

Re: Date stamp in WinHelp output

Unread postby Dave Gehman » Thu Feb 22, 2018 3:06 pm

Again, many thanks. Simplest is best (except when it's not...) :)
Dave Gehman
 
Posts: 252
Joined: Sat Sep 23, 2017 9:05 pm

Re: Date stamp in WinHelp output

Unread postby Martin Wynne » Fri Feb 23, 2018 3:05 am

Hi Dave,

You have the wrong title on this topic. You mean WebHelp.

WinHelp is the old Windows .hlp format which used to be supported by H&M but is no longer, nor by Windows10. I was quite fond of it - certainly it was much better than the .chm format which we have been stuck with for 20 years.

cheers,

Martin.
User avatar
Martin Wynne
 
Posts: 2359
Joined: Mon May 12, 2003 3:21 pm
Location: West of the Severn, UK


Return to Help & Manual 7 Forum

Who is online

Users browsing this forum: No registered users and 3 guests