SaaS CMS has officially launched! Learn more now.

Get all pages where a block is on


Hi community,

I'm using EPiServer search and when I'm searhing for content that is on a block I can see that the search finds it. Now I want to get all pages this block is on so that I can return the result with a proper link to the page. I've heard there's an API for this but after looking for a while I can't find it. So the question, how do I get all pages this specific block is on?


Nov 29, 2013 7:48

Hi Andreas,

At server side you can use: IContentRepository.GetReferencesToContent

At client side you can: = || dependency.resolve("epi.storeregistry").get("epi.cms.contentreferences");
when(*your block id*/this.blockId), lang.hitch(this, function (data) {
    var pageReferences = [];
    array.forEach(data, function (item) {
        if (item && item.isPage) {


Note: We already have a helper class to do this: sharedContentDialogHandler


Ha Bui

Edited, Nov 29, 2013 8:22

Perfect, Just one more question that isn't 100% related to this. When I get my search result back from the indexing I get some properties. One is called ID and looks like this 


In the database I see there is a ContentGUID for b7c6d596-5719-4b12-84ea-72084c688caf so I thought that I could do 

var cR = new ContentReference("b7c6d596-5719-4b12-84ea-72084c688caf");

But it gives me an exception, Do you know any way of gettign a ContentReference without using FindPagesWithCriteria (which I don't know if it searches on blocks as well actually)...

Nov 29, 2013 10:03

Hi Andreas,

You don't need do that. Actually, you can get IContent directly with ContentGUID with: Get<T>(Guid contentGuid)


Ha Bui

Nov 29, 2013 10:10


Nov 29, 2013 10:23
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.