As your Web grows-and it will-it becomes difficult to keep track of the content that you want to include on your pages. You find yourself using the same contact information or navigation links repeatedly on your pages. At times, you forget about a page or a graphic that you wanted to place on your site on a certain date, only to remember it weeks later. You forget to add new pages to your table of contents, and it soon becomes incomplete. When you move your Web site, you must change all the pages that have your contact information on them.
There is an easier way to handle these situations. FrontPage's bots help automate your pages so that you can keep these situations well under control.
Advanced Web page developers use custom scripts to automate or enhance their pages. These scripts are written in languages such as CGI, Perl, Java, JavaScript, and VBScript. For the novice Web page designer, learning how to do this can be time- consuming. It can seem like an insurmountable task.
Through the use of bots, FrontPage enables even novice Web page designers to use advanced features that are usually handled with scripts. These bots are basically custom-made scripts that are configured to perform certain tasks. With FrontPage, you just need to plug in the variables that each bot requires, and you are on the way to automating your pages.
The CD-ROM furnished with this book includes some files for you to work with. Create a new web in the FrontPage Explorer. Import the files into your web as follows:
You can use the bots discussed in this chapter regardless of whether your ISP has the FrontPage Server Extensions installed on its server. You can use these bots to enhance your pages so that making changes down the road is extremely easier.
As you design your pages, you often enter the same information on several pages. Examples of repetitive information include
It is easy to cut and paste information like this from one page to another. Consider, though, how much work it is to go back and change that information, especially if it appears on dozens of pages. You can use an Include bot to simplify and automate the task.
An Include bot inserts the contents of one page into another page. Rather than change the information on the dozens of pages in which the repeated content appears, you need change it only in the page that gets included in the others. If you study the pages in the Web templates and wizards, you find Include bots used frequently. They are a real time-saver.
When you use Include bots, note that the page you include must be an HTM or HTML page-in other words, another Web page. You cannot insert a text file, a graphic, or any other type of file using an Include bot. You can, however, place text files, graphics, and other types of contents on a web page and assign that page to an Include bot. In addition, the page you include must exist in your current web. If you include a page from another web on your server, or if you include a page that does not yet exist in your web, a line appears in italic text surrounded by brackets, such as
[badpage.htm]
What you should see after you include another page with the Include bot are the actual contents of that page inserted into your current page. If you do, you know that the Include bot did its job.
Using the Include bot is straightforward. It involves only a few steps:
NOTE |
The Browse button is not highlighted if you don't have a web open in the FrontPage Explorer. |
TIP |
Consider placing content that is included in other pages with the Include, Scheduled Include, and Scheduled Image bots in your web's _private directory. This directory serves as a storage area for pages and content to which you do not want to provide public access. |
You might decide at a later point to include a different page in an Include bot that has already been configured. To revise the Include bot so that it includes a different page, follow these steps:
If you want to edit the page contents of an included page, you must open the originating page. You can open the page by selecting the Include bot:
A common use for Include bots is to place the same navigation links on many pages, as you just did in the previous task. If you try to follow a link from an included navigation links page, you see the bot pointer appear when you position your mouse cursor over any of the links on the included page. To follow these links, you must open the original navigation links page. You can follow a link from an included navigation links page as follows:
Suppose that you want to post information on your web on a certain date. Eventually that day goes by, and you forgot to include the page on the site. FrontPage provides a way to help you avoid this situation effortlessly: the Scheduled Include bot.
The Scheduled Include bot is similar to the standard Include bot, except that you can specify a date range in which the page appears in your web. You prepare your pages beforehand and specify the date when they are posted to your web. The page displays on your site until the end date specified in the Scheduled Include bot.
Scheduled Include bots and Scheduled Image bots require proper timing. They execute only if changes occur to the web. Because of this, you are advised to make daily changes to your web. The help file suggests incrementing the value of a configuration variable. Use the FrontPage Explorer's Tools | Web Settings command and specify a variable with the Parameters tab of the Web Settings dialog box.
You might want to use Scheduled Include bots for
To insert a scheduled page into your web on a specified date, you need to create a master page to holds its contents, such as the Monthly Newsletter page you currently have open in the FrontPage Editor.
To display a page in your web on a given date and for a specified length of time, use the Scheduled Include bot. To add a Scheduled Include bot to the Monthly Newsletter Page, follow these steps:
[Expired Scheduled Include]
NOTE |
If you see [Expired Scheduled Include] during the time period specified by the Scheduled Include bot, the page that you included might not exist in your current web. Verify the name of the included file, or check to see if a file by that name exists in your current web. |
If you open the page in the FrontPage Editor during the time period specified by a Scheduled Include bot, you see the contents of the page you specified in the bot.
The Scheduled Image bot is similar to the Scheduled Include bot, except that it places an image on a page during a specified time period. Use it to display, for example, calendar graphics or an image of the week. The same rules and cautions applicable to a Scheduled Include bot apply here as well.
You can insert a Scheduled Image bot anywhere on a page. Note that you cannot apply image formatting to a scheduled image after it is placed on your page, for you cannot access the Image Properties dialog box. Apply image transparency or hotspots to an image before you place it on the page with a Scheduled Image bot. You can, however, place an image on a Web page and use a Scheduled Include bot instead.
To insert a scheduled image on a page, perform the following steps:
[Expired Scheduled Image]
If you open the page in the FrontPage Editor during the time
period specified by a Scheduled Image bot, you see the image specified
in the bot.
TIP |
You can insert several Scheduled Image and Scheduled Include bots on your page in advance. For example, you could configure one of each for every month in the year and place them on your page all at once. The bots display the appropriate contents on the dates you configure in the bots. |
If you are familiar with word processors, you might be aware of the concept of fields. Fields enable you to set up a form letter or a master mailing label, placing variable names in certain locations. The fields are replaced with data set up in a database or another word processing document.
The Substitution bot works almost the same way, although the variables that it places on pages are settings applicable to the current web. It enables you to place on your pages the names of generic variables whose contents are replaced with values specified in the Web configuration settings.
Suppose that you design a product data sheet that you want to use as a template for several different companies or for divisions of a company. You want to save this page as a template that can be used in many instances. On this page, you place Substitution bots with the following values:
[CompanyName] [CompanyAddress] [CompanyEMail] [CompanyHomePage]
When you create a web for the company, you configure the Web settings to specify the information that is placed on these fields in your pages.
Another good use for the Substitution bot is to place your own contact information on your pages. You might move, change Internet service providers, or upgrade your Web site with your own domain name. If you placed your contact information on dozens or hundreds of pages without using Substitution bots, you have many page changes ahead of you. Using Substitution bots for this information enables you to enter the changes only once-in your Web configuration settings. After that, if you store your pages on a remote site, it is just a matter of transferring them to your remote web.
Substitution bots need configuration variables associated with
them. In this chapter, you learn how to add general configuration
variables in your Web settings. You can also add configuration
variables to forms, as discussed in Chapter 22.
NOTE |
To add a configuration variable to your Web settings, you need to have access to the web as an administrator. If you use FrontPage on your own personal computer, you established administrator status when you installed FrontPage under the typical installation procedures, through the FrontPage Server Administrator. If you are working in a multi-author environment, you might not have administrator status and might be unable to perform all the steps in the following task. Find out from your Web administrator the names of the configuration variables that you can use. |
In this task, you complete a footer that can be inserted into several pages. The footer is designed to substitute your actual contact information with the values specified in Web settings. Perform the following steps:
NOTE | |
Four configuration variables are standard to every web or page created in FrontPage: | |
Author | Replaced with the name of the author who created the page. The author name is based on the name as entered in the FrontPage Server Administrator or with the Tools | Permissions command, where spaces are not allowed in the name. |
ModifiedBy | Replaced with the name of the author who most recently modified the page. |
Description | Replaced with a description of the current page as entered in the Comments field of the Properties dialog box. |
Page-URL | Replaced with the page URL of the page. |
You can view the values of each configuration variable from the FrontPage Explorer. Highlight the page whose properties you want to view, and choose Edit | Properties. |
Now you need to add the configuration variable for the authorname and webmaster Substitution bots to your web:
The Table of Contents bot enables you to generate a list of the pages that appear in your Web site automatically. Any pages in your web that appear beneath that page are listed in the table of contents in a hierarchical manner using nested lists. You can include-or not include-pages that cannot be reached by following links from the page you designate as the starting point for your table of contents.
You do not have to generate a table of contents from your home page; it can start from any page that appears in your web. For example, if your home page provides links to several different sections, some of which you do not want to include in the table of contents, you can automatically generate a table of contents that starts at the beginning of each of the sections you do want to include. Multiple Table of Contents bots can appear on a single page, each generating contents that begin at a specified page.
When you generate a table of contents using the Table of Contents bot, it inserts a generic heading and three dummy links on your page. That is what you see in the FrontPage Editor. Your first reaction is probably that you did something wrong. When you open a Web browser and navigate to the page while your server is running, however, you see the results.
To insert a table of contents on a page, do the following:
To view the table of contents in your browser, choose File | Preview in Browser. The Preview in Browser dialog box appears. From the Browser list, select the browser that you want to preview the table of contents in. Select a Window Size (Default, 640×480, 800×600, or 1024×768). Then, click Preview. The page opens in your browser.
The browser loads the table of contents page, and you can see each page listed, beginning with the page that you specified in the Table of Contents Bot Properties dialog box. The pages are listed in the table of contents by their title, as shown in Figure 14.12.
Figure 14.12 : When you view the table of contents in a Web browser, the titles of the pages appear.
NOTE |
If you have difficulties viewing the table of contents page in your browser, one of two things may remedy this situation. First, verify that the table of contents page and other open pages in the FrontPage Editor are saved to your current web. Secondly, resave the table of contents page if you have added or changed any pages since you last saved it. This causes the Table of Contents bot to regenerate the page list. Check in the FrontPage Explorer's Outline view to see if the pages appear beneath the table of contents page. If they do, you should be able to view them in your browser as well. |
The Timestamp bot helps you and visitors to your site keep track
of the date when a page was most recently updated-manually or
automatically. In most cases, you specify manual updating. Sometimes,
however, you might want to specify automatic updating.
Tip |
Include a Timestamp bot at the beginning of your pages. This tells users whether your pages have changed since their last visit. |
You should still have the table of contents page open in your browser. That's as good a place as any to add a Timestamp bot.
To place a Timestamp bot on your page, follow these steps:
NOTE |
You can use Ctrl+Enter to reach the beginning of a page any time there is a bot placed on your page right at its beginning. |
Now you have solutions to the problems described at the beginning of this chapter. You can use FrontPage bots to resolve the issues quickly and easily. Bots allow you to avoid repetitive typing of links or other text, schedule Web content, and automatically keep track of all the pages in your web. Your Web creation tasks are greatly simplified, and making changes to your Web site in the future requires less time to complete.
In this chapter, you learned about the basic bots available to you in FrontPage. Using them, you can automate your pages in several different ways. You learned how to include content from one page in another, schedule content and images to appear in your web at specified times, generate a table of contents automatically, use and apply configuration variables to your webs, and advise yourself and others when changes were last made to your pages. Automating your pages in this manner involves only a few steps, and it makes your work much easier down the road.
In the next chapter, you learn how to use other editors in conjunction with the FrontPage Editor to edit other types of content within FrontPage. For more information on the subjects covered in this chapter, consult the following chapters:
Q: | Can I use these bots without using the FrontPage Explorer? |
A: | Many of the bots rely on links to pages that exist in the current web. This means the FrontPage Explorer must be open to the web that holds the pages with which you are working. |
Q: | How do these bots work if my service provider does not have the FrontPage Server Extensions? |
A: | When you view the HTML code-source or generated-using the View | HTML command in the FrontPage Editor, you see references to bots placed in your code. However, if you view the source code of the same page through a Web browser, you see quite a difference. The contents inserted with bots become an integral part of the page. References to the bots are stripped out. For this reason, you should keep a copy of your pages in your FrontPage web if you plan to make changes to them. When you import your Web pages into your web from your server, you need to insert the bots again to bring them back to automation status. |
Q: | I put a Timestamp bot in a footer and used the Include bot to place it on several pages. When I changed some of the pages that included the footer, the dates were not updated. In fact, the dates weren't there at all! What happened? |
A: | The Timestamp bot updates when you change a page. In this case, however, the timestamp is tied to the footer-not to the page on which it is included. If you place a Timestamp bot on your pages with an Include bot, the date does not change unless you save the footer again. This might place an incorrect date on all the pages in which the timestamp is included. Rather than use an Include bot to place a Timestamp bot on several pages, place the timestamp on each page individually. |
Q: | I put a header graphic and some navigation links into an Include bot and want to add a link back to the top of the page, but I can't assign the top bookmark to the Include bot. Is there a way around this? |
A: | Well, there is a sneaky way, but it adds an extra line to the top of your page. Enter a line of text at the very top of the page that says top. Assign the top bookmark to it, and then use the Text Color button to make the text the same color as your background. If you use a background image for your page, just enter a period and assign the top bookmark to it. It's cheap and dirty, but it works. Of course, you can also edit the code manually, as discussed in Chapter 17, "Using Your Own HTML Code." |
Q: | I inserted a logo at the beginning of my page by using an Include bot. I want to add something before it. I cannot place the cursor at the beginning of the page now. How do I do that? |
A: | To place the cursor before the Include bot, select the Include bot so that it appears in inverse video. Then press Ctrl+Enter. This places the cursor on a new line above the Include bot. The new line is formatted as a normal paragraph. |