Cannot access standard Umbraco Fields Umbraco 7.1.2
Hi all,
I am currently having issues with the following code:
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@{
var homepage = CurrentPage.AncestorsOrSelf(1).First();
var travelTips = homepage.travelTips.First();
//Select single travel tip at random and output to page
var tip = travelTips.Children.Random();
}
<div class="travelTips widget">
<span class="widgetHeader">Travel Tip <span class="orange">#@tip.pageID</span></span>
<div class="widgetBody">
@tip.pageContent
</div>
</div>
In this situation, the pageContent (which is a user defined property) of the retreived tip content node is being output to the screen correctly however, the standard property of pageID is being returned as blank. Why is this and how can I get around this?
Cannot access standard Umbraco Fields Umbraco 7.1.2
Hi all,
I am currently having issues with the following code:
In this situation, the pageContent (which is a user defined property) of the retreived tip content node is being output to the screen correctly however, the standard property of pageID is being returned as blank. Why is this and how can I get around this?
Hi,
Are you after the Umbraco Node ID?
Try #@tip.Id
is working on a reply...