Try our conversational search powered by Generative AI!

Lars Smeby
Apr 24, 2014
  2145
(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
Visitor Groups Usage Report For Optimizely CMS 12

This add-on offers detailed information on how visitor groups are used and how effective they are within Optimizely CMS. Editors can monitor and...

Adnan Zameer | Apr 18, 2024 | Syndicated blog

Azure AI Language – Abstractive Summarisation in Optimizely CMS

In this article, I show how the abstraction summarisation feature provided by the Azure AI Language platform, can be used within Optimizely CMS to...

Anil Patel | Apr 18, 2024 | Syndicated blog

Fix your Search & Navigation (Find) indexing job, please

Once upon a time, a colleague asked me to look into a customer database with weird spikes in database log usage. (You might start to wonder why I a...

Quan Mai | Apr 17, 2024 | Syndicated blog

The A/A Test: What You Need to Know

Sure, we all know what an A/B test can do. But what is an A/A test? How is it different? With an A/B test, we know that we can take a webpage (our...

Lindsey Rogers | Apr 15, 2024

.Net Core Timezone ID's Windows vs Linux

Hey all, First post here and I would like to talk about Timezone ID's and How Windows and Linux systems use different IDs. We currently run a .NET...

sheider | Apr 15, 2024

What's new in Language Manager 5.3.0

In Language Manager (LM) version 5.2.0, we added an option in appsettings.json called TranslateOrCopyContentAreaChildrenBlockForTypes . It does...

Quoc Anh Nguyen | Apr 15, 2024