Opticon Stockholm is on Tuesday September 10th, hope to see you there!
AI OnAI Off
Opticon Stockholm is on Tuesday September 10th, hope to see you there!
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...