RE: [coldbox:13972] [coldbox 3.5.0-BE] RequestContextDecorator guide

Because I have to have a separate Coldbox.cfc for each site.

That’s why I use symlinks (unless I’m misunderstanding?).

Therefor my folder structure is (for example):

/views/homepage.cfm

/views/myaccount.cfm

/views/custom/site1/homepage.cfm

/views/custom/site2/myaccount.cfm

And in Coldbox.cfc for site 1 is “viewsExternalLocation = “views/custom/site1”…etc. etc.

Then everything is symlinked to the core application other than Coldbox.cfc – which is unique to each site, as they have separate settings, cache locations, datasources…

My “core” application is never actually used – every site using the app symlinks to the “core”.

I just have one folder locally, where the app and all customisations are – there are no copies, only symlinks on the server.

This was directed at Tom, but I can answer it.

First I don’t think it was his intention of common shared code in the externals location, but the other way around. He clearly indicated that he would like to see the handlers external location be called first over the standard handler, so I am not sure he is doing it the way you think he is.

If this was directed at me, I never said that.

Tom that is exactly the reason why I tackled it the way I tackled it, the difference for me was that I looked past doing the different coldbox.cfc and used an interceptor to change the external views / handlers etc.

So in essence I ended up with something like this

System
->Controllers
->Plugins
->Interceptors
->Modles
->Domains
->Services
->Modules
->Views

System would be the default core application, and for anything out side that I then had

User
–>Site1
–>Controllers
–>Plugins
–>Interceptors
–>Modles
–>Domains
–>Services
–>Modules
–>Views

->Site2
–>Controllers
–>Plugins
–>Interceptors
–>Modles
–>Domains
–>Services
–>Modules
–>Views

->Site3
–>Controllers
–>Plugins
–>Interceptors
–>Modles
–>Domains
–>Services
–>Modules
–>Views

->Site4
–>Controllers
–>Plugins
–>Interceptors
–>Modles
–>Domains
–>Services
–>Modules
–>Views

->Site5

–>Controllers
–>Plugins
–>Interceptors
–>Modles
–>Domains
–>Services
–>Modules
–>Views

Now I was lucky because this model also applied to my database as well, which means I could different databases that extended core database tables / columns as it was all CF-ORM and made it easier to do as well. But the interceptors job was to basically determine what site was being run, and set up what was needed to be set up, and that meant changing the external views location, and handlers and plugins etc., based on which site was running. Most of the sites external folders had little to no extra stuff in there, but it allowed for the same functionality to go across each site, with either a different view aka skin / theme, or provide different functionality to the web site.

I chose this approach, because I didn’t want to have multiple coldbox config files to worry about.

btw this directory structure is all under the webroot, and is one application based code, less maintenance and less that can go wrong.