Skip to content

Instantly share code, notes, and snippets.

@alantsai
Created December 3, 2015 01:27
Show Gist options
  • Save alantsai/fd18bbb2725f6f0210ab to your computer and use it in GitHub Desktop.
Save alantsai/fd18bbb2725f6f0210ab to your computer and use it in GitHub Desktop.
Get Current IPublishedContent in Umbraco. 取得目前的IPublishedContent. #umbraco

Source:Get current node as IPublishedContent

var currentNode = UmbracoContext.Current.PublishedContentRequest.PublishedContent;

Or

UmbracoHelper umbracoHelper = new UmbracoHelper(UmbracoContext.Current);
IPublishedContent currentPage = umbracoHelper.AssignedContentItem;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment