PDA

View Full Version : Logic behind changing styles in a cms



SlowRoasted
November 2nd, 2005, 10:14 AM
Okay I'm going to be starting a project making a cms for a very specific market. I want this cms to be as customizable as possible of course. One thing I definitely want it to be able to do is change the style sheet info from the admin panel. Can anyone explain to me the way this is accomplished. I would like something like the way vbulletin does their style options, not the template system but being able to change font colors and certain images.

So far im thinking there is a file or database table that you update with new style info. You could include that file in the page and put the specific css info in with php from the included file. Or you could get the info from a database query. Is this the best way to go?

I also need to make one of those color picker javascript things. Are there any opensource ones out there?

Thanks for the help:P

ironikart
November 3rd, 2005, 01:11 AM
I wouldn't store the css + template info in the database, use flat files to store them. Take a look at smarty templates and see how their templating system is written. very sexy ;)

If you're only going to have a few different designs to pick from just use the folder structure to define different designs and then when you pick them, just allow the user to pick a directory, which would co-incidentally be the template name... then store that choice against the user's profile. Then when the use logs in, it uses that choice to construct the right path to the template directory.

There are a ton of those javascript thingies floating around. Hotscripts.com should have a few you can pick from.