View Full Version : Multiple sites running off same code

10-25-2012, 10:20 PM
Im interested in making multiple websites, all with the same basic functionality but will have different designs or templates. is there a way they can all run off the same basic underlying code, but use different templates. what is the best method of doing this.

10-25-2012, 10:28 PM
Sure. Any site using any CMS or mainstream forum system is the same code. Data and designs are different in all of them, but the code is the same.

10-25-2012, 11:04 PM
Yeah, im kind of meaning the best way, since each site will have different designs, so the underlying, base code will have to be separate from the design. I have no experience in doing this.

10-26-2012, 04:18 AM
Your server-side code shouldn't generally be tied to the design anyway, that's not to say it doesn't happen. Perhaps you might have thematic options for your users, which you handle in the server-side code. If you plan to dynamically include style-sheets, classes, IDs, or anything that you might want to change when re-purposing the script, then it would be good practice to assign it to a constant, and put the definition of that constant somewhere accessible. The largest issue with re-purposing scripts is portability, so keep in mind what you might want to change in the future, and code accordingly.

10-26-2012, 06:07 PM
Have a look at the way WordPress themes (http://codex.wordpress.org/Using_Themes) work. Every installation of WordPress will have the same framework, but only the theme and plugins are usually changed by users.

10-29-2012, 01:54 PM
You have check a design principle like model view controller, so that at least you "view" parts are separate for each site then using sym link your model and controller folders to a concrete source. You will put all your app code in one folder than each site you would have template files, CSS, images, JS, etc in the web root as normal.