1. As you know frames contain 2 sets of HTML pages.
(i) Framesets that specify when the frames are placed and what is initially in them. These are pages that contain the <FRAMESET...> </FRAMESET> tags, and list the initial contents of each frame in the <FRAME...> tags
(ii) The contents of each frame, the initial contents being given by the SRC= parameter for the FRAME tag in (i)2. There are two very general issues with frames on web sites
ISSUE #A: If you go to a search engine (like Google or Altavista or something) amd search, it can potentially find pages of both type (i) and (ii). If you click on a link to a page of type (i) then the frameset gets loaded and everything is as you might expect. However if you click on a link to a page of type (ii), then the browser only loads that particular frame, and the other framed elements are missing.
ISSUE #B: Additionally a problem with frames, is that if you go to a page of type (i), then URL is the URL of the frameset and doesn't change even if individual frames are are updated. This can cause a few issues, for example bookmarking framed sites. For example, try:
- Go to a web site frame site that uses frames
- Make a note of the URL
- Navigate around the site to update individual frames. You should notice the URL doesn't change (some sites attempt special code to handle this with varying degrees of succss, but the vast majority don't).
- If you place a bookmark after updating the frames content, close the browser, and return to the bookmark. it will go to the initial frame content (where you started on the site), rather than reloading where the individual frames are
Both these problems are essentially design problems of the HTML FRAME tag, which is one of the reasons, why I personally am not a big fan of frames, but that's another story.
3. The issues with frames on **web sites** in 2 are difficult to completely solve, although some people try using JavaScripts, etc.
Essentially the same issues can arise in an e-book made using Activ E-Book Compiler. However it in an e-book it is possible to solve using some extra work
There are 4 areas to address in an e-book
(i) Solving the ebook search issue.
If you do a niaive attempt at frames in an e-book and enabling searching, when you search, you will see the same problem as issue #2A
This can be solved:
- Make an extra frameset page for each possible combination of frame contents that can potentially appear in the search results
- Add title, and optionally description + keywords in the Files tab in the compiler for the frameset pages. If you want to add a searchable text in the frameset, a good place would be using NOFRAMES tag.
- Turn ON the searchable attribute for each frameset page in the Files tab
- Turn OFF the searchable attribute for each individual frame content page in the Files tab.
(ii) Table Of Contents
Essentially the same issue as #2A
This would apply to System Generated TOC, and the Popup list on the Contents button if enabled. Essentially the same solution as 3 (i) - create extra frameset pages, except we are now talking about the Contents attribute.
In other words:
- Make an extra frameset page for each possible combination of frame contents that can potentially appear in these places
- Add title, and optionally description + keywords in the Files tab in the compiler for the frameset pages
- Turn ON the Contents attribute for each frameset page in the Files tab
- Turn OFF the Contents attribute for each individual frame content page in the Files tab.
If you use "My Own Page" for TOC, then what you want to do is use TARGET=_top and link to the framesets rather than updating individual frames. More on this in the next part
(iii) Navigation, Bookmarks, Next+Previous
This is similar to issue #2B
The current URL is the URL of the frameset, and doesn't contain any info on what is loaded into each frame
For Navigation, it would be best to link use TARGET=_top to a new frameset and update the frameset + URL this way. If you don't do this, it would cause a knock on problem forBookmarks + Next/Previous
Bookmarks. The simple bookmark script I have published, I have said "won't work with frames"... actually it will if you make sure the frameset is updated when you load a new page. Use this TARGET=_top and linking to new framesets as you navigate around would do that.
Next/Previous. Same problem again, plus 2A mixed in.
- if you don't update the frameset as you navigate around (by TARGET=_top and linking to framesets) then Next/Previous will think you are on the URL on the initial frameset. This is like 2A. Solution is to use TARGET=_top and link to framesets
- Next/Previous determines what is next/previous by looking at the current URL and looking at which files have the contents attribute. So to make sure they lead to the right page, follow the instructions under 3(ii)
4. ALTERNATIVE SOLUTIONS
If you must use frames then you need to use the somewhat convoluted solution above (it's not really hard, just extra work) to get a total solution.
There are two main reasons why people use frames, and for many people an easier solution can come from using a different approach to these reasons
Reason #1
- People use frames to provide a navigation bar or menu on each page
Alternative solution:
- Use tables to layout your page
- In the table cell that is analagous to your frame navigation bar, put in links to each page
either using cut and paste,
or using the Include HTML Fragment Include Activ Variable and PreProcessor.. You can make a separate file containing the code for the menu, and then include it with one line
or make a separate HTML file containing just the menu links (don't forget to use TARGET=_top) and use IFRAME to include it. Do not forget to make sure the source file for the iframe has the Contents and Searchable attributes unchecked or otherwise you re-introduce problem #2A.
Reason #2
- People use frames to grab content of a web site (like banner code) and show it along side e-book content. Use IFRAME to do this instead of making the whole page a frameset. Again do not forget to make sure the source file for the iframe has the Contents and Searchable attributes unchecked or otherwise you re-introduce problem #2A.
A note of IFRAMEs
On web sites many people advise you not to use or depend on IFRAMES. The reason is IFRAMEs work only on some browsers: namely IE (i think since version 3 but am not certain, it definitely is in version 4 and later), and Netscape 6 and later.
In e-books, this issue doesn't arise, IFRAMEs will work on all systems that Activ E-Book Compiler and the e-books run on.