IPublishedContent Property Access & Extension Methods
Umbraco Properties
@* gets the current page Url *@
@Model.Url(PublishedUrlProvider)
@* gets the Creation date, and formats it to a short date *@
@Model.CreateDate.ToString("D")
@* Outputs the name of the parent if it exists *@
@if(Model.Parent != null){
<h1>@Model.Parent.Name</h1>
}.Id
@Model.Id.Name
.Name(IVariationContextAccessor, string culture = null)
.ContentType
.GetCultureFromDomains(IUmbracoContextAccessor, ISiteDomainHelper, Uri current = null)
.Parent
.Path
.Level
.TemplateId
.SortOrder
.Url(PublishedUrlProvider, culture = null, UrlMode mode = UrlMode.Default) - (Extension method)
.UrlSegment
.UrlSegment(IVariationContextAccessor, string culture = null)
.WriterId
.WriterName(IUserService)
.CreatorId
.CreatorName(IUserService)
.CreateDate
.UpdateDate
Custom properties
Model.Value(IPublishedValueFallback, string)
Model.Value<T>(string)
Fallbacks
Fallback to Default Value
Fallback to Ancestors
Fallback to Language
Combining the Fallback options
Property Methods
.HasProperty(string propertyAlias)
.HasValue(string propertyAlias)
Last updated
Was this helpful?