tab to select the paragraph tag that contains the Facebook badge, along with all its contents.
You can see in both the Design pane and Code pane that the paragraph tag is selected, along with all the elements that it contains.
14. From the Format menu, select Dynamic Web Template, and then choose Manage Editable Regions. The Editable Regions dialog box opens.
www.it-ebooks.info
118
Microsoft Expression Web 4 Step by Step
15. In the Region Name field, type LeftBelowMenu. Click Add, and then click Close. The Editable Regions dialog box closes.
www.it-ebooks.info
Chapter 3 Capitalizing on the Template Options in Expression Web 4
119
In the Design pane, you’ll see a tag for the LeftBelowMenu editable region, and in the Code pane, you can see that the paragraph tag that surrounded the Facebook badge is now also inside the new editable region.
16. On the Common toolbar, click Save. In the Update Files dialog box, click Yes, and then in the Update Files confirmation alert, click Close.
17. Click the Chapter3a.html tab at the top of your workspace to make that page the active document, and then click Save on the Common toolbar.
18. In the Design pane, click the Facebook badge image, and on the Quick Tag Selector, point to the
tag inside the editable region. Click the arrow, and then click Select Tag Contents. Expression Web selects the paragraph’s contents.
www.it-ebooks.info
120
Microsoft Expression Web 4 Step by Step
19. Press Delete on your keyboard, click Save on the Common toolbar, and then click Preview. The page opens in a browser. Click a few of the navigation links to the other chapter pages.
Notice that the Facebook badge has now been removed from the Chapter3a.html page that you made, but it’s present on all the other pages. By using this method, you can selectively include or exclude elements from the DWT on a page-by-page basis.
20. Close your browser and return to Expression Web. Click the main.dwt tab at the top of the workspace to make main.dwt the active document. Consider the flexibility of the Dynamic Web Template. You can employ DWT techniques to control pages or groups of pages with one or more templates. In the next steps, you will create a new DWT and transfer a layout onto it. You can then use this new template to provide a different appearance to any page you choose.
www.it-ebooks.info
Chapter 3 Capitalizing on the Template Options in Expression Web 4
121
21. Point to the New Document icon on the Common toolbar, click the arrow, and then click Page. The New dialog box opens.
22. In the General category, click Dynamic Web Template, and then click OK. A new master page named untitled_1.dwt opens in your workspace.
23. Click Save. The Save As dialog box opens. Double-click the sample site’s templates folder, type red.dwt into the File Name field, and then click Change Title. The Set Page Title dialog box appears. Type My Template into the Page Title field, and then click OK to close the dialog box. In the Save As dialog box, click Save. Expression Web saves the new DWT as red.dwt in the site’s templates folder. Note Although this is only the third chapter of this book, and we haven't yet discussed how to create a layout from scratch by using cascading style sheets, there is still value in becoming comfortable with templates. For example, it’s important to be able to transfer a design from an HTML file to a DWT. Many designers make use of third-party page templates. These pre-made templates are usually provided in HTML form; vendors assume that designers will be able to use the template layouts in their preferred template systems.
24. In the Folder List panel, expand the templates folder, and then double-click the red.html file to open it for editing. Click in the body of the page in the Design pane, and then on the Quick Tag Selector, point to the
tag on the Quick Tag Selector to select the paragraph tag and its content.
4. Right-click the highlighted content in the Design pane, and select Cut from the context menu. Expression Web cuts the content from the page.
5. On the Common toolbar, click Save. Click Yes in the File Update dialog box, and then click Close on the Update Confirmation alert.
www.it-ebooks.info
Chapter 3 Capitalizing on the Template Options in Expression Web 4
131
Because these links are more appropriately used on pages that are under development rather than as a fixed part of a template, you will add this content to a new HTML page and then include it on a page-by-page basis. 6. Point to the New Document button on the Common toolbar, click the arrow, and then click HTML to create a new HTML file named Untitled_1.html.
7. Click the page in the Design pane to set your cursor. Right-click and select Paste from the context menu. Expression Web pastes the content you cut from the DWT into the new page.
8. Click Save on the Common toolbar. The Save As dialog box opens. Navigate into the templates folder, and then type ValidationLinks.html into the File Name field. Click Change Title. The Set Page Title dialog box appears. Type W3C Validation Links in the Page Title field, and then click OK. In the Save As dialog box, click Save.
Download from Wow! eBook
www.it-ebooks.info
132
Microsoft Expression Web 4 Step by Step
Tip The HTML file that you will use as an Expression Web include page can contain any content you like; however, if the page contains JavaScript or any content outside the tags, you will have to move that content inside the tags. The only content that gets written into the receiving page is that which falls between . and .
9. From the View menu, select Toolbars, and then choose Standard. The Standard toolbar opens above your workspace.
10. Click the chapter3.html tab at the top of your workspace to make that page the active document. In the Code pane, set your cursor at the end of the h4 element that contains the text Using the Include Page Feature, and then press Enter on your keyboard to break to a new line.
www.it-ebooks.info
Chapter 3 Capitalizing on the Template Options in Expression Web 4
11. Click the Include Page button on the Standard toolbar. The Include Page Properties dialog box opens. Click Browse, browse to the templates folder, and double-click ValidationLinks.html. Click OK in the Include Page Properties dialog box.
Expression Web inserted the body contents of ValidationLinks.html into the page.
12. In the Folder List panel, double-click the Chapter3a.html file that you created. Click inside the CatchAll editable region, and on the Standard toolbar, click the Include . Page button.
www.it-ebooks.info
133
134
Microsoft Expression Web 4 Step by Step
13. Browse to the templates folder, double-click ValidationLinks.html, and then click OK in the Include Page Properties dialog box.
14. Click the Chapter3.html tab at the top of your workspace to make that page the active document, click the Save All button, and then click the Preview button. Chapter3.html opens in a browser. Scroll down to the area where you used the include page.
15. Click the menu item for Chapter3a.html. Scroll down to the bottom to see the include page you inserted into this page as well. Notice that the validation icons are present on the original Chapter3.html page, as well as on the page you created in the previous exercise. Close the browser and return to Expression Web.
16. Double-click the Templates\ValidationLinks.html page in the Folder List panel to make it the active document, and then—using the page tabs at the top of your workspace— close all the other open documents. Tip From the Window menu, select Close All Pages to close all your open pages at once.
www.it-ebooks.info
Chapter 3 Capitalizing on the Template Options in Expression Web 4
135
17. Right-click the XHTML validation image in the Design pane, and then, in the context menu, click Picture Properties.
18. In the Picture Properties dialog box, click the Browse button beside the Picture field, and in the Picture dialog box, double-click w3cvxblue.jpg in the site’s Images folder. Click OK to close the Picture Properties dialog box.
19. Right-click the CSS validation image in the Design pane, then select Picture Properties from the shortcut menu.
20. In the Picture Properties dialog box, click the Browse button beside the Picture field, and in the Picture dialog box, double-click w3cvcblue.jpg in the site’s Images folder. Then click OK in the Picture Properties dialog box.
www.it-ebooks.info
136
Microsoft Expression Web 4 Step by Step
21. Click Save on the Common toolbar. In the Folder List panel, click the Chapter3. html file, and then click Preview on the Common toolbar. Chapter3.html opens in a browser. Notice that the validation link images are now blue. Click the link for Chapter 3a, and notice that the validation images have changed in both of the . pages in which you included the ValidationLinks.html file contents.
22. Close the browser and return to Expression Web. Select Toolbars from the View menu, choose Standard to close the Standard toolbar, and then close the ValidationLinks.html file.
Note Leave the SampleSite open if you are proceeding directly to the next section. Consider the efficiency benefits of using the design-time include page in a complex site. It provides an easy way to use content selectively, on a page-by-page basis, yet retains the benefit of enabling the designer to make changes in just one file and ensuring uniformity across all the pages that receive the content. Also consider how these benefits are compounded if the designer has multiple pieces of content that he or she can include where necessary.
Using ASP.NET Master Pages Unlike Dynamic Web Templates, which you explored in the previous exercise, the ASP.NET master page template system requires a server to combine the content from the content page and the content of the master page into one file and pass it off to the browser. .
www.it-ebooks.info
Chapter 3 Capitalizing on the Template Options in Expression Web 4
137
ASP.NET must be running on the server where you intend to host your site(s). The ASP.NET master page system is an example of a run-time feature. Even though ASP.NET must be running on the server where you’ll publish your production Web site, you don’t need to do anything to get ASP.NET running on your local computer. Because Expression Web 4 includes the Expression Development Server, you can build and browse most ASP.NET files locally without taking any extra measures. Expression Web also displays the combined files in the workspace so you’ll have a better feel for how your final layout is going to look. The combined view generally simplifies the design process in the ASP.NET workflow as well.
Use an ASP.NET master page Note Use the SampleSite site you opened in the previous exercise. Open this book’s sample site if it isn’t already open.
1. From the File menu, select New, and then click Page. The New dialog box opens. Click the ASP.NET category on the left side, and then click Master Page.
Notice the Programming Language field. Expression Web uses Microsoft Visual C# by default, but you can also choose to use Microsoft Visual Basic. The choice of
www.it-ebooks.info
138
Microsoft Expression Web 4 Step by Step
programming language generally depends on the language used for the overall project. This book uses the default C# selection unless otherwise noted.
2. Click OK in the New dialog box. The dialog box closes, and a new master page named Untitled_1.master appears in your workspace. If Untitled_1.master didn’t open in Split view, click Split at the bottom of the workspace.
Take some time to examine the new master page. You can see in the Design pane that Expression Web has created a content placeholder named ContentPlaceHolder1 within the body of the page. Notice in the Code pane that this placeholder is wrapped by a form tag. This is not a standard HTML form; it’s used by the ASP.NET system. Scroll up to the head section of your master page in the Code pane, and you will see another content placeholder with an ID of head. This placeholder is there so designers can provide different content in the head sections of pages attached to the master page.
3. In the Folder List panel, expand the templates folder, and then double-click red.html to open it for editing. Click in the body of the page in the Design pane. On the Quick Tag Selector, point to the tag, click the arrow, and then click Select Tag Contents.
www.it-ebooks.info
Chapter 3 Capitalizing on the Template Options in Expression Web 4
139
4. In the Code pane, right-click the selected body tag contents. Select Copy from the context menu.
5. At the top of the workspace, click the Untitled_1.master tab to make that page the active document in the workspace. Click in the Design pane, and on the Quick Tag Selector, point to the