473,409 Members | 1,979 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,409 software developers and data experts.

How do professional Web developers structure their "assets?"

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
2 2951
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Harry von Borstel | last post by:
Hello database friends, We are seeking beta testers for our upcoming "blueshell Data Guy Professional". This new application is an extension to our award-winning universal database editor...
4
by: Mikkel christensen | last post by:
Hi there I wonder if any of you could point me in a direction where I can find some usefull information about coding standarts. I have some generel experiense in programming but I lack many...
3
by: Leo Nunez | last post by:
Hello! I need copy from structure "A" to "B" that contains "strings" in a one line code. Me problem like this : typedef struct tHeader{ char field1; char field2; char field3;
0
by: shengmin.ruan | last post by:
i got a struct like: --------------------- public ref struct OutPacket{ int m_replyIndex; List<MainInfo^>^ m_mainInfos; }; --------------------- when i pass it to another process, i have...
0
by: tommak | last post by:
It's a dream of human beings to build machines that can think and behave like human beings. The most important part of of such a machine is an artificial mind that can emulate the cognitive...
3
by: darkenergy | last post by:
Hi all, I want to do a similar thing as class inheritance in C++, but with structures in C. I have a structure A, and I want to define a second structure B (in different .h/.c files), which has...
2
by: psbasha | last post by:
Hi, Whether we have "structure" concept available.I have to create a different datatypes to be stored. Say in C/C++ we use struct Point{ int PntID; double xCoord;
2
by: slinky | last post by:
I'm getting a error when I open my . aspx in my browser... line 34: da.Fill(ds, "Assets") Here's the error and my entire code for this .aspx.vb is below that ... I need some clues as to what is...
2
by: alwaali | last post by:
Hi I need help please This is my project and i need a help to solve it with you A page of text is to be read and analyzed to determine number of occurrences and locations of different words. The...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.