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
Hello,
I am using Previous() and Next() on Umbraco 8 but it is not working.
Has someone used it on umbraco 8 ?
Thanks for helping.
Kusum
Hi K
I think removed...
they were here in V7:
https://github.com/umbraco/Umbraco-CMS/blob/v7/dev/src/Umbraco.Web/PublishedContentExtensions.cs
but gone in V8:
https://github.com/umbraco/Umbraco-CMS/blob/v8/dev/src/Umbraco.Web/PublishedContentExtensions.cs
Aha - there is a discussion on the why's and where's here:
https://github.com/umbraco/Umbraco-CMS/issues/4839
Looks like from that discussion you might be able to use SiblingsAndSelf() to get an IEnumerable
regards
Marc
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> </div> } 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> </div> } }
}
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Previous/Next Umbraco 8
Hello,
I am using Previous() and Next() on Umbraco 8 but it is not working.
Has someone used it on umbraco 8 ?
Thanks for helping.
Kusum
Hi K
I think removed...
they were here in V7:
https://github.com/umbraco/Umbraco-CMS/blob/v7/dev/src/Umbraco.Web/PublishedContentExtensions.cs
but gone in V8:
https://github.com/umbraco/Umbraco-CMS/blob/v8/dev/src/Umbraco.Web/PublishedContentExtensions.cs
Aha - there is a discussion on the why's and where's here:
https://github.com/umbraco/Umbraco-CMS/issues/4839
Looks like from that discussion you might be able to use SiblingsAndSelf() to get an IEnumerable
regards
Marc
Below code is working fine on Umbraco 8
}
is working on a reply...