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!
Try and use the IContentRepository:
var repository = ServiceLocator.Current.GetInstance<IContentRepository>(); var references = repository.GetReferencesToContent(blockLink, false);
Indeed! ServiceLocator.Current should always be avoided in favor of dependency injection.
(It does makes for more complete and easier to read/understand code examples, which makes it hard to resist in the forum even if I never use it in real code. )
It turns out to be quite easy to find the list of pages referencing a block:
But how do I get the same list but for the blocks referencing the given block? There is no
BlockLinkReference
or similar inReferenceType
enum...