Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more

Lars Smeby
Apr 24, 2014
  2269
(6 votes)

Finding pages linking to an UnifiedFile

I’m working on a project where we’re using EPiServer 7.1 and the standard EPiServer Search. The files returned by the search are UnifiedFiles, but we wanted to display where on the site the files are being used.

I had trouble finding anyone else with the same problem, but finally I found a solution, though obsolete in EPiServer 7, in this thread.

I ended up using the code below:

var softLinkRep = ServiceLocator.Current.GetInstance<ContentSoftLinkRepository>();
var softLinks = softLinkRep.Load(searchHit.Url.ToHtmlString());

forech(var softLink in softLinks)
{
    var url = softLink.OwnerContentLink.GetFriendlyUrl();
}

Hope this can help someone!

Apr 24, 2014

Comments

Please login to comment.
Latest blogs
Leveraging Optimizely’s AI Agents: Embracing the Agentic Future

Discover how Optimizely’s AI Agents leverage agentic AI to autonomously execute complex tasks, enhancing digital workflows and driving innovation f...

Andy Blyth | Mar 20, 2025 |

COGNITIVE_SERVICE_TRANSLATE_ERROR

COGNITIVE_SERVICE_TRANSLATE_ERROR

Tomas Hensrud Gulla | Mar 19, 2025 |

Secure Your CMS: A Guide to the OptiAccess Restrictor Add-on

The OptiAccess Restrictor add-on enhances CMS security by preventing unauthorized access, allowing IP whitelisting.

Francisco Quintanilla | Mar 18, 2025 |

Optimizely CMS Developer Tools for macOS

Running Optimizely CMS on macOS presents unique challenges, as the platform was traditionally primarily designed for Windows environments. However,...

Tomek Juranek | Mar 15, 2025