| Avoiding Link Path Problems |
HTML includes a number of tags where one file contains a reference to another file. Some of these include:
In all the above examples, the code is correct, and will work both in e-books (created for example with Activ E-Book Compiler) or in web sites, provided the file containing the HTML fragment and the file being referenced are placed in the same folder.
- The HTML Anchor Tag, used to add hyperlinks between pages.
<A HREF="page2.htm">Page 2</A> The above is a hyperlink that goes from the current file, to another file, in this case, one called page2.htm
- The SRC= parameter used in the HTML IMG tag (to display images), and BACKGROUND= which can be used in various TABLE tags and the BODY tag (used to set the background for the table or entire page)
<TABLE COLS="1" CELLPADDING="0" CELLSPACING="0" BORDER="0" RULES="NONE" BACKGROUND="picture.jpg">
- Various other tags which reference another file, such as the SRC= attribute in the FRAME and IFRAME tags (used to say which file will be loaded into a frame), the SRC= attribute in the SCRIPT tag (used to give the name of a file containing script code), and many other tags too.
But will your HTML editor get in right?
All the above is fine and dandy, you insert the code, put the files in the right place, and hey presto everything is working.
Unfortunately some HTML editor programs (including some of the brand name HTML editors) have a tendency to code these references to other files in an incorrect way. Rather than just inserting the file name, they can insert a reference to a specific folder on your computer.
Examples of errors (there are many other possible variations):
<A HREF="file:///c:/workingfolder/page2.htm">Page 2</A> This type of incorrect HTML code can cause major confusion for both e-book and web site authors.
<A HREF="c:\workingfolder\page2.htm">Page 2</A>
Web Site Problems Caused By This
When you view your web pages on your computer, everything seems to work, at least more or less. The links seem to go to the right page (provided you don't look at the browser address bar too closely), and the images are present.
However, the only reason this type of code might seem to work is that you have the files in the particular named folder on your computer. When somebody else views your web site, they will experience missing images, broken links, etc.
E-Book Problems Caused By This
When you view your e-book pages on your computer, once again everything seems to work at least more or less.
If you look closely you may spot some problems:
Why? Because after following one of the incorrectly coded links, you aren't viewing pages inside the e-book any more, but instead are viewing the files from your working HTML folder ("source folder").
- The Next and Previous buttons (if enabled) in Activ E-Book Compiler won't work after following one of these incorrectly coded links.
- Activ E-Book Compiler's PreProcessor and Rebrander may seem as if they are not operating correctly.
- The Status Bar and Tooltips which give destination information about where links lead, can give incorrect or confusing results.
Worse yet, if somebody else views an e-book containing one of these incorrectly coded links, they will experience missing images, broken links etc. Because, as with the web site example, their computer won't have the same named folder containing HTML files as yours does.
It's Easy To Fix
At the most basic level the solution is simple: Remove the path information which references particular named folders from your HTML files, then re-upload your web pages, or re-Build your e-book.
If you have a good search utility (at a pinch you can use Find on the Windows' Start menu), it's easy to locate which of your files, if any, have this type of HTML coding problem. Do a search of all files in your working folder ("source folder") for file:, and then another search for C: (or D: if you work on the D: drive etc.). If either of these searches find a match, you might have this problem...
<A HREF="file:///c:/workingfolder/page2.htm">Page 2</A> to
<A HREF="page2.htm">Page 2</A>
<A HREF="c:\workingfolder\page2.htm">Page 2</A> to
<A HREF="page2.htm">Page 2</A>
<IMG SRC="file:///c:/workingfolder/picture.jpg"> to
<IMG SRC="c:\workingfolder\picture.jpg"> to
Once you've located the problem files, load up each candidate HTML file in a plain text editor (such as DOS EDIT or Notepad) and use the Find option to locate the problematic code, make the change, and you're done.