Last active
August 29, 2015 14:03
-
-
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)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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