November Happy Hour will be moved to Thursday December 5th.

Find all pages where shared block is added

Vote:
 

Hi,

given a ContentLink on a Block, how do I find all pages where this block is added? It is a shared block.

 

#65056
Jan 18, 2013 12:42
Vote:
 

Solved it like this(With episerver.find):

var i = SearchClient.Instance.Search<MyBlock>()
.For(searchQuery)
.GetContentResult();

foreach(var p in i){
var y = p as IContent;
var z = ServiceLocator.Current.GetInstance<IContentRepository>();
var z1 = z.GetReferencesToContent(y.ContentLink, false);

//dosomething

}

#65058
Jan 18, 2013 13:02
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* 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.