sign in | join about | help | sitemap
Connecting Tech Pros Worldwide
-Lost's Avatar

How do professional Web developers structure their "assets?"


Question posted by: -Lost (Guest) on July 19th, 2007 12:15 PM
And by assets, just in case it is a moronic term, I mean CSS,
JavaScript, images, server-side includes et cetera.

Primarily I am worried about just the CSS, JavaScript, and image aspect.

I've always for example, separated, layout and positioning from say
style or how elements should look. So for each "theme" I might have 2
CSS files. They would go into a directory like /theme/theme_name/css

The images for each theme would then be in /images in the theme_name
directory. Same with JavaScript (/js).

However, I was looking at a nicely designed site just a few moments ago
and saw structure like this:

/res/js/submodal/submodal.js
/cm/ad_popunder.js

/res/css/submodal/submodal.css
/res/css/splash.css

/res/img/splash/backToSchool.jpg

So, I guess I can understand "res" being resources and "cm" being
content management maybe, but doesn't this structure seem a little
involved? I mean, you edit an image and you have to backtrack to /res/
then image and so on. Same with the CSS and JavaScripts being in
numerous directories.

It was http://www.greatschools.net/ for anyone interested. Gotta' get
my children registered for classes!

So, boring and long rambling story over. What do *you* professionals do?

--
-Lost
Remove the extra words to reply by e-mail. Don't e-mail me. I am
kidding. No I am not.
2 Answers Posted
David E. Ross's Avatar
David E. Ross July 19th, 2007 07:25 PM
Guest - n/a Posts
#2: Re: How do professional Web developers structure their "assets?"

On 7/19/2007 4:11 AM, -Lost wrote [in part]:
Quote:
Originally Posted by
And by assets, just in case it is a moronic term, I mean CSS,
JavaScript, images, server-side includes et cetera.
>
Primarily I am worried about just the CSS, JavaScript, and image aspect.
>
I've always for example, separated, layout and positioning from say
style or how elements should look. So for each "theme" I might have 2
CSS files. They would go into a directory like /theme/theme_name/css


I structure my site in a way that facilitates maintenance. For that,
one of the most important considerations is locating all files relating
to a particular topic. Thus, if I have 5 or more Web pages relating to
the same topic, I generally place them into a subdirectory for that topic.

I have a single, global CSS file in my main directory. If I need
additional styles or need to over-ride a style for a subdirectory, I
place the CSS file for that into the subdirectory containing the HTML
files. (I also have a reprints.css file in my main directory to
over-ride my global CSS file; reprints.css is used to format pages that
are reprints of newspaper pages.)

Image files that are used by files in my main directory or that are used
by more than one subdirectory go in my main directory. Image files that
are used by only one subdirectory go in that subdirectory.

For all of the above, references within a subdirectory are done relative
to that subdirectory. References to other subdirectories are relative
to my site's main directory. This will facilitate moving my Web site if
I decide to change hosting services.

Because of the way SSIs are accessed, all my SSI scripts are together in
the same /cgi-bin subdirectory. This is not my choice; this is dictated
by my ISP's Web server, which hosts my site.

--

David E. Ross
<http://www.rossde.com/>.

Don't ask "Why is there road rage?" Instead, ask
"Why NOT Road Rage?" or "Why Is There No Such
Thing as Fast Enough?"
<http://www.rossde.com/roadrage.html>
-Lost's Avatar
Guest - n/a Posts
#3: Re: How do professional Web developers structure their "assets?"

David E. Ross wrote:
Quote:
Originally Posted by
On 7/19/2007 4:11 AM, -Lost wrote [in part]:
Quote:
Originally Posted by
>And by assets, just in case it is a moronic term, I mean CSS,
>JavaScript, images, server-side includes et cetera.
>>
>Primarily I am worried about just the CSS, JavaScript, and image aspect.
>>
>I've always for example, separated, layout and positioning from say
>style or how elements should look. So for each "theme" I might have 2
>CSS files. They would go into a directory like /theme/theme_name/css

>
I structure my site in a way that facilitates maintenance. For that,
one of the most important considerations is locating all files relating
to a particular topic. Thus, if I have 5 or more Web pages relating to
the same topic, I generally place them into a subdirectory for that topic.


Very interesting. For a static site I can see that being an awesome
decision. Thanks for that!
Quote:
Originally Posted by
I have a single, global CSS file in my main directory. If I need
additional styles or need to over-ride a style for a subdirectory, I
place the CSS file for that into the subdirectory containing the HTML
files. (I also have a reprints.css file in my main directory to
over-ride my global CSS file; reprints.css is used to format pages that
are reprints of newspaper pages.)
>
Image files that are used by files in my main directory or that are used
by more than one subdirectory go in my main directory. Image files that
are used by only one subdirectory go in that subdirectory.


I do the very same thing, only there are main CSS, JavaScript, media
directories. I don't clump everything into the base directory.
Quote:
Originally Posted by
For all of the above, references within a subdirectory are done relative
to that subdirectory. References to other subdirectories are relative
to my site's main directory. This will facilitate moving my Web site if
I decide to change hosting services.


You know, I have never agreed with static absolute URLs. They break
much too easily.
Quote:
Originally Posted by
Because of the way SSIs are accessed, all my SSI scripts are together in
the same /cgi-bin subdirectory. This is not my choice; this is dictated
by my ISP's Web server, which hosts my site.


Ah, such is life. ;)

I want to thank you for your informative response. I appreciate it.
And by the way, I thoroughly enjoy reading your site. In fact, it
appears I have come across it before having doing so again today after
seeing the URL in your signature.

Anyway, reading about your days at Unisys, and CA, Inc. is just, I don't
know... enthralling. If you ever get bored, I'd love to hear more about
your military programming involvement. And unless I've missed it on
your site, I think I would enjoy an ethics and theory article from
someone with your programming experience.

Thank you very much for your reply.

--
-Lost
Remove the extra words to reply by e-mail. Don't e-mail me. I am
kidding. No I am not.
 
Not the answer you were looking for? Post your question . . .
197,040 members ready to help you find a solution.
Join Bytes.com

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 197,040 network members.
Post your question now . . .
It's fast and it's free

Popular Articles

Top Community Contributors