AI OnAI Off
Hi Alexander.
In the Razor view you have access to the "modified" date throug the view´s model. Here's how you would do it in the Alloy demo site:
<p>Page Last Modified: @Model.CurrentPage.Saved</p>
That's it. No need for "getCurrentPage".
If you do need to get a page you should in most cases use ContentRepository (not PageRouteHelper). Something like this:
var contentRepository = ServiceLocator.Current.GetInstance<IContentRepository>(); var myPage= contentRepository.Get<IContent>(myPageReference);
Hello,
I have this function that is supposed to the last saved date of each page in my site but every page is only displaying the date and time of when the root page was lasted updated:
This is my razor code that returns the date to the page: