Flylib.com

Books Software

 
 
 

Controlling Frame Content with Links


Controlling Frame Content with Links

After you have created the content document pages, you need to link the navigation elements to those pages that should display in the content area of your Web page. To get the content to appear in its proper location, you need to target the link to the desired frame.

1.

Place the insertion point in the text link Introduction in the moreContent frame (the right frame). In the Property inspector, replace the null link (#) by clicking the Browse for File icon next to the Link text box. Select the community_intro.html page in the same directory. Press Return (Macintosh) or Enter (Windows) to apply the link. Select content from the Target menu while the link is still selected .

By default, links are targeted to the frame or window in which they are located; however, these links should open their corresponding documents in the content frame, not the moreContent frame.

Each time you create a new frame, the name of that frame is automatically added to the Target menu. Clear, concise , and descriptive names serve you best. Although Dreamweaver's default frame names give you an idea of the frame location, those generic names can still be difficult and confusing to sort out when you try to make a document open in a certain frame.

Note

If you are working on a document that will be loaded in a frame and you are not working on it inside the frameset, as you are in this lesson, you don't have the option in the Target menu to select the names of any frames. Dreamweaver displays only the names of frames that are available in the current document in the target menu. In these cases, you need to type the exact name of the frame in which you want the page to open into the target text field .

2.

Repeat step 1 to link the text About to AboutGreen.html and the text Begin to BeginningGreen.html. Each of these links should be targeted to the content frame .

There are other options available in the Target menu:

  • _blank loads the linked document in a new, unnamed browser window.

  • _parent loads the linked document in the parent frameset of the frame that contains the link. If the frame containing the link is not nested, the linked document loads into the full browser window.

  • _self loads the linked document in the same frame or window as the link. This target is implied , so you usually don't have to specify it.

  • _top loads the linked document in the full browser window, thereby removing all frames.

3.

Save the file and preview it in the browser .

When previewing your frames pages in the browser, you might get a dialog box informing you that all the frames need to be saved. Click OK to save all frames and the frameset.

When you click the About link, the AboutGreen.html document displays in the content frame.

Tip

If your pages don't appear in the frames you expect them to, check to see that you have selected the correct frame from the Target drop-down menu in the Property inspector for each link .

The links should open all the pages in the content frameif not, you need to correct the target using the Target menu for any links that do not open in that frame.




Creating NoFrames Content

In Dreamweaver, you can create content that is ignored by frames-capable browsers, and is displayed in older and text-based browsers or in other browsers that do not support frames. This information, called NoFrames content, is also used by search engine spiders, screen readers, and portable Internet devices that do not support frames. The NoFrames content you create is placed in the frameset file. When a browser that doesn't support frames loads the frameset file, the browser displays only the NoFrames content.

1.

In the community.html document, select the frameset .

The community.html document is the page the browser loads initially, so the NoFrames content is specified here.

2.

Choose Modify > Frameset > Edit NoFrames Content .

Tip

If the Frameset option in the Modify menu is dimmed, you might have a frame selected .

The Document window changes to display the NoFrames page, and the words "NoFrames Content" appear at the top. This is still the community.html document; you are just seeing a different view of the page's content.

3.

Open the green_page1.txt document; then select and copy all the text. Create the NoFrames content in the Document window by pasting in the text you copied from the green_page1.txt text file .

Alternative content can contain elements from a standard html page. It will be enclosed between the <noframes> and </noframes> tags. Only browsers that do not support frames see this content. The content should be relatively simplebrowsers that do not support frames are likely to not support JavaScript, image maps, and other types of complex elements. Some Websites use NoFrames content to provide simple alternative pages or to direct users to a text-based version of the Website, whereas other sites use NoFrames content to display a message to users that the site is available only to frames-capable browsers.

4.

Make sure there is a checkmark next to Modify > Frameset > Edit NoFrames Content .

The Document window changes to hide the NoFrames content and returns to the normal view of the frameset document.

Note

When you finish editing the NoFrames content, you might be inclined to close the window because you can't see the original document. If you do, you close the frameset and all the frame pages. You then have to open them up again if you want to continue editing them .

5.

Choose File > Save All and close all your documents .