<%HREF_CURRENT_PAGE%>

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
Martin Wynne
Posts: 2656
Joined: Mon May 12, 2003 3:21 pm
Location: West of the Severn, UK

<%HREF_CURRENT_PAGE%>

Unread post by Martin Wynne »

Hi Tim,

Can you clarify use of the variable <%HREF_CURRENT_PAGE%>?

When using EWriter V2 skins and earlier skins, or no skin, this variable returns id.htm

When using the V3 Responsive skins, this variable returns id.html

For example in page templates and inserted HTML Code Objects. I'm using a V2 skin in EWriter and including an external link to the corresponding Webhelp page which uses a V3 skin. So I have it in the old format

Code: Select all

/index.html?<%HREF_CURRENT_PAGE%>
which displays as .htm and works fine. When clicked the V3 Webhelp redirects to /id.html in the new URL scheme.

My question is -- is this .htm return of the variable and re-direction in the skin a transitional feature for HM7, or will it be maintained for always and forever in future versions of H&M?

Or is there an alternative variable, say, <%HREF_CURRENT_PAGE_HTML%> which always returns id.html and should now be used in preference?

Are any other H&M variables modified by the skin?

regards,

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

Re: <%HREF_CURRENT_PAGE%>

Unread post by Tim Green »

Hi Martin,

The variable returns the actual current filename of the current page. In the V3 skins the extension is set to .html, so that is what you get. In the V2 skins you probably have the topic file extension set to .htm in your project's HTML Export Options, so that is what you get 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
Martin Wynne
Posts: 2656
Joined: Mon May 12, 2003 3:21 pm
Location: West of the Severn, UK

Re: <%HREF_CURRENT_PAGE%>

Unread post by Martin Wynne »

Tim Green wrote:The variable returns the actual current filename of the current page. In the V3 skins the extension is set to .html, so that is what you get. In the V2 skins you probably have the topic file extension set to .htm in your project's HTML Export Options, so that is what you get there.
Hi Tim,

Yes, I did know that. But the .html extension setting in HTML Export Options isn't honoured in EWriter, it is always .htm in EWriter, regardless.

I assumed this is by design, but maybe it is a bug?

At present it doesn't matter. I'm creating a link in EWriter to a topic in V3 Webhelp which works with either the new URL scheme or the old. What I'm asking is whether that will always be the case in future versions? Or will the old URL scheme (index.html?id.htm) eventually be deprecated and phased out?

regards,

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

Re: <%HREF_CURRENT_PAGE%>

Unread post by Tim Green »

Hi Martin,

I'll check with Alex on the file extensions in EWriter. I can imagine this is by design, since everything is internal there in the same way as in a CHM, and it makes everything easier if you are working with known quantities.

The old URL scheme will continue to be used in the WebHelp 2 skins since they physically need it and don't work correctly without it. As far as WebHelp 3 goes, the URL parser in the V3 skins will currently work with both index.html?topic.htm and index.html?topic.html -- I covered both cases. In the long term I'd like to remove it, obviously, to eliminate the code overhead and associated potential for unnecessary errors. I'm not planning that any time soon, but I still wouldn't depend on it being there forever. It's really only there to cover existing old links; if you're creating new links always use the new simplified syntax. 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
Alexander Halser
EC-Software Support
Posts: 4098
Joined: Mon Jun 24, 2002 7:24 pm
Location: Salzburg, Austria
Contact:

Re: <%HREF_CURRENT_PAGE%>

Unread post by Alexander Halser »

The ".htm" extension is currently fixed. But we could take the default extension from the Webhelp output and allow both variants, ".htm" and ".html". It needs to be one of those two for the internal web server in the viewer application.
Alexander Halser
Senior Software Architect, EC Software GmbH
User avatar
Martin Wynne
Posts: 2656
Joined: Mon May 12, 2003 3:21 pm
Location: West of the Severn, UK

Re: <%HREF_CURRENT_PAGE%>

Unread post by Martin Wynne »

Tim Green wrote:if you're creating new links always use the new simplified syntax.
Yes Tim, but...

In EWriter <%HREF_CURRENT_PAGE%> always returns the .htm extension.

3rd attempt to explain what I'm doing. :)

From my project I am creating both EWriter help (using a V2 skin) and Webhelp (using a V3 responsive skin). The content is largely identical apart from a few conditional differences (e.g. the video file format).

I'm creating links in EWriter to open the same topic page in Webhelp on the user's browser. I can do this now that my app can fetch updated EWriter data packages from the server -- it means that I can keep the Webhelp and the embedded EWriter help always in sync.

Generally users prefer EWriter (if only for the much easier-to-use keyword index in V2), but may wish to swap to the same page in Webhelp for various reasons, e.g. they prefer the responsive design, perhaps on a smallish screen; they want to be be able to copy a page link for posting on the forum or in emails to friends; they are not happy to be viewing the help in IE and prefer Firefox (e.g. for F7 caret browsing and keyboard copying); etc.

But I can't use the new V3 simplified URLs for these links because in EWriter <%HREF_CURRENT_PAGE%> always returns the .htm extension.

However, I have now got round this issue by using

Code: Select all

/<%TOICID%>.html
for the links. This creates the new-format URL for future compatibility and is much easier to read for users. :D

The only downside is the need to ensure that the topic ID matches the file name exactly, i.e. all lower case and underscores only. I always manually modify the auto-generated topic IDs to ensure this is the case, but I just need now to go back and double check that I have done all of them. I'm still mourning the one and only H&M6.x version which used to do this automatically -- I never could understand why it was changed, but we don't want to fight that battle again. :(

regards,

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

Re: <%HREF_CURRENT_PAGE%>

Unread post by Tim Green »

Hi Martin,

OK, got -- and you seem to have it sorted now. And seeing Alex' response you should have the option to use .html in eWriter sometime soon as well. 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
Martin Wynne
Posts: 2656
Joined: Mon May 12, 2003 3:21 pm
Location: West of the Severn, UK

Re: <%HREF_CURRENT_PAGE%>

Unread post by Martin Wynne »

Tim Green wrote:OK, got -- and you seem to have it sorted now.
Hi Tim,

Yes, and rather late in the day I've realised that simply adding an l

Code: Select all

/<%HREF_CURRENT_PAGE%>l
does exactly what I wanted all along, and avoids any worries about the topic ID not matching the file name. :frustration:

Truly my brain is wearing out. 30 years ago I would have twigged that solution immediately. Time to give up? :(

Martin.
Post Reply