A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More.
AI OnAI Off
A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More.
Hey,
Try some functions from in EPiServer.Filters. You probably need EPiServer.Filters.FilterForVisitor(...)
Greetings, Martijn
We are using this code to get all blocks:
var contentTypeRepository = ServiceLocator.Current.GetInstance<IContentTypeRepository>();
var contentModelUsage = ServiceLocator.Current.GetInstance<IContentModelUsage>();
var blockType = contentTypeRepository.Load<CertificationSubStepBlock>();
var allBlocks = contentModelUsage.ListContentOfContentType(blockType);
But we need just blocks which are published, and the code above retreives obsolate blocks from the trash too.
Can anybody help me with this?
Thanks!