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
@{ var selection = Umbraco.Content(Guid.Parse("3758071d-10c8-4890-b680-64f43a7b4149")) .Children("vehicles") .Where(x => x.IsVisible()) .OrderByDescending(x => x.Id); } <div class="vehical_result"> <div class="row"> @foreach (var item in selection) { <div class="col-xl-4 col-lg-6"> <div class="caroffer_box"> <div class="img_car"> <a href="vehiclesdetails"> <img src="@item.Value("vehicleImage")" alt=""> </a> <div class="price_box"> <p>From<br><span>[email protected]("pricePerWeek")p/w</span></p> </div> </div> <div class="car_details"> <h4>@item.Value("carName")</h4> <h6>Year: @item.Value("launchYear")</h6> <p>@item.Value("description")</p> <p class="price">For sale <span>[email protected]("salePrice")</span></p> <div class="caricon_section"> <ul> <li> <img src="/images/meter.svg" alt=""> <p>@item.Value("meter") K mi</p> </li> <li> <img src="/images/speed.svg" alt=""> <p>@item.Value("speed")cc</p> </li> <li> <img src="/images/petrol.svg" alt=""> <p>@item.Value("petrol")</p> </li> <li> <img src="/images/auto.svg" alt=""> <p>@item.Value("automatic")</p> </li> </ul> </div> </div> </div> </div> } </div> <div class="row"> <div class="col-md-12 text-right vehicles_pagination"> <ul class="pagination"> <li class="page-item"><a class="page-link" href="#">Previous</a></li> <li class="page-item"><a class="page-link active" href="#">1</a></li> <li class="page-item"><a class="page-link" href="#">2</a></li> <li class="page-item"><a class="page-link" href="#">3</a></li> <li class="page-item"><a class="page-link" href="#">4</a></li> <li class="page-item"><a class="page-link" href="#">5</a></li> <li class="page-item"><a class="page-link" href="#">6</a></li> <li class="page-item"><a class="page-link" href="#">7</a></li> <li class="page-item"><a class="page-link" href="#">8</a></li> <li class="page-item"><a class="page-link" href="#">9</a></li> <li class="page-item"><a class="page-link" href="#">Next</a></li> </ul> </div> </div> </div>
Hi,
You would use Skip and Take (linq methods) om your selection variable. I would although not recommend this approach.
Say you have 100 cars, you would then always load 100 cars and just take selection of them. Say you have a 1000 cars, the problem is 10 fold.
Using the selection generated in the back office should not be used on large datasets.
Instead you should use examine to find the cars, do sorting, pagination etc.
Have a look at this article: https://24days.in/umbraco-cms/2013/getting-started-with-examine/
HTH :-)
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
How would I apply pagination
Hi,
You would use Skip and Take (linq methods) om your selection variable. I would although not recommend this approach.
Say you have 100 cars, you would then always load 100 cars and just take selection of them. Say you have a 1000 cars, the problem is 10 fold.
Using the selection generated in the back office should not be used on large datasets.
Instead you should use examine to find the cars, do sorting, pagination etc.
Have a look at this article: https://24days.in/umbraco-cms/2013/getting-started-with-examine/
HTH :-)
is working on a reply...