making a simple site/cms template (directory structure)

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Post Reply
User avatar
Sindarin
Forum Regular
Posts: 521
Joined: Tue Sep 25, 2007 8:36 am
Location: Greece

making a simple site/cms template (directory structure)

Post by Sindarin »

I am making a very simple site/cms template, currently reviewing its directory structure,

Code: Select all

/site/ { root folder, contains index page,htaccess,page templates,robots.txt etc. }
	/files/ { contains the site resources images,css,javascripts,feeds }
		/styles/
		/jscripts/
		/images/
		/audio/
		/video/
		/flash/
		/fonts/
		/feeds/
	/cms/ {folder for cms of the website}
		/files/ { contains the cms resources images,css,javascripts,feeds }
			/styles/
			/jscripts/
			/images/
			/audio/
			/video/
			/flash/
			/fonts/
	/uploads/ {contains user uploaded files}
	/system/ {contains files used both from the site and the cms, settings, languages, php classes}
		/config/ {contains site/cms settings, initializes variables,objects etc.}
		/errors/ {contains error files 404,500 etc. }
		/includes/ {includes page sections like header,footer,menu,page body for site}
			/cms/ {includes page sections like header,footer,menu,page body but for cms}
		/languages/ {contains language files for site}
			/cms/ {contains language files for cms}
		/libraries/ {contains php classes}
Do you see any flaws to this concept? How would you do it?
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: making a simple site/cms template (directory structure)

Post by pickle »

I think something like this can safely be considered subjective. I'd have slightly different file structure, but there's certainly nothing wrong with this. The important thing is that it's organized & orderly, and this certainly is.

Just curious - what will be in the "audio"? Are you doing interface sounds?
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: making a simple site/cms template (directory structure)

Post by Christopher »

Since this is subjective, the first thing I noticed was the 'files/' directories. I would get rid of them. They just add a layer without adding any meaning. And I regularly see a "js" or "scripts" folder (I often alias one to the other to provide both) but never a "jscripts" ... that seems non-standard.
(#10850)
User avatar
Sindarin
Forum Regular
Posts: 521
Joined: Tue Sep 25, 2007 8:36 am
Location: Greece

Re: making a simple site/cms template (directory structure)

Post by Sindarin »

Since this is subjective, the first thing I noticed was the 'files/' directories. I would get rid of them. They just add a layer without adding any meaning. And I regularly see a "js" or "scripts" folder (I often alias one to the other to provide both) but never a "jscripts" ... that seems non-standard.
"jscripts" sounded a bit weird to me as well, especially after reading the jscript article ( http://en.wikipedia.org/wiki/JScript ) on wikipedia. Previous names were "javascripts" or just "scripts" (which I later changed because scripts could be also PHP scripts and this folder was intended for javascript).
I suppose I could go with "javascripts" and change "styles" to stylesheets maybe for naming consistency.

I am generally not a fan of placing /css/ /js/ /swf/ etc. folders in the root, I believe is a little better to have them inside an files/assets "group" folder
I think something like this can safely be considered subjective. I'd have slightly different file structure, but there's certainly nothing wrong with this. The important thing is that it's organized & orderly, and this certainly is.
Thanks for the input.
Just curious - what will be in the "audio"? Are you doing interface sounds?
Possibly yes, or audio instructions and the like. The "audio" folder is mostly going to be used for HTML5 audio, everything flash-based goes inside the "flash" folder.
Post Reply