Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
hi there
i am new to umbraco and am trying to retrieve the urls for the next and previous pages to a given page.
i am attempting to do this in the template, my current code is
it doesn't like Model.Next
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@using SiteModel.Helpers
@{
Layout = "_Layout_Master.cshtml";
string fileUrl = Model.Content.GetImageUrl();
var rd = Model.Content.GetPropertyValue<DateTime>("releaseDate").ToString("dd/MM/yyyy");
var m = Model.Content.Name;
var url = Model.Content.Url();
Model.Next();
}
cheers
Nic
Hi Nic,
Welcome to Umbraco Forum.
you should use Model.Content.Next()
Model.Content.Next()
Hope that helps
Cheers
Ali
Hi Ali
Thanks very much for that
you are welcome
To get previous & next page URLs in Umbraco, you can use below piece of code in your razor view.
@if(CurrentPage.Previous() != null){ <a href="@CurrentPage.Previous().Url">Previous</a> } @if(CurrentPage.Next() != null){ <a href="@CurrentPage.Next().Url">Next</a> }
Fore more detail vist - http://coderjony.com/blogs/get-previous-and-next-page-urls-in-umbraco/
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Get Previous and Next Url
hi there
i am new to umbraco and am trying to retrieve the urls for the next and previous pages to a given page.
i am attempting to do this in the template, my current code is
it doesn't like Model.Next
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@using SiteModel.Helpers
@{
Layout = "_Layout_Master.cshtml";
string fileUrl = Model.Content.GetImageUrl();
var rd = Model.Content.GetPropertyValue<DateTime>("releaseDate").ToString("dd/MM/yyyy");
var m = Model.Content.Name;
var url = Model.Content.Url();
Model.Next();
}
cheers
Nic
Hi Nic,
Welcome to Umbraco Forum.
you should use
Model.Content.Next()
Hope that helps
Cheers
Ali
Hi Ali
Thanks very much for that
cheers
Nic
you are welcome
To get previous & next page URLs in Umbraco, you can use below piece of code in your razor view.
Fore more detail vist - http://coderjony.com/blogs/get-previous-and-next-page-urls-in-umbraco/
is working on a reply...