Find pages that fetches content from specific page

Vote:
 

I'm trying to find pages that uses the function "Fetch content from page in EPiServer CMS" and fetches from a specific page. Is there a handy function for this or does anyone have an idea on how to achieve this?

#145887
Mar 14, 2016 19:07
Vote:
 

The properties you are interested in are 

PageShortcutLink 

PageShortcutType

You can use FindPagesByCriteria to find pages where PageShortcutType = FetchData and PageShortcutLink = your page reference.

Something like that should work...If you know where the page exist you can search using GetChildren or GetDescendents instead and check those properties.

I'm also guessing the below 

repository = ServiceLocator.Current.GetInstance<IContentRepository>();
var references = repository.GetReferencesToContent(content.ContentLink, true).ToList();

will get the possible pages (and some more).

Cache result since the above will be pretty expensive operation...

All three roads should lead to Rome I guess. I would try the GetReferencesToContent first and then check the properties above for the correct values. Let me know if it works :)

#145890
Edited, Mar 14, 2016 21:07
Vote:
 

Worked like a charm! GetReferencesToContent was the one I was using before and it doesn't include pages that fetches from reference. What I do now is to get all pages that has linktype "FetchData" for my current site with FindPagesByCriteria and when I'm looping through the references to check for languages and correct site and all of those things, I also do a check if there are any shortcuts to it by mathing the PageShortcutLink agains the reference.

Thanks for the help!

#146500
Mar 16, 2016 15:45
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.