RE: [coldbox:22381] Re: [coldbox-3.8.1] Core functionality for multiple websites

Yep, when I got back to my computer I was going to dig up that recording. It should be on coldbox.org under media > ColdBox connection.

Here it is:
http://experts.adobeconnect.com/pzu9rc9pc0/

Basically, you can have multiple “shell” applications that get their models, handlers, views, layouts, from a shared common source. You can also use inheritance to extend the core handlers, etc and override on a per-site basis.

And with recent enhancements in modules, you could also write a common module in source control that you build and deploy into multiple sites at the same time.

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

And another approach is something like this, although this setups for ORM usage the same approach can be used to just have multiple sites at run time.

http://www.andyscott.id.au/blog/writing-a-coldbox-application-to-handle-more-than-one-site-with-orm-support

The on thing that I don’t like about Brad’s approach is that there is too much manual configuration, that is all over the place. The solution that I adopted back in 2008/9 was to have a small code base that does what the blog article above is doing.

From here we have one central DB, flat file or whatever you want to use to pull that information up. This not only allows for the same code to be used, it also allows for you to do the same with the ORM. Make one change in on location and your not going through code and sites to make continually change sin the actual code.

But aside from that, all the paths are dynamically changed based on the URL. Which allows for the likes of sub domains to also have the same code base with little to no more work on IIS.

It might sound complicated, but it is actually a lot more flexible that the approach in the video from Brad.

Does Coldbox 4 and/or improvements in the modules change this approach at all?

Dan

Brad,

I am testing this concept out with a shared directory and 2 apps using the external handlers/views & layouts, as well as the 2 apps have a VD to the includes folder. A script file inside of /includes/js has an ajax call to model cfc’s which it cannot find.

Any suggestions for this? The jQuery Ajax URL parameter has to be a publicly visible URI and seems like I need to get it to accept a system path. Trying to get by with minimal duplication of code.

Thanks,

Dan

I’m not really following that, but if you need a CFC to be web-accessible and it’s not in the web root, create an alias (Apache) or virtual directory (IIS) for that folder.

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com