AlanTsai
12/3/2015 - 1:27 AM

Get Current IPublishedContent in Umbraco. 取得目前的IPublishedContent. #umbraco

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;