Hi
I’m pretty new to CSS, and was curious about how to build the following type of framework. I do a little design work so I thought I’d make graphic to help visually communicate what I want to do. I want php to automatically assign variable names to assets within directories, then call them into pre-set locations on a website.
Let me give you some background.
I want to build a database of case studies on non profit projects and their founders. I want to automate the insertion of content as much as possible, by using a framework that will insert content into its respective project page (each project page showcases a video episode). Each project will have a page, with an article about it, graphics, and video.
In order to make this system, ( I think) I need to build some php code that calls content out of content directories. That is, I will either have content stored in main directories, such as a graphics directory, which would contain subdirectories, with each subdir. containing content to be inserted into predetermined locations on its respective project page.
Another option, I think, would be having main directories for each project page, and then having sub directories for each type of content (graphics, video, animation, etc.)
For example,
Lets say there is a project called EcoSchool, with content including 1 text article, 4 graphics, 2 videos, 2 short clips and 2 animations. In fact, every single project will have the same data set of content listed above, to make things easy to automate.
First of all, I know I need to automate the creation of these datasets.
But, before I can do that, I think I need to build a sort of template data set, which plugs into a web template that I’ll make in html and css, with php in certain places to insert variables.
–Now, once I build this template as a sort of map, I want php to build all the other ones, looping until it creates 20 pages. So this means I would have to use php to create copies of my php and css, auto-incrementing variables that are unique within each data set. So, for example, every single project page would have directories that all have a graphic1.png thru graphic5.png (because there are 5 graphics per data set i.e. parent variable i.e. the project page)
I know that each project page is going to represent either an array or a parent variable (Which one, I wonder? still confused by difference between an array vs. a parent variable with a bunch of child variables).
Anyways, when a user clicks a link for the EcoSchool project to view it, they will be directed to a page that pulls up all the content into the preassembled template
“hey, pull all of the EcoSchool variables for the various content, and put them in the right spots”
Each spot will be a variable within the html.
I understand this far.
However, how what I am wondering is, how do I go about creating php that will call up content from directories automatically.
Specifically,
if there are 5 graphics in the graphics directory, php will automatically assume they are in the correct order, and place them in positions $EcoSchoolGraphic where represents that graphic’s order within the directory.
Basically, my question is:
-
Which way do you think I should organize this site map?
Option A: As depicted in the sitemap graphic I attached-- main dir: content specific, sub dir: episode specific
Option B: Main dir: episode specific, sub dir: content specific -
Can php alone be used to build this type of self assembling site, or do you think that it may need some javascript involvement?
-
Could you give me some idea of how you would go about building this type of framework?
-
Do you know of any tutorials with similar ideas?
-
How do I use php to automatically assign variable names assets with a directory? once I can do this, I can pull the variables up client side. So i’d just need a template I guess… right?
Any guidance is greatly appreciated.
Thanks tremendously.
link to graphic: https://dl.dropbox.com/u/85645202/Sitemap-for-self-assembling-site2_03.png