Need Add Your Sitemap?

Sunday, 7 October 2007

1.5.3. Optimal Include Layout

The optimal include layout is to provide includes for both geographic areas of your web page and for specific ad programs. The two should not be the same, although one can go inside the other and (at least initially) consume all its area. If you don't follow this organizing principle, down the road to take one example you'll find that you named the include for the entire right side of your content pages Google_ad_right, even though it by now contains a variety of graphic elements, but no Google skyscraper.

It may be a bit easier to understand how to lay out includes with future flexibility in mind using an example. Featured Feeds, http://www.feedly.com, shown in Figure 1-5, is perhaps a bit cluttered with ads, but the underlying composition of PHP includes will make this easy to change. The composition of PHP includes used to construct the Feedly.com site is shown in diagram form in Figure 1-6.

Figure 1-5. While the Feedly.com site appears cluttered, the underlying PHP composition makes it easy to clean up

Figure 1-6. The composition of includes used in Feedly.com

Figure 1-6 shows that there is an include for each geographic area of a page that will carry graphics or ads: Top.inc, Left.inc, Bottom.inc, and Right.inc. Within the geographic includes are ad program specific includes for each ad program or type of ad. A final include holds a navigation panel at the top of the site above the page individual content.

This arrangement gives the maximum flexibility and won't have you contorted like a pretzel in the future. You can change any of the graphics in a geographic include. Alternatively, you can change ad code and swap, add, and delete ad programs in a very granular fashion. Changes take place globally across a site, but they have very little impact on the rest of a page.

Since Feedly.com is organized as I've explained, it took me less than 10 minutes to clean the site up a bit by editing the contents of the Left.inc and Right.inc include files. Once I uploaded the edited include files to my web server, the changes that I made to these includes were instantly propagated throughout all web pages on the site. I think you'll agree that the toned-down site is less cluttered (Figure 1-7), but tweaking a content site until the mixture of ads and content is right should be an ongoing effort. Fortunately, using includes takes a great deal of the pain out of the process.

Figure 1-7. It took only a few minutes to make all the pages on the site less cluttered

Back To Index

0 Comments: