Ok here goes…
About 12 months ago I made the suggestion, that would allow a custom layout to use a defined template for the home page, as it stands ContentBox will only accept either a blog page or a custom page defined within ContentBox.
That means, enhancing ContentBox with some very good WordPress themes, impossible to achieve. I would have to show you what I started working on to appreciate that problem. But the solution was to override the code in ContentBox that does the preEvent()… Sorry I kept saying prePrcoess()
Anyway in a framework I began working on, that allows child themes to be created from a parent module that allows the re-use of code. Amongst this I am defining the page that will be defined as the home page, so that I can override ContentBox.
As an example ContentBox does this in the BaseContentHandler.cfc
// Home page determination either blog or a page
if( event.getCurrentRoute() eq “/” AND prc.cbSettings.cb_site_homepage neq “cbBlog”){
event.overrideEvent(“contentbox-ui:page.index”);
prc.pageOverride = prc.cbSettings.cb_site_homepage;
}
This forces ContentBox to handle everything.
The solution would be for my custom framework then do intercept and make the following change when it is called.
//------------------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------------------
public void function preEvent(event, interceptData) eventPattern="^contentbox-ui" {
if( event.getCurrentRoute() eq “/”) {
event.overrideEvent(“myModule:displayHome.index”);
}
}
This then forces my framework to take control from ContentBox… But that is until ColdBox blocks you.
You see the preEvent() above in my framework is never called, that is because the overrideEvent() has already been called. So we then dig further into controller.cfc and we can immediately see the problem, I won’t spell it out below because I have already done that in the other 2 threads.
But what the problem is if one person already has an overrideEvent() another author or user will never be able to use this, which can cause problems if that handler relies on things being setup in that preEvent().
I thought I spelled that problem out, and it is a problem with ContentBox, as I stated if one wants to override ContentBox to provide even an external home page or provide things with better ease in ContentBox it currently can’t be done with the problem as described.
I am sure I don’t need to spell this problem out any further!
But because all my new modules, now rely on this one module being loaded, and certain things being setup in that preEvent() for the handler, everything stops working for my modules, because that preEvent is never going to run as it currently stands.