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?
The properties you are interested in are
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 :)
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!