By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,025 Members | 2,118 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,025 IT Pros & Developers. It's quick & easy.

How do professional Web developers structure their "assets?"

P: n/a
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.
Jul 19 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On 7/19/2007 4:11 AM, -Lost wrote [in part]:
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>
Jul 19 '07 #2

P: n/a
David E. Ross wrote:
On 7/19/2007 4:11 AM, -Lost wrote [in part]:
>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!
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.
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.
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.
Jul 20 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.