I'm creating a small Razor function that lists a bunch of articles. And i'd like to show the date that the articles was published in my list.
So far i have this code, which gets me articles.
How can i find it?
So far i have this code, which gets me articles.
@{
var pageType = (from p in Data.Get<IPageType>()
where p.Name.Equals("Article")
select p).FirstOrDefault();
Guid currentPageGuid = CurrentPageNode.Id;
var elements = from s in Data.Get<IPage>()
where s.PageTypeId.Equals(pageType.Id) && s.GetParentId().Equals( currentPageGuid )
orderby s.Title
select new
{
Id = s.Id,
Title = s.Title
};
foreach (var item in elements)
{
<h1><a href="/page(@item.Id)">@item.Title</a></h1>
}
}
But i cannot find anything about dates on the IPage object.How can i find it?