Custom HTML page instead of Navigation frame
Moderators: Alexander Halser, Tim Green
-
- Posts: 38
- Joined: Tue Jun 07, 2011 10:03 am
Custom HTML page instead of Navigation frame
Is it possible to have a custom HTML page displayed instead of the Navigation frame?
Is it possible to put an IF expression in the Layout of a skin, so that the Navigation page is replaced with a custom HTML page only with a certain user-defined build?
Is it possible to put an IF expression in the Layout of a skin, so that the Navigation page is replaced with a custom HTML page only with a certain user-defined build?
- Tim Green
- Site Admin
- Posts: 23189
- Joined: Mon Jun 24, 2002 9:11 am
- Location: Bruehl, Germany
- Contact:
Re: Custom HTML page instead of Navigation frame
Hi Alexey,
In addition to this there is a very useful undocumented feature that enables you to insert the contents of files stored in the Baggage Files section in templates. You use it like this:
This inserts the entire contents of the referenced file in the template, replacing this line of code with the contents of the file. You can use both variables and conditions in the baggage file, they are all processed on inserting. You must make sure that the baggage files are not exported when you do this, because they just need to be used as source files. So set their include options to "none" in the baggage files section. Also note that if you are inserting javascript or CSS the file must include the necessary start and end tags -- for example <script type="text/javascript">...</script> for javascript code and <style type="text/css">...</style> for CSS code.
This is a very powerful feature, because it allows you to store entire blocks of template code in the baggage and replace it with conditions (you can put conditions around the HMINCLUDE statement as well, of course...)
You can edit everything in all the templates in the WebHelp layout. The templates are all in the Configuration > Publishing Options > WebHelp section in the Project Explorer. The main index.html page is generated by the Layout template. This contains the definitions of the frames and the references to the pages that are loaded into them. The other pages that are loaded into these frames are defined by the Table of Contents, Keyword Index and Full Text Search templates. Then there is the topic page template(s) which define(s) the topics that are loaded into the topic frame.Is it possible to have a custom HTML page displayed instead of the Navigation frame?
Absolutely. You can use IF conditions in templates just as you can anywhere else. They just have a slightly different syntax, see this topic in the help for details.Is it possible to put an IF expression in the Layout of a skin, so that the Navigation page is replaced with a custom HTML page only with a certain user-defined build?
In addition to this there is a very useful undocumented feature that enables you to insert the contents of files stored in the Baggage Files section in templates. You use it like this:
Code: Select all
<HMINCLUDE:hmphone.js>
This is a very powerful feature, because it allows you to store entire blocks of template code in the baggage and replace it with conditions (you can put conditions around the HMINCLUDE statement as well, of course...)
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.
Tim (EC Software Documentation & User Support)
Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
-
- Posts: 38
- Joined: Tue Jun 07, 2011 10:03 am
Re: Custom HTML page instead of Navigation frame
I tried to to generate a webhelp with a custom page.html loaded into the navigation frame for TEST_BUILD. For this, I opened the Layout source code in the skin file and changed this line:Tim Green wrote:Hi Alexey,
You can edit everything in all the templates in the WebHelp layout. The templates are all in the Configuration > Publishing Options > WebHelp section in the Project Explorer. The main index.html page is generated by the Layout template. This contains the definitions of the frames and the references to the pages that are loaded into them. The other pages that are loaded into these frames are defined by the Table of Contents, Keyword Index and Full Text Search templates. Then there is the topic page template(s) which define(s) the topics that are loaded into the topic frame.Is it possible to have a custom HTML page displayed instead of the Navigation frame?
Absolutely. You can use IF conditions in templates just as you can anywhere else. They just have a slightly different syntax, see this topic in the help for details.Is it possible to put an IF expression in the Layout of a skin, so that the Navigation page is replaced with a custom HTML page only with a certain user-defined build?
Code: Select all
<frame name="hmnavigation" id="hmnavigation" src="<%HREF_CONTENT_PAGE_STATIC%>" title="Navigation frame" scrolling="yes" />
Code: Select all
<IFNOT_TEST_BUILD>
<frame name="hmnavigation" id="hmnavigation" src="<%HREF_CONTENT_PAGE_STATIC%>" title="Navigation frame" scrolling="yes" />
</IFNOT_TEST_BUILD>
<IF_TEST_BUILD>
<frame name="hmnavigation" id="hmnavigation" src="page.html" title="Navigation frame" scrolling="yes" />
</IF_TEST_BUILD>
I also tried to delete the line with the Navigation frame completely, but that also doesn't work. So my guess is that the frame is declared elsewhere?
- Tim Green
- Site Admin
- Posts: 23189
- Joined: Mon Jun 24, 2002 9:11 am
- Location: Bruehl, Germany
- Contact:
Re: Custom HTML page instead of Navigation frame
Hi Alexey,
You are probably using a skin. If you do that you need to edit the skin, not your project, because the skin replaces all the templates in your project with those in your skin. You can open and edit skin files just like normal projects, everything is in the same place (actually, they are projects, just without topics and some other sections). Select Open and then select .hmskin as the file type to open in the Open dialog.The syntax looks correct, I have page.html in the same folder as index.html for the output, but it doesn't work. The TOC is still displayed as usual. What am I missing?
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.
Tim (EC Software Documentation & User Support)
Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
-
- Posts: 38
- Joined: Tue Jun 07, 2011 10:03 am
Re: Custom HTML page instead of Navigation frame
No, Tim, I've been changing the skin file. Does it understand builds which are only defined in the project or do I need to create a similar build in the skin file?
For my example, I have TEST_BUILD defined in the project file only. It is not present in the skin.
For my example, I have TEST_BUILD defined in the project file only. It is not present in the skin.
- Tim Green
- Site Admin
- Posts: 23189
- Joined: Mon Jun 24, 2002 9:11 am
- Location: Bruehl, Germany
- Contact:
Re: Custom HTML page instead of Navigation frame
Make sure that the custom build is defined in the skin if you are using it in the skin template.
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.
Tim (EC Software Documentation & User Support)
Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
-
- Posts: 38
- Joined: Tue Jun 07, 2011 10:03 am
Re: Custom HTML page instead of Navigation frame
It looks like that was the problem. I thought that the skin uses project builds in addition to its internally defined builds when publishing the project.
-
- Posts: 38
- Joined: Tue Jun 07, 2011 10:03 am
Re: Custom HTML page instead of Navigation frame
I tried to delete the line where the navigation frame is declared and I still get the TOC displayed.
-
- Posts: 38
- Joined: Tue Jun 07, 2011 10:03 am
Re: Custom HTML page instead of Navigation frame
Here is what I am trying to do:
I have two webhelps which are generated from one project using a single PP skin. Each has a designated custom build. I also need to generate a "landing page" from which I the user can select to open either Webhelp A or Webhelp B. So what I did is added a hidden topic (named "index") and included it into the standard Webhelp build (so that's build named HTML). I generate this build to /webhelp/index.html using a single-frame skin (not a PP skin). Then I generate the two webhelps into /webhelp/webhelp_a/index.html and /webhelp/webhelp_b/index.html. The links from the "landing page webhelp" are relative so they point to the index pages of the two main webhelps.
This works, but I thought it would be easier to use the same skin for all three builds. So what I want is, when I generate build HTML, so that it would not use the TOC at all, but load a custom page inside the navigation frame. Then I can have index.html displayed in the main contents frame (this would contain links to the two main webhelps) and a custom page.html displayed in the navigation frame instead of the TOC (this would contain some additional useful external links and stuff).
Doing this didn't help:
I still have tan empty TOC displayed in the navigation frame although it obviously should load page.html into it.
I have two webhelps which are generated from one project using a single PP skin. Each has a designated custom build. I also need to generate a "landing page" from which I the user can select to open either Webhelp A or Webhelp B. So what I did is added a hidden topic (named "index") and included it into the standard Webhelp build (so that's build named HTML). I generate this build to /webhelp/index.html using a single-frame skin (not a PP skin). Then I generate the two webhelps into /webhelp/webhelp_a/index.html and /webhelp/webhelp_b/index.html. The links from the "landing page webhelp" are relative so they point to the index pages of the two main webhelps.
This works, but I thought it would be easier to use the same skin for all three builds. So what I want is, when I generate build HTML, so that it would not use the TOC at all, but load a custom page inside the navigation frame. Then I can have index.html displayed in the main contents frame (this would contain links to the two main webhelps) and a custom page.html displayed in the navigation frame instead of the TOC (this would contain some additional useful external links and stuff).
Doing this didn't help:
Code: Select all
<IFNOT_HTML>
<frame name="hmnavigation" id="hmnavigation" src="<%HREF_CONTENT_PAGE_STATIC%>" title="Navigation frame" scrolling="yes" />
</IFNOT_HTML>
<IF_HTML>
<frame name="hmnavigation" id="hmnavigation" src="page.html" title="Navigation frame" scrolling="yes" />
</IF_HTML>
-
- Posts: 38
- Joined: Tue Jun 07, 2011 10:03 am
Re: Custom HTML page instead of Navigation frame
OK, I know nothing about JS but I managed to find a solution. In a script at the beginning of the Layout source code there is a variable named hmContents which is set to the content page. So I changed the declaration of this variable to:
It helped!
Code: Select all
<IFNOT_HTML>var hmContents = document.getElementById ? "<%HREF_CONTENT_PAGE_DYN%>" : "<%HREF_CONTENT_PAGE_STATIC%>";</IFNOT_HTML>
<IF_HTML>var hmContents = "page.html";</IF_HTML>