Hi guys.
Any of you have an idea on how to split this loop into row with eg. 4 items in each?
I have tried many thing like "break;" and "continue;" and nested loops, but i didnt succeed.
My code i attached below, thank you in advance!
@inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> @using System.Web; @using System.Text.RegularExpressions @using System.Linq; @{ string selectedSolutionType = !String.IsNullOrEmpty(HttpContext.Current.Request.QueryString.Get("SolutionType")) ? HttpContext.Current.Request.QueryString.Get("SolutionType") : Translate("All"); var query = HttpUtility.ParseQueryString(HttpContext.Current.Request.QueryString.ToString()); int caseListPageId = GetPageIdByNavigationTag("CasesListFeed"); string cardClass = Pageview.Device.ToString() != "Tablet" ? "" : ""; string cardFooterClass = Pageview.Device.ToString() != "Tablet" ? "" : ""; } <div class="grid__col-12 cases-carousel"> <div class="grid"> @foreach (var caseItem in GetLoop("ItemPublisher:Items.List")) { string tintedImage = !String.IsNullOrEmpty(caseItem.GetString("ItemPublisher:Item.CustomerLogo")) ? "layered-image--tinted dw-mod" : ""; var linkToArticle = caseItem.GetLoop("ItemPublisher:Item.Gallery").Count() > 0 || !string.IsNullOrEmpty(caseItem.GetString("ItemPublisher:Item.Text")) || !string.IsNullOrEmpty(caseItem.GetString("ItemPublisher:Item.Challenge")) || !string.IsNullOrEmpty(caseItem.GetString("ItemPublisher:Item.Solution")) || !string.IsNullOrEmpty(caseItem.GetString("ItemPublisher:Item.Results")) || !string.IsNullOrEmpty(caseItem.GetString("ItemPublisher:Item.Challenge")); var imageClasses = ""; imageClasses += " u-padding"; var columnClasses = "grid__col-3"; <div class="@columnClasses case-item"> <div class="@cardClass"> <div class="u-margin-bottom"> <img src="/Admin/Public/GetImage.ashx?width=767&height=567&crop=5&Compression=75&DoNotUpscale=true&FillCanvas=True&image=@caseItem.GetString("ItemPublisher:Item.CustomerLogo")" class="@imageClasses" alt="@caseItem.GetString("ItemPublisher:Item.Title")" /> </div> </div> </div> } </div> </div>