Calling all developers! We invite you to provide your input on Feature Experimentation by completing this brief survey.
Calling all developers! We invite you to provide your input on Feature Experimentation by completing this brief survey.
Hi Andreas,
At server side you can use: IContentRepository.GetReferencesToContent
At client side you can:
this.store = this.store || dependency.resolve("epi.storeregistry").get("epi.cms.contentreferences");
when(this.store.refresh(/*your block id*/this.blockId), lang.hitch(this, function (data) {
var pageReferences = [];
array.forEach(data, function (item) {
if (item && item.isPage) {
pageReferences.push(item);
}
});
}));
Note: We already have a helper class to do this: sharedContentDialogHandler
BR
Ha Bui
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
b7c6d596-5719-4b12-84ea-72084c688caf|sv
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)...
Thanks!
Hi Andreas,
You don't need do that. Actually, you can get IContent directly with ContentGUID with: Get<T>(Guid contentGuid)
BR
Ha Bui
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?
Thanks!