Skip to content

Instantly share code, notes, and snippets.

@malog84
Last active August 29, 2015 14:03
Show Gist options
  • Save malog84/499249ca1f66688bfff5 to your computer and use it in GitHub Desktop.
Save malog84/499249ca1f66688bfff5 to your computer and use it in GitHub Desktop.
Get the content folder associated with a page in EPiServer 7.5 (something like 'PageFiles' in older versions of EPiServer)
using EPiServer.Core;
using EPiServer.ServiceLocation;
namespace EPiServerGists
{
public class Resources
{
/// <summary>
/// Get the content folder associated with a page (something like 'PageFiles' in older versions of EPiServer)
/// </summary>
/// <param name="page"></param>
/// <returns></returns>
public ContentAssetFolder GetContentFolderForPage(PageData page)
{
var contentAssetHelper = ServiceLocator.Current.GetInstance<ContentAssetHelper>();
return contentAssetHelper.GetOrCreateAssetFolder(page.ContentLink);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment