London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!
AI OnAI Off
London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!
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!