Topics
Dates
200902 · 05 · 06
2008
01 · 02 · 03 · 04 · 07 · 08 · 09 · 11
2007
06 · 07 · 08 · 09 · 10 · 11 · 12
Also check out FishoftheBay.com for more thoughts about design and life.
Formatting File Names
Web Development February 26, 2008
In case you don't do this already, I wanted to point out the advantages of using some kind of format for naming all your files (or at least the images).
It can easily become confusing to remember what you named your images when you've uploaded dozens to your site. So when this becomes the case, you may find it useful development-wise to come up with some kind of format for naming your images. Perhaps all start with a unique name followed by an underscore and some other keyword, etc.
On my social-networking sites, user-uploaded images are usually in the format of photoID_userID_albumID or something. Similarly, website images on my site are labeled with an extension of "_sm" for the smaller versions. In this way, I can create a loop to run through an array of image names, simply appending the "_sm" extension if I want to show the smaller version. Also ensure you use the same filetypes (don't make some jpgs and others gifs unless there's a good reason!).
This filename formatting allows for easier development because if multiple files have similar names, you can program more generically, which means if you add more images, you don't have to change your code. For example, if all your icon files start with "icon_", you can quickly find them in your directory and search for them in your code. Standardizing your image names greatly reduces time and increases efficiency in your coding.
Additionally, if you're coding generically already, think about creating a PHP array on your page to store information about a picture. Adding an "alt" and "title" attributes to your image tag can greatly enhance their presence on search engines.
Just a recommendation :^)
Other Web Development Posts
The Pitfalls of Site Re-Launching Alone
Last week I launched a revamp of my site, OneUpMe.com which I spent most of the previous weekend re-coding. I don't have a team of developers and designers to make sure everything goes according to plan, and as such I...