He Luis and others, I had been playing around with creating a module and looking at the interceptors some. Problem is tha I see some short falls to this, and wondering if this is the way I am approaching it or something else.
When an entry or blog page is displayed, it seems to run two type of controllers ( I think this is what you might call them) or helpers. The problem is that with multiple entries the interceptor is fire only once, this is a problem because it really isn’t an interceptor it’s an event that is being called.
Now my view or how I see it is this, when the rendering of these entries is done. They are done with a collection in the helper, but there is no way to intercept each one or the base call with the collection. This raises a problem because it makes it hard to modify the data, before it is rendered. I could use the render data interception but I am not sure that is a wise choice. As it would apply to all widgets on the page.
I would like to know why some are like #cb.event()# when in a view rather than an interception point, and how would the best way to go about doing proper interception on these?
And the other problem I noticed is that if you have a collection, the event is on the outer. Which means if you need to modify each individual collection you can’t.
Click on an entry title to view a specific entry and you will see the dump inserted into content exactly where it was announced. If you are debugMode, you will see a log message in the ColdBox Tracer Messages panel: “EntryInterceptor: cbui_preEntryDisplay interception received”
I created the interceptor and registered it within the contentbox-ui module but it could have been created and registered in any module or the parent app.
No it never has… And this as I stated was in a module, as that is where I need it.
Also Luis if you’re reading this, I think the event / announce should be in things like
#cb.quickEntries()#
The reason being, is that people writing this stuff have to worry about announcing the event. So when I look at index.cfm view for default layout, there is no event for. Which means one has to go an modify other peoples layouts to make changes that they may not even know.
Secondly as I stated quickEntries() will not fire for each iteration, where as if it was announced inside the quickEntries one could pass the data across as this is where it is being loaded.
The example interceptor I gave was also created in a module, the contentbox-ui module and worked. It could have been created and registered in any module, including a module managed by the contentbox admin. To test, I just created a interceptors folder within the Hello example admin module. Then dropped the example interceptor code I gave in that folder. Then for step 2 register it within the Hello ModuleConfig.cfc instead.
Register Interceptor in the contentbox-ui ModuleConfig.cfc interceptors section
Ok I found out what the problem is, and I do not know why.
But if you put html in this Before A Blog Entry: then the interceptor will not fire, but when I restarted ColdFusion then it went the other way around and the interceptor fires but the html will not get outputted.
Not quite following. Exactly where were you trying to put the HTML when it didn’t work? In the view where the interception is announced or in the interceptor listening for the event?
Can you supply the sample code of what didn’t work?
The people that reply are trying to help answer your questions. I know contentbox very well and have been participating in the development and testing since the beginning. However, it is very possible that I missed a feature that Luis added. He is hard to keep up with. I personally don’t think he sleeps
I do not know of a setting that responds to interceptions. The thread began with interceptors not being fired, then it was within custom contentbox modules. In each case I took time to write example code, test it to make sure it worked and then reply with exact steps to duplicate. If there is a feature I missed, I was hoping you would reciprocate and share what it is.
Can anyone else share with me then what contentbox setting responds to interception points?