Try our conversational search powered by Generative AI!
AI OnAI Off
Have you tried implementing a custom version of ContentLoaderService where you override the ShouldContentBeExposed-method tor return false in some cases based on the current content?
Hello, i need to ensure that a page is not delivered from the Content DeliVery API if it's not allowed. What is the best way, using a ContentFilter or using a ContentApiModelFilter?
We have a requirement that some articles are only allowed in some countries(legal). So the ArticlePage has a custom property where you can configure it. Now i failed to implement it in ContentFilter since it does not seem to be possible to filter the complete content, just to remove/clear some properties. The documentation mentions it:
"The downside of
IContentFilter
is that it is still not possible to remove some default properties ofContentApiModel
likeExistingLanguages
,MasterLanguage
, and so on."But i'm also unable to implement it in a ContentApiModelFilter (just relevant code):
The article is added to a ContentArea and the response still contains it(id=7851):
So what is the correct way to remove an entire content completely from the api response?
Update: added a feature request.