Old habits die hard - images directory
Most people who have been designing websites for any amount of time have probably created an images directory at the root level of their site and probably still do. Maybe it's not called images, but img, or even just i for the hard-core, Zeldmanesque-make-the-mark-up-as-light-as-possible fans. Afterall, this sort of organization made sense. Designs of old required countless images to create a certain look, and without a separate directory contain them, the root level of a site became a behemoth of tiny images that html later assembled into a coherent presentation. Designers looked at this awful mess of files and created a separate directory to contain all of these little files and better organize their web directories, and it was good better.
To this day, I create sites that use an images directory to store all of the little pictures, icons and other bits of a layout. Indeed, I have an images directory on the root level of this blog. It contains but one image: the little icon that marks external links. In today's age of web standards, I think this is a convoluted practice.
xhtml separates style from content, and to that end, images don't belong in a page's content nearly as much as they once did. In fact, if the xhtml standard proceeds as planned, the image tag will cease to be. So why then, do we religiously put an images directory in the root directory of our sites? I say it's from force of habit.
Images associated with the presentation don't belong in their own branch of the site's hierarchy, indeed they belong in a directory with the style. Images referenced in a CSS are referenced in a path that is relative to the CSS file, not the xhtml file. To that end, doesn't it make sense that the images directory belong in the style directory? It sure does to me. It allows for superior style management. I can take my css file, and all images associated with it, and move it around easily. Indeed, there should be a separate images directory for each css theme.
But what of images that belong in the content? Very well, then this might be a case where an images directory is useful. Indeed, I use an 'uploads' directory personally (which is shamefully placed within the images directoy). Uploads is perhaps not the best name in this day and age of semantic design, but it feels more appropriate than the more generic term, images. Perhaps in a few years, we'll have an object directory instead.
My little icon for new links doesn't really even belong in the images directory. It belongs in the styles directory. That icon should be tied to the appearance of the site, not its content.
But old habits die hard, and my little images directory sits happily at the root level of the site's structure. And even if I empty out the images directory, I don't know if I could easily let it go. I know it's silly, but most habits really are when you step back and look at them, and yet we hold onto them anyway.
- under:
- Web Development
- Posted on
- 2005-02-22
Comments:
Hmm...
Looks like it's time for me to learn CSS...
Interesting argument
But it may be overthinking the problem.
For most sites it will be overkill. If you're planning a skinnable system then I can see going this route but for a large portion of sites why bother?
I hate to sound idignant and lazy but it just seems like you're asking for confusion on a large majority of sites. One directory properly organized into sub-folders is all you really need.
An upload directory is a good idea, but should be outside your images directory and any uploads should be moved via php at time of upload (or later, after inspection and approval) into a more secure directory. I name mine uld by the way.
And here comes another dictionary rant: I looked up Indignant to make sure I got it spelled right and the first definition in the list was - Characterized by or filled with indignation. How the bloody hell does that help? Sheesh.
This article is closed to further commentary. But you can always contact me directly.