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
I am using Previous() and Next() on Umbraco 8 but it is not working.
Has someone used it on umbraco 8 ?
Thanks for helping.
I think removed...
they were here in V7:
but gone in V8:
Aha - there is a discussion on the why's and where's here:
Looks like from that discussion you might be able to use SiblingsAndSelf() to get an IEnumerable
Below code is working fine on Umbraco 8
var newsList = Model.Parent.Children("alias").ToList();
var currentIndexInNewsList = newsList.FindIndex(x => x.Id.Equals(Model.Id));
var totalResults = newsList.Count();
if (currentIndexInNewsList > -1)
if (currentIndexInNewsList > 0)
var previousItem = newsList[currentIndexInNewsList - 1];
<div class="col-xl-6 col-lg-6 col-sm-12 prevFooter">
<a href="@previousItem.Url"><span><i class="fas fa-arrow-left"></i></span>Previous Project</a>
if (totalResults-1 > currentIndexInNewsList)
var nextItem = newsList[currentIndexInNewsList + 1];
<div class="col-xl-6 col-lg-6 col-sm-12 nextFooter">
<a href="@nextItem.Url"><span></span>Next Project</a>
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted