Home > Articles

  • Print
  • + Share This
This chapter is from the book

Considering Site Organization

There are many opinions on the proper way to organize a Web site. Some people like to compartmentalize all the files into directories and subdirectories. Some people like to have a very shallow structure, with many files in a single directory. As you get more experienced at Web development, you'll find your ideal organization. It's nice to exchange ideas with other Web developers or hobbyists so you can learn from the successes and failures of others and they can learn from yours.

I have a directory on my hard drive called Projects, shown in Figure 3.14. The Projects directory contains a directory for each project I'm working on. Within each project directory there is a directory called Web, set as the root directory for the project. This is the directory where I keep all the development files for the site and the directory that I set as the root in Dreamweaver.

Figure 3.14 An example directory structure, in which the Web site is housed in the Web directory.

This directory structure enables me to put other files in the client's folder without making them part of the Web site. It's good practice to keep other files separate from those you plan to transfer to the Web. You may prefer to have one directory that contains all of your Web sites. Whatever works best for you.

Put some thought into how you'll organize the files in your Web site before you start a project. You will probably want to create a separate images folder to hold your images, as shown in Figure 3.15. If you have other types of assets, such as sound or video, you might want to create separate folders for those, too. I always create a scripts directory to hold external JavaScript files and external Cascading Style Sheet files; you'll explore these in the later hours of the book.

Figure 3.15 Organize your Web site into images and other directories.

If you have different sections of your Web site, do you want to create separate directories for the images in each section? It might be a good way to organize your site. Then again, if the same graphics are used across multiple sections, it might just make the images hard to find. Make sure that your organizational logic isn't going to break down in the future.

Luckily, if you do have to rearrange assets, Dreamweaver will update any links for you. When you move a file, Dreamweaver asks you if you want to search and update links to that file. That's what the site cache is created for. However, it is still better to make wise design decisions at the beginning of a big project.

I also try to logically break up sections of Web sites into separate directories. If your Web site has obvious divisions (departments, lessons, products, and so on), you can create directories to hold the Web pages in each of the sections. You'll be surprised at how even a small Web site becomes quickly unmanageable when all the files are dumped into one directory.

  • + Share This
  • 🔖 Save To Your Account