Building a Frames-Based Layout You can create a frames-based layout in either of two ways. You can build your files using predefined framesets that come with Dreamweaver, or you can create your own from scratch by dragging and dropping frame areas. Going with a predefined frameset is the easiest way to get started, and once the frameset has been created, you can easily customize it however you like. Once you've created a frameset or two, you may wish to visually create your layouts using dragging and dropping. This approach is fast, but also a little more advanced. By the end of this section, you'll know how to tackle both approaches.You can build your frameset files using predefined framesets that come with Dreamweaver, or you can create your own from scratch by dragging and dropping frame areas.Either way, Dreamweaver provides lots of tools to help you. With Dreamweaver, you can view all the documents in your frameset at once, just as they'd appear in a browser, or you can view individual pages that appear within frames on their ownafter all, they're just regular web pages.A well-thought-out, well-constructed frames-based layout can support a web site's navigation rather than hinder itthe whole point behind frames. This site's navigational elements have been placed in the frames that surround the layout's main content frameseparating navigation from content.[View full size image] Here's how to create a frameset from Dreamweaver's prebuilt framesets:
1. | Choose File > New. | 2. | In the New Document dialog box that appears, click Framesets in the Category list on the left. | 3. | From the Framesets list that appears, select the style of frameset that you want to create.Chapter 3. As you work on your frameset and change its properties, make sure to save the frameset file periodically. Just click a frame border as you did here and choose File > Save Frame. |
Adding and Deleting Frames You can add frames to your structure by splitting existing frames into smaller ones, just as you can split a table cell. Frames that you decide you don't need can be deleted.Here's how to add a frame to a frameset:Position your cursor over the frame border that appears around the outside edge of the Dreamweaver window; then click and drag inward.Noteworthy | Because a frameset file is just a norma96-based page, it can be hard to tell frameset files apart from other pages in your site. To help distinguish them from other pages, use frameset or FS in the frameset's file name. For example, you might call your frameset Catalog_FS. | When you bring your cursor over the frame border, it changes to a two-headed arrow. As you drag inward, a gray line appears, indicating where your new frame will appear.[View full size image] Rather than adding new frames visually, you can choose Modify > Frameset and then choose Split Frames Left, Split Frames Right, Split Frames Up, or Split Frames Down. The direction that you choose determines where the current page is placed in the frameset. For example, if you choose Split Frames Left, the Dreamweaver window will split vertically, and the current page will appear on the left. Here's how to delete a frame from a frameset:
1. | Drag the border of the frame you want to delete toward the edge of the Dreamweaver window until the frame disappears. | 2. | If you're removing a frame that contains unsaved content, Dreamweaver will ask you if you want to save it. If you want to use the content in the future, click OK; then in the Save As dialog box that appears, give the page a name and save it in your site's local root folder, where you can retrieve it for future use. |
Creating Framesets From the Insert Bar If you've already created a web page in Dreamweaver, complete with tables, some CSS styles, and maybe a graphic or two, you can easily build it into a frameset using the Insert bar. Your preexisting page can contain as much or as little content as you like. Keep in mind that when building a frameset from an existing page, the page that you start with will always serve as the frameset's main frame, and that you'll be adding frames around it.Here's how to create a frameset from an existing page using the Insert bar:
1. | Open the page that you'll be using as the main frame in your frameset by choosing File > Open. | 2. | Choose Window > Insert to open Dreamweaver's Insert bar, if it's not already open. | 3. | Switch the Insert bar's category to Layout.Recall that the Insert bar has two modes: menu mode and tabbed mode. If you're in menu mode, choose Layout from the pull-down menu on the left. If you're in tabbed mode, click the Layout tab at the top. | 4. | In the Layout category, open the Frames pull-down menu; then choose one of the frame layouts.The icons in the Frames pull-down menu help you choose the type of frameset you want to create, and as you can see, there's no shortage of choices. The blue area in each icon indicates where your current page will appear in the frameset.
When you choose an option from the pull-down menu, Dreamweaver creates your frameset document.[View full size image] | 5. | If you have Dreamweaver's accessibility option turned on, the Frame Tag Accessibility Attributes dialog box appears. In the dialog box, enter a name for each frame; then click OK.Your page now is a frameset. |
|
Setting Properties to Customize Your Frameset You control some of the formatting of your individual frames via the Property Inspectorsize and scrollbars, for example. You control other formatting through Dreamweaver's Page Properties dialog box, just as you've already seen. So if you want to set a background graphic or color or control the look of your hyperlinks, it's all the same as before. Just click the frame that you want to change, choose Modify > Page Properties, and you're on your way.Noteworthy | Pages that appear within frames are just ordinary HTML-based web pages. This means that you can open them in Dreamweaver by themselves (without the rest of the frameset) to make any changes or additions that you want. Once you're done, just save the pages as you would any other web pages. | As you're working on your layout, be sure to save the pages that appear within the separate frames. Click inside the frame that you want to save; then choose File > Save Frame. In the Save As dialog box that appears, give your file a name and save it as you would a regular web page. As you make changes to your individual frameswhether you're adding content or changing the frame's propertiesyou'll need to save the frames. Also, because you're working with multiple web pages, you'll need to save each file individually for your frameset to function properly when it's live on the web.Here's how to customize your frameset by setting its properties:
1. | Choose Window > Frames to open the Frames panel. | 2. | Do one of the following:To customize your main frameset, select the frameset by clicking the outside edge of the frameset pane in the Frames panel. Noteworthy | Rather than saving framesets and the pages that appear within them separately, you can simply choose File > Save All. Choosing Save All saves all the web pages in the frameset, as well as the frameset file itself. A Save As dialog box appears for each unsaved frame file and for the frameset file, one after the other. A heavy dotted line appears around the frame in the Dreamweaver window, so you'll know which frame you're currently saving. | As you saw earlier, you can also select a frameset by clicking a frame border within the Dreamweaver window or by using the Tag Selector on Dreamweaver's Status bar. When a frameset is selected, the Frames panel's outline highlights.To customize a nested frameset, select the nested frameset by clicking a frame border in the Dreamweaver window. In the Tag Selector on the Status bar, you'll see <frameset> <frameset>. Click the right <frameset> tag to select the nested frameset. This is the easiest way to select nested framesets. If you have framesets nested within nested framesets, select them by clicking the gray lines in the Frames panel where your nested frameset appears. To see what you've selected, keep your eye on the Tag Selector at the bottom of your screen. Once your frameset is selected, you're ready to set options for it.
| 3. | In the Document toolbar's Title field, give your frameset file a title.Remember that your web page's title will appear in the visitor's browser title bar. Because your frameset will contain multiple web pages, the web browser cannot display all their page titles. Rather, your visitor's browser will display the title that you enter for your frameset file. | 4. | If you want the frameset borders to appear in your visitor's browser, choose Yes from the Borders pull-down menu and use the Property Inspector's Borders, Border Width, and Border Color options to set them.Imminent Doom | If you leave the Property Inspector's Borders pull-down menu set to Default, you run a high risk of disastrous results. The Default setting allows the visitor's web browser to determine whether borders will be visible or not, meaning that you'll have no idea how your frameset will actually appear for your visitors. | [View full size image] Because browsers handle border settings inconsistently, if you want borders to appear, make sure to choose Yes from the Borders pull-down menu and enter a pixel thickness in the Border Width field. Use the Border Color option to select a border color from Dreamweaver's color palette.If you later decide that you want to make the borders in your frameset invisible, set the Borders pull-down menu to No and enter 0 in the Border Width field. You have to set both options to shut off your borders because of browser incompatibilities with frames. Some browsers understand the first option, and others understand only the second.You can also control frame borders for just specific frames, which you'll see in a momentbut again, browser inconsistencies will drive you mental. Probably the best approach is to shut off borders entirely. | 5. | To resize your frames, in the RowCol Selection box in the Property Inspector, select the row or column in your frameset that you want to resize; then do one of the following:To set the size of your frame in pixels, enter a number in the Value field and set the Units pull-down menu to Pixels.To set the size of your frame as a percentage of the visitor's browser window, type a percentage in the Value field and set the Units pull-down menu to Percent.To set the size of your frame relative to other frames in your frameset, set the Units pull-down menu to Relative and type 1 in the Value field. The Relative option is useful for occupying any remaining space in your visitor's browser that isn't being occupied by other frames. For example, say your frameset has two frames: a narrow frame on the left that holds navigation buttons, and a wide frame on the right that holds content. The left frame's width is set to 100 pixels, and you want the frame on the right to occupy the rest of the screen. You could then set the main column's width to Relative so that it expands or contracts to fill the available width in the visitor's browser window.The down-and-dirty way to change frame sizes is to drag their borders.Repeat this step to size other frames in your frameset.Now that you've set options for your frameset, you're ready to set options for the individual frames within your frameset. | 6. | In the Frames panel, click a frame in your frameset. Alternatively, you can Alt-click (Windows) or Option-Shift-click (Macintosh) inside a frame in the Dreamweaver window to select it. The frame in the Frames panel highlights with a thin black line. The options you select next will apply to that frame. | 7. | In the Property Inspector, in the Frame Name field, enter a name for your selected frame.Frame names are used to differentiate your frames when you add hyperlinks within a frameset, so that when your users choose a link, the new page will load in the correct framedon't confuse them with the file name that you used when you saved your frame. The two are completely different.Dreamweaver provides frame names by default (like leftFrame and mainFrame). You can leave them as they are or change them to suit your design. You may wish to use even simpler names like Top and Left. The names themselves don't matter so much, as long as you know what each frame is called so you can refer to them in Dreamweaver.Noteworthy | Whatever names you use for your frames in the Property Inspector, they'll appear in the Target pull-down menu. Then, when you create a hyperlink in one of your frames, you'll not only select the file name for your targeted page and add it to the Link field, but you'll also choose a target page (where your linked page should appear) from the Target menu. If you don't, the new page will load in the same frame in which your users clicked the hyperlink, which is usually wrong. |
| 8. | If you want to display a different web page in the frame, use the Src field in the Property Inspector to change the page.You saw earlier how to open an existing web page in your frameset. You can use the Property Inspector's Src field to do the same thing. | 9. | Use the Scroll menu to specify whether you want scrollbars to appear for the selected frame.[View full size image] Scrollbars appear whenever the content of a frame is too large to fit within its specified size. Choosing Yes from the Scroll pull-down menu enables or disables scrolling within the frame. Choosing No disables scrolling, even if the content is larger than the framemeaning that some of your content will not be viewable. Page content reflows depending on the browser, monitor resolution, and platform that your visitor is using, so you may want to remove a frame's scrollbars to ensure a more unified look, especially for a frame that contains a navigation menu or your site's logo, or if you're concerned that font sizes may change. Using Default allows the visitor's web browser to determine whether scrollbars appear, although most browsers use the equivalent of Auto, which displays scrollbars only when they're needed. | 10. | If you don't want your visitors to resize the frames in their browser window, select No Resize.It's probably a good idea to select this option. Allowing the visitor to change the interface is, well, an open invitation to destruction. | 11. | To add an inside margin to your frame, use the Property Inspector's Margin Width and Margin Height fields.[View full size image] The Margin Width and Margin Height fields pad the inside of the frame, pushing its contents away from the frame borders, similar to cell padding in a table cell. | 12. | To set the visibility and color of borders for individual frames, use the Borders pull-down menu and the Border Color option.Typically, borders set for individual frames override the border settings for the overall framesetat least that's how it's supposed to work. Depending on the browser being used and even the computer platform, though, the frameset's overall border setting may override the frame's border setting. With this level of erratic browser support, again it's best just to leave borders off. | 13. | With the options set for one frame, select the next frame in your frameset and repeat steps 7 through 12 to set its properties.Remember: To select a frame just click it in the Frames panel or Alt-click (Windows) or Option-Shift-click (Macintosh) inside the frame in the Dreamweaver window. | 14. | Once the properties for all your frames have been set, save the entire layout by choosing File > Save All; then choose File > Preview in Browser to view your work.Paranoid about making sure all your work's been saved? Chill out! Just make sure to always choose File > Save All. That way, you'll know that everything in your frames-based layout has been saved.Choosing Save All saves your frameset file and all the pages that appear within it. With the frameset saved, the files opened within it will now appear whenever the frameset file is displayed. |
Opening an Existing Page Inside a Frame Often, you'll want a page that you've already created to open in one of the frames in your frameset. Perhaps you've already built a page in Dreamweaver, and now you want to add it to your frameset, perhaps so that it appears beside a frame that contains your site navigation. No problem.Noteworthy | In addition to working with rigid frames within a frameset, you can insert floating framesthat is, a floating area within one web page that displays the contents of another web page. Floating frames work similarly to layers. | Working with pages that appear within frames is no different from working with regular web pagesexcept now, you can see more than one page at a time. Control the various aspects of your frames with Dreamweaver's commands, including the Page Properties dialog box, to set background graphics and colors.[View full size image] Here's how to open an existing page inside a frame:
1. | Place your cursor in the frame that you want to open your page in. | 2. | Choose File > Open in Frame. | 3. | In the Selec104 File dialog box that opens, navigate to the page that you want to open; then click Open (Windows) or Choose (Mac).Dreamweaver opens the page inside your frame. | 4. | If you want to continue opening existing pages in other frames, click in the next frame; then choose File > Open in Frame again to repeat the process. | 5. | Once you have the pages open or created in your layout, save your frameset file.Because a frame holds a regular web page, you insert content just as when you're working with a regular Dreamweaver page.Saving ensures that the pages currently displayed within your layout will appear whenever the frameset file is opened. |
Getting Content into Your Frameset Because a frame holds a regular web page, you insert content just as when you're working with a regular Dreamweaver page. So if you want to use a frame to hold a navigation bar, go for it. Use a table to help control your page layout. Toss in some buttons, text, and CSS formatting just as you've done before. Just click inside the frame that you want to add content to and go nutseverything's the same, only this time the visitor can see more than one page at a time.Getting content into the pages that appear within your frameset is easythey're just regular web pages. Therefore, you can insert any content that can normally be inserted into a stand-alone page.[View full size image] |