Yeah still not sure I understand, but as you bring up cb_onContentRendering I will try to answer it the best way I can. But for your problem, your view should still be taking care of the widget rendering. Unless you are looking to change this on the fly later after everything has been rendered.
Which brings me to the interception point cb_onContentRendering, I no longer have my blog up so I will do my best to explain this here.
ContentBox (at least the last version I used), did not understand page breaks and I used this interception to process the content after it had been rendered, which is what this interception point is for. In some sites they have in their website the ability to have one content that would allow multiple pages for that content. Which I labelled as a page break for my example.
So with that I set out to write content in ContentBox that looked something like this in the editing of an entry.
This is paragraph 1 and Page 1
This is paragraph 2 and Page 1
This is paragraph 3 and Page 1
@@PageBreak@@
This is paragraph 1 and Page 2
This is paragraph 2 and Page 2
This is paragraph 3 and Page 2
@@PageBreak@@
This is paragraph 1 and Page 3
This is paragraph 2 and Page 3
This is paragraph 3 and Page 3
Once the views and everything had been rendered, the interceptor would then fire and do the magic that was needed. Which I have included the source code at the end. Other things I can see this interception point being used is to make fonts more standard, especially when you have a number of editors who tend to like there own font. You could then use this interception point to cycle through all the fonts and set them back to a standard font.
There are probably a lot more use case than just these two I mentioned, but I still fail to see what you are trying to do with your widgets after your views have been rendered and not when they are being rendered.
But this is post processing, that means for your widgets they would need to be controlled via a view and you would need to use your own interception point to then do what you need to do. If I am understanding you.
Maybe explain what you’re doing with an interception point and rendering with your widgets, but personally I would be looking at a custom interception point for your widgets that your module can deal with.
//------------------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------------------
public void function cb_onContentRendering(event, interceptData) {
var page = event.getValue(“page”, 1);
translateContent( builder = arguments.interceptData.builder, content = arguments.interceptData.content, page = page);
}
private function translateContent11(required builder, content, page){
var regex = “(@@PageBreak@@)”;
var pattern = createObject(“java”, “java.util.regex.Pattern”);
var matcher = pattern.compile(regex).matcher(builder.toString());
var pageCount = arrayLen( reMatch( regex, builder.toString() ) ) + 1;
var pages = [];
var buffer = createObject(“java”,“java.lang.StringBuilder”).init();
while(matcher.find()) {
var matchedString = matcher.group();
var loc = {start = matcher.start(), end = matcher.end()};
arrayAppend(pages, loc);
}
if( page > pageCount) {
page = 1;
}
if(arrayLen(pages) == 0) {
return;
}
if(page == 1) {
// Get page 1
buffer.append(left(builder.toString(), pages[page].start ));
} else if (page == pageCount) {
// Get Last page
buffer.append(right( builder.toString(), builder.length() - pages[page-1].end ));
} else {
// Get page middle content
var midStart = pages[page-1].end;
var midEnd = pages[page].start;
var midLength = midEnd - midStart;
buffer.append(mid( builder.toString(), midStart + 1, midLength ));
}
builder.replace(0, builder.length(), buffer.toString());
}