Anders Hattestad
Feb 8, 2016
  2427
(3 votes)

Get owner content of document in “for this page”

A quick tip for finding owner page.

var contentAssetHelper = ServiceLocator.Current.GetInstance<ContentAssetHelper>();

var ownerNode = contentAssetHelper.GetAssetOwner(media.ContentLink);

It is also worth to mention that the standard EPiServer Search will index local files bellow contentlink 4, or if you drag the current page "for this page" folder inside a contentarea it will give you the same value.

VirtualPathQuery pathQuery = new VirtualPathQuery();
pathQuery.AddContentNodes(bellow, serviceLocationHelper.ContentLoader());

Feb 08, 2016

Comments

Please login to comment.
Latest blogs
Integrating Optimizely DAM with Your Website

This article is the second in a series about integrating Optimizely DAM with websites. It discusses how to install the necessary package and code t...

Andrew Markham | Sep 28, 2024 | Syndicated blog

Opticon 2024 - highlights

I went to Opticon in Stockholm and here are my brief highlights based on the demos, presentations and roadmaps  Optimizely CMS SaaS will start to...

Daniel Ovaska | Sep 27, 2024

Required fields support in Optimizely Graph

It's been possible to have "required" properties (value must be entered) in the CMS for a long time. The required metadata haven't been reflected i...

Jonas Bergqvist | Sep 25, 2024

How to write a bespoke notification management system

Websites can be the perfect vehicle for notifying customers of important information quickly, whether it’s the latest offer, an operational message...

Nicole Drath | Sep 25, 2024