Try our conversational search powered by Generative AI!

Handle Content Rendered Event?

Vote:
 

Hello guys,

we have to collect all Content-ID's which are rendered in the current request in a performant way. Is it possible to hook into an existing event that is triggered when content is rendered? 
If not, we have already a custom ContentAreaRenderer, so we can add logic there for all content that was added to a  ContentArea. But we don't get a complete list of Content-ID's there because it's possible that blocks have ContentReference-properties(for example Images) that will be rendered too. It's also possible that content is added to XHtml properties, so we need to add that logic there as well. How can we collect a complete list of rendered Content-ID's?

#281590
Edited, Jun 09, 2022 9:38
Vote:
 

Hi Tim,

Out of interest, why do you need to collect all the content id's when the page is rendered?

Andy

#281680
Jun 11, 2022 15:00
Tim Schmelter - Jun 13, 2022 7:34
We need to provide all Content of the current page(or the page itself) that is part of an A/B Test. If the challenger is shown the customer wants this information via tracking.
Andrew Markham - Jun 13, 2022 21:40
Another way to look at this would be to generate these id's within the page controller, you will take a hit, but you can cache the results. You will need to iterate over all the properties in the content item, and recursively do the same over blocks within a content area.

The only problem I can see is working out if the page is part of the A/B test, and if the challenger is shown. IMarketingTestingWebRepository may help with this.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.