|
25 Years of Programming
An open source source for C, C++, OWL, BASIC, MDB, XLS, DOT, and more... |
Home Projects Sitemap Search Blog Forum+Chat About Us Privacy Terms of Use Feedback FAQ Images Services Payments Humor |
Convert FrontPage 2003 webbot shared borders, link bars, and themes to include pages, HTML link bars, and CSS - Part 1The articles in this series are:
This series of articles describes in detail how to convert several FrontPage ways of doing things to more standard and portable methods. In addition, they explain how some of the webbots work. Reading those explanations will probably give you a better understanding how to work with all webbots, even ones that aren't yet discussed here individually. IntroductionMicrosoft FrontPage 2003 is a big help for a beginning webmaster because it has simple WYSIWYG and fill-in-the-dialog-box "webbot" methods for doing things for which the HTML methods aren't obvious. As it turns out, though,
FrontPage webbots are automated HTML code generators. There's no hidden magic. FrontPage manipulates the HTML in your documents, and that is something you can do yourself, with or without its help. At least three of the FrontPage webbots, "Include Page", "Substitution", and "Table of Contents" (or "Outline"), which put text into a document at the time the file is saved, are useful and reliable, and there is no particular reason to remove them unless you plan to switch from FrontPage to another web design program or you want more flexibility than the webbot's automated methods provide. However, there are good reasons to remove some of the other webbots from your site:
The procedures below require that you be comfortable working with HTML in FrontPage "Code View", and some steps will require that you use your own judgment, so you need to have sufficient experience for your judgment to be useful. Test each step on a single page first, to make sure it does what you expect, and proceed carefully. Most important, make a backup of your entire site before starting. Removing FrontPage Shared BordersShared Borders are unstable. No website should use them. Even Microsoft itself tries to discourage their use by having support for them disabled by default in a new FrontPage installation. The last straw for me was when FrontPage spontaneously replaced all my shared border files with blank HTML files. Shared borders should be replaced with "includes".
There are Step by step procedureThe FrontPage shared borders are stored in a folder called _borders. The first step for the conversion is: 1) Create a new folder in your site.You could call it borders. Three rules about working with folders in FrontPage:
FrontPage thinks that it, not you, owns any folder whose name starts with an underscore. It will manage the folder and its contents in whatever way it thinks is necessary. It may delete the folder or modify or delete its files at any time and without notifying you. The backup website copy is your insurance against unwelcome surprises. 2) Copy all the files from _borders to borders.When you turn off shared borders, FrontPage will delete the files in /_borders, but you'll still have them, in your own /borders folder. Read this Note before doing the copy: If your border files contain no references to any other files in the _borders folder (which is probably the case), then you can copy them directly from \_borders to \borders in the FrontPage Folder List pane. If the files do contain references to other files, or if you are unsure, you should use a roundabout copying method: When you copy files in FrontPage, FrontPage automatically adjusts all hyperlinks so they continue to point to the correct targets. However, if you are also copying the target files to a new location, you don't want the hyperlinks automatically adjusted. For example, if a file that is in \_borders refers to another file in \_borders, and you copy both files to the new \borders folder, the references in the first file will be adjusted so that they continue to point into \_borders as they did previously. That's not what you want. You want the hyperlinks to be left alone so they point to the new version of the target file in \borders. The way to accomplish this is:
When files are copied this way, hyperlinks are not adjusted.
3) Convert your Top and Bottom borders to include filesTo get an idea how this works, on one of your pages,
You will need to do this for all your pages. This sounds like a real pain, but you don't have to use that method for all the pages. On the page you've just done, you can see what the result was. FrontPage inserted this: <!--webbot bot="Include" U-Include="borders/top.htm" TAG="BODY" --> Now that you have that text, you can copy it and use FrontPage's excellent Find and Replace feature to do whole batches of pages at once. I started at the top of my site and did an entire folder at a time. The only trick is to make sure you get the correct relative path name on each one, such as "borders/top.htm", That's why it helps to do a whole folder at a time, because it will be the same for all the files in each folder. Open all the files in the folder, then use Find and Replace on "Open page(s)". Your find and replace strings will be something like this: Find: <body> and Replace with: <body> Tip: to enter the line break in the Replace box, use Shift+Enter. Here's what a page might look like after this procedure: <body> <p>Page content goes here</p> <!--webbot bot="Include" U-Include="borders/bottom.htm" TAG="BODY" --> <h5>Copyright ©<!--webbot bot="TimeStamp" s-type="EDITED" s-format="%Y" --> Steven Whitney. Last modified <!--webbot bot="TimeStamp" s-type="EDITED" s-format="%m/%d/%Y" -->.</h5> </body> The example shows an extra item that I found useful to put between the bottom border and the closing </body> tag: the copyright notice. It previously had been inside the shared bottom border. However, when it's inside a shared border, it shows the last date the border was changed, which is useless. Moving it out of the border file and into the page makes it show the date the page was changed. A convenient placement for your Google Analytics code is inside the bottom border file (bottom.htm). In the example above, that would put it on the page above the copyright notice instead of just before the </body> tag as Google recommends, but it doesn't matter. It is near enough the bottom of the page that it works fine. 4) Move Left and Right border content into tables The left and right borders are trickier to convert because you must essentially put all your page content into an HTML table that has the borders you want. You'll still be able to use include files for the contents of the borders, but setting up the tables is a manual job that must be done on each page. It's not that complicated, though, once you have the table template you want to use. Here's a hypothetical table template that could be used for the conversion. The <body> tag and the include webbots for all the borders are shown so you can see where things go in relation to each other: <body> <!--webbot bot="Include" U-Include="borders/top.htm" TAG="BODY" --> <table cellpadding="0" cellspacing="10" width="100%"> <!-- MSTableType="layout" --> <tr> <td valign="top" align="left" width="1%"> <!--webbot bot="Include" U-Include="borders/left.htm" TAG="BODY" --> </td> <td valign="top" align="left" width="100%"> Page content goes here. </td> <td valign="top" align="left" width="1%"> <!--webbot bot="Include" U-Include="borders/right.htm" TAG="BODY" --> </td> </tr> </table> <!--webbot bot="Include" U-Include="borders/bottom.htm" TAG="BODY" --> </body> To omit the left or right border, delete the <td></td> tags that define it, and everything between them. The basic structure of an HTML table like the one above is:<table><!-- MSTableType="layout" --> <tr> <td> </td> <td> </td> <td> </td> </tr> </table>
The other text inside the tags are properties. Explanations of some of the non-obvious ones above: Table properties:
Table Data properties for both border columns:
Table Data properties for the main content (middle) column:
4a) The procedure for converting each page is:First, create the template text for your table, similar to the above. Make it as complete as possible to save yourself typing. Store it somewhere that you can retrieve it repeatedly. Then...
Once you have added the code for your top and bottom borders, and added the tables to hold your left and right borders, you should now see duplicates of every border when you preview your pages. 5) Last step is to remove the FrontPage shared borders and leave only your own:
You have removed all your shared borders. Now when you preview your pages, you should only see one of each border. The above steps probably left in the <head> section of your pages this line: <meta name="Microsoft Border" content="none"> To remove this line from all the files in your site and also turn off FrontPage support for Shared Borders:
Notes about include files
|
|
|
|
|