Try our conversational search powered by Generative AI!

Block type which is not used anywhere else


Hi everyone,

Is there anyway which I can query all specific block which is not used anywhere?



Aug 17, 2015 10:02


Maybue you could iterate through all block types and use IContentModelUsage service to check where the block is used:

 var contentUsage = ServiceLocator.Current.GetInstance<IContentModelUsage>();
 var usage = contentUsage.ListContentOfContentType(imageFileContentType);

This will allow you to check block type usage.

And if you need to check where specific block instance is used, the you could use ContentSoftLinkRepository

var SoftLinkRepository = ServiceLocator.Current.GetInstance<ContentSoftLinkRepository>()
Edited, Aug 17, 2015 10:33

Thanks so much mate .. very helpful :)

Aug 19, 2015 4:08

How do I use ContentSoftLinkRepository in EPiServer 9? I get an error saying "StructureMap.StructureMapConfigurationException: No default Instance is registered and cannot be automatically determined for type 'EPiServer.Web.IPermanentLinkMapper'"

Oct 13, 2016 11:50
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.