Changing the Layout Within a Single Page Area for your Solution Site

Another aspect of page layout occurs at a lower level, within each of the content areas defined in the files template\layout1.asp and template\no_menu.asp. Changing layout at this lower level consists of changing the HTML code that comes from one or more of the content sources. The layout with the content area controlled by the string assigned to the variable htmPageContent is an obvious example of changing low-level layout. Since the content area is one of the large areas of the page, it is normal to expect its layout to vary more from page to page. Indeed, the content area being different is, to a large extent, what makes one page different from another. Therefore, changing the code that creates the contents of the variable htmPageContent for a particular page might only change the content area for that one page. Whether your code changes affect content on more than one page is largely dependent on where you make the changes. If your changes are in the routine Main or its supporting routines in the page file itself, only that page will be affected. If your changes are made to one or more of the utility routines in the files that are included in multiple pages, every page that includes any of the modified files will be affected.

A more interesting aspect of low-level layout changes concerns the areas of the page other than the content area associated with the variable htmPageContent. If you make changes in the HTML produced within one or more of the files included in either the template\layout1.asp or the template\no_menu.asp files, those changes will be seen throughout your site on whatever pages incorporate those files through the layout page that they include. The files in this category, as delivered in the Solution Sites, are:

The other file that produces HTML content is the file template\discount.asp. The HTML produced by the script in the file discount.asp is passed back to the file template\layout1.asp using the variable htmDiscountBannerSlot. The entry point in this file is the RenderDiscounts routine. This routine is only called in the two files basket.asp and product.asp.

All other pages in the site do not display the discounts area, for one of two reasons. First, they might include the alternative layout file template\no_menu.asp, which does not include the contents of the variable htmDiscountBannerSlot in the content it produces. Second, the variable htmDiscountBannerSlot might remain initialized to the empty string because a call to the routine RenderDiscounts is never made.

See Also

Page Layout Variables for Solution Sites

Page Layout for Solution Sites

Page Execution Model for Solution Sites

Copyright © 2005 Microsoft Corporation.
All rights reserved.