FrontPage contains a lot of built-in features that make your Web designing tasks a lot easier. You need only edit the HTML code in your pages when you choose to, for the most part, which makes this chapter nice and brief. No doubt, you've peeked behind the scenes and studied the code that FrontPage generates for you automatically. You feel you really have a handle on things and want to get your hands on the code to fine-tune it and tweak it a little. You have some HTML code that was generated by your external development tools, and you want to insert it into your FrontPage-generated Web pages. Although FrontPage has a lot of tags, attributes, and values built in to the FrontPage Editor, sometimes you need to add others.
FrontPage allows you to add code into your pages in a couple of ways. One solution is to use the View | HTML command, which opens a color-coded HTML editor. There, you can modify the code that FrontPage generates without going through the dialog boxes to modify the code. Another solution is to use the HTML Markup bot, which allows you to add HTML code that FrontPage does not directly support and bypasses FrontPage's code-checking features.
The Web is like the weather: Wait five minutes and it will change. As a result, it's hard for browser and Web page editing software programmers to predict what features they'll need to incorporate in their software. It's one of the reasons FrontPage gives you a couple of ways to add extensibility. For many tags, you can add extended features by using extended attributes. You've covered those already in previous chapters. However, for those tags that aren't covered in the FrontPage Editor, you can use the HTML Markup bot or the View | HTML command to enter code manually.
When you want to view or edit your HTML code, choose the View | HTML command in the FrontPage Editor. The View or Edit HTML window, shown in Figure 17.1, appears. This editor is a color-coded HTML editor, where HTML tags are displayed in purple, attributes are displayed in blue, attribute values are displayed in green, and page content is displayed in black. You can disable the color coding, if you prefer, by unchecking the Show Color Coding option located at the bottom of the View or Edit HTML window.
The View or Edit HTML window allows you to view your code in two ways:
Original. To view your code as it appeared when you first opened the page in the FrontPage Editor, choose the Original radio button from the bottom of the View or Edit HTML window.
Current. To view your current HTML code, select the Current radio button at the bottom of the View or Edit HTML window. This is the default selection when you first open the HTML editor.
From this View or Edit HTML window, you can add or modify any code that you choose. Some find it quicker to modify settings from this window, rather than re-enter settings in the FrontPage dialog boxes. You can also use copy (Ctrl+C) and paste (Ctrl+V) commands to copy code from other HTML editors and insert it into the View or Edit HTML window. When you are finished editing the code, choose OK to return to the WYSIWYG FrontPage Editor.
What happens if you insert code that the FrontPage Editor does not directly support? FrontPage 97 fields the code, and it handles the situation automatically for you. When you return to the FrontPage Editor, you see small yellow rectangles on your page with question marks in them. These are HTML Markup bots, which are covered in the next task.
What the HTML Markup bot does is allow you to enter "snippets" of code that the FrontPage Editor doesn't write itself. The code that is contained in HTML Markup bots is not checked for accuracy. FrontPage lets you do the thinking there and figures you've got it right.
The HTML Markup bot is really quite simple to use. Here's basically what you do:
TIP |
It's a good idea to also use the Insert | Comment command somewhere near the HTML Markup bot to add a comment that describes the Markup bot's contents. This gives you a quick visual reminder of why the Markup bot is there. |
If you find you use the same markups over and over again, create a page that places all your HTML Markup bot icons in one place. Use a Comment (Insert | Comment) or text to describe the contents of each of the markups. Save the page in your Web's _private directory so your Web's table of contents won't list the page. To insert the markup into another page, simply highlight the icon you want to reuse, copy it into your clipboard, and paste it into another page.
Frames are designed with the Frames Wizard. If you try to edit the page in the FrontPage Editor, the Frames Wizard opens again so you can edit the frame's configuration. The FrontPage Editor has the majority of the frame tags built in. Internet Explorer 3.0 supports the capability to display additional attributes for frames that really enhance the appearance of your framesets. These attributes are as follows:
At present, there's no way to add extended attributes to framesets from the Frames Wizard. In addition, because the frameset page automatically opens in the frameset, you can't use HTML Markup bots or the View or Edit HTML window to edit the code.
If you really want to use either of the tags mentioned previously to enhance your framesets, there is a workaround method. Open the page from the FrontPage Explorer as follows:
Unfortunately, this nicer appearance comes at a price. When you use this procedure, you break the connection with the Frames Wizard, so if you want to edit your frameset in the future, you need to make the changes manually. In addition, you now actually have two copies of your alternate content page in your web-the one you originally made and a code version of it that is now contained in your broken frameset. It's easy to see that these two versions can get out of sync.
Here's a workaround for the workaround. You can rebuild your frameset
page a little further by using an Include bot to place the contents
of your original alternate content page into this broken frameset.
TIP |
If you feel more comfortable about testing this out on a copy of your frameset page, open the frameset in the FrontPage Editor and choose File | Save As. Save a backup copy of the frameset to your web under a different filename. |
To add your alternate content page into an Include bot, follow these steps:
Now you know where you can find the tools to manually edit the code that FrontPage generates for you automatically. Using the View or Edit HTML window and the HTML Markup bots, you can add code and features that go beyond the capabilities of the FrontPage Editor. You also learned how you can enhance the appearance of framesets, giving your frames a much cleaner appearance.
In the next chapter, you'll combine what you learned in this section to add more pages to your My World Web. You'll complete your page templates, add additional content pages, and create the frameset for your web.
Q: | What you're saying is it's actually best to do as much as I can in the FrontPage Editor and then add the rest in with the HTML Markup bot or the View or Edit HTML window? |
A: | I find it to be the simplest way, but you might learn different tips and tricks as you become more familiar with entering your own code. If you can see what you get while you're working on it, why not use that to your advantage while you develop your page? |
Q: | When I import pages from other sites into the FrontPage Editor, sometimes it inserts a whole series of HTML Markup bots, one right after the other. Can I combine them all together? |
A: | If there's no other content between them, I don't see why not. What you can do is open the second HTML Markup bot and copy its contents into your clipboard. Then, open the first one and paste the contents of your clipboard at the end of its contents. Continue on down the line in this manner, pasting the contents of the third to the first, and so on. Delete all but the first Markup bot, which combines the content of all of them. |
Q: | If there are a whole bunch of Markup bots scattered around the page, can I put them all in one place? |
A: | Probably not. Remember, you might have content in between them, and the Markup bot tags are usually arranged in the order in which your code has to appear to make the page flow correctly. |