Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Oct 2012
    Posts
    3
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Multiple sites running off same code

    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.

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    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.

  • #3
    New to the CF scene
    Join Date
    Oct 2012
    Posts
    3
    Thanks
    2
    Thanked 0 Times in 0 Posts
    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.

  • #4
    Regular Coder Custard7A's Avatar
    Join Date
    Jul 2010
    Location
    Australia
    Posts
    286
    Thanks
    32
    Thanked 33 Times in 33 Posts
    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.

  • #5
    New Coder
    Join Date
    Sep 2011
    Posts
    80
    Thanks
    0
    Thanked 13 Times in 12 Posts
    Have a look at the way WordPress themes work. Every installation of WordPress will have the same framework, but only the theme and plugins are usually changed by users.

  • #6
    New Coder
    Join Date
    Oct 2012
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •