Error compiling template "Designs/Swift/Paragraph/Swift_Carousel.cshtml" Line 77: No overload for method 'RenderItem' takes 8 arguments Line 83: The name 'helper' does not exist in the current context Line 99: The name 'active' does not exist in the current context Line 105: The name 'theme' does not exist in the current context Line 109: The name 'RenderImage' does not exist in the current context Line 109: The name 'item' does not exist in the current context Line 111: The name 'layout' does not exist in the current context Line 114: The name 'alignment' does not exist in the current context Line 117: The name 'alignment' does not exist in the current context Line 120: The name 'alignment' does not exist in the current context Line 123: The name 'alignment' does not exist in the current context Line 126: The name 'alignment' does not exist in the current context Line 129: The name 'alignment' does not exist in the current context Line 132: The name 'alignment' does not exist in the current context Line 135: The name 'alignment' does not exist in the current context Line 138: The name 'alignment' does not exist in the current context Line 146: The name 'carouselWidth' does not exist in the current context Line 148: The name 'alignment' does not exist in the current context Line 152: The name 'RenderTitle' does not exist in the current context Line 152: The name 'item' does not exist in the current context Line 152: The name 'maxWidth' does not exist in the current context Line 154: The name 'RenderText' does not exist in the current context Line 154: The name 'item' does not exist in the current context Line 154: The name 'maxWidth' does not exist in the current context Line 156: The name 'RenderButton' does not exist in the current context Line 156: The name 'item' does not exist in the current context Line 158: The name 'helper' does not exist in the current context Line 178: The name 'imageFilter' does not exist in the current context Line 181: The name 'item' does not exist in the current context Line 181: The name 'parms' does not exist in the current context Line 183: The name 'helper' does not exist in the current context Line 191: The name 'maxWidth' does not exist in the current context Line 194: The name 'item' does not exist in the current context Line 196: The name 'helper' does not exist in the current context Line 205: The name 'maxWidth' does not exist in the current context Line 208: The name 'item' does not exist in the current context Line 210: The name 'helper' does not exist in the current context Line 282: The name 'link' does not exist in the current context Line 286: The name 'buttonStyle' does not exist in the current context Line 288: The name 'StretchedLink' does not exist in the current context Line 291: The name 'target' does not exist in the current context Line 293: The name 'rel' does not exist in the current context Line 295: The name 'item' does not exist in the current context Line 306: The name 'link' does not exist in the current context Line 309: The name 'target' does not exist in the current context Line 311: The name 'rel' does not exist in the current context Line 313: The name 'StretchedLink' does not exist in the current context
1 // <auto-generated/> 2 #pragma warning disable 1591 3 namespace CompiledRazorTemplates.Dynamic 4 { 5 #line hidden 6 using System.Threading.Tasks; 7 using System; 8 using System.Collections.Generic; 9 using System.Linq; 10 using Dynamicweb.Ecommerce.ProductCatalog; 11 using System.Web; 12 using Dynamicweb.Frontend; 13 internal class RazorEngine_b8e29efde889414a854c4e7adf15a9c7 : Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel> 14 { 15 #pragma warning disable 1998 16 public async override global::System.Threading.Tasks.Task ExecuteAsync() 17 { 18 WriteLiteral("\n"); 19 bool movePageBehind = false; bool isFirstPoster = false; string movePageBehindClass = ""; if (Pageview.Page.PropertyItem != null) { string headerCssClass = Pageview.Page.PropertyItem["MoveThisPageBehindTheHeader"] != null ? Pageview.Page.PropertyItem["MoveThisPageBehindTheHeader"].ToString() : "sticky-top"; movePageBehind = headerCssClass == "fixed-top" && !Pageview.IsVisualEditorMode ? true : false; if (movePageBehind) { movePageBehindClass = " poster-behind"; if (!Dynamicweb.Context.Current.Items.Contains("firstPosterIsRendered")) { isFirstPoster = true; Dynamicweb.Context.Current.Items.Add("firstPosterIsRendered", true); } } } var uniqueId = Pageview.CurrentParagraph.ID.ToString(); string title = Model.Item.GetString("Title"); var carouselItems = Model.Item?.GetItems("Carousel_Items") ?? Enumerable.Empty<Dynamicweb.Frontend.ItemViewModel>().ToList(); string enableControls = Model.Item.GetBoolean("EnableControls").ToString().ToLower(); string enableIndcators = Model.Item.GetBoolean("EnableIndicators").ToString().ToLower(); bool autoplay = Model.Item.GetBoolean("Autoplay"); string interval = (autoplay) ? Model.Item.GetString("Interval", "5000") : "0"; string enableAutoplay = autoplay.ToString().ToLower(); string animation = Model.Item.GetRawValueString("Animation", "carousel"); string carouselHeight = Model.Item.GetRawValueString("CarouselHeight", "h-100 min-vh-75 min-vh-md-100"); carouselHeight = carouselHeight == "small" ? "min-vh-25 min-vh-md-50" : carouselHeight; carouselHeight = carouselHeight == "medium" ? "min-vh-50 min-vh-md-75" : carouselHeight; carouselHeight = carouselHeight == "large" ? "min-vh-75 min-vh-md-100" : carouselHeight; string buttonSize = Model.Item.GetRawValueString("buttonSize", "regular"); buttonSize = buttonSize == "small" ? " btn-sm" : buttonSize; buttonSize = buttonSize == "regular" ? "" : buttonSize; buttonSize = buttonSize == "large" ? " btn-lg" : buttonSize; string carouselPadding = Model.Item.GetRawValueString("ContentPadding", ""); carouselPadding = carouselPadding == "none" ? "p-3 px-xl-3 py-xl-4" : carouselPadding; carouselPadding = carouselPadding == "small" ? "p-3 p-xl-4" : carouselPadding; carouselPadding = carouselPadding == "large" ? "p-4 p-xl-5" : carouselPadding; string titleFontSize = Model.Item.GetRawValueString("TitleFontSize", "display-1"); string subtitleFontSize = Model.Item.GetRawValueString("SubtitleFontSize", "fs-5"); WriteLiteral("\n<div"); 20 BeginWriteAttribute("id", " id=\"", 2661, "\"", 2684, 2); 21 WriteAttributeValue("", 2666, "carousel_", 2666, 9, true); 22 WriteAttributeValue("", 2675, uniqueId, 2675, 9, false); 23 EndWriteAttribute(); 24 BeginWriteAttribute("class", " class=\"", 2685, "\"", 2740, 3); 25 WriteAttributeValue("", 2693, "js-slider", 2693, 9, true); 26 WriteAttributeValue(" ", 2702, "item_", 2703, 6, true); 27 WriteAttributeValue("", 2708, Model.Item.SystemName.ToLower(), 2708, 32, false); 28 EndWriteAttribute(); 29 WriteLiteral(">\n\n"); 30 bool isFirst = true; WriteLiteral("\n"); 31 foreach (var item in carouselItems) { Write(RenderItem(item, isFirst, carouselHeight, carouselPadding, buttonSize, titleFontSize, subtitleFontSize, movePageBehindClass)); 32 isFirst = false; } WriteLiteral("\n</div>\n\n"); 33 Write(helper); 34 WriteLiteral(@" RenderItem(ItemViewModel item, bool isFirst, string carouselHeight, string carouselPadding, string buttonSize, string titleFontSize, string subtitleFontSize, string movePageBehindClass) { string layout = item.GetRawValueString(""Layout"", ""align-middle-center-text-center""); string carouselWidth = ""container-xl""; int xPos = item?.GetFile(""Image"")?.FocalPositionFromLeft ?? 50; int yPos = item?.GetFile(""Image"")?.FocalPositionFromTop ?? 50; string theme = !string.IsNullOrWhiteSpace(item.GetRawValueString(""Theme"")) ? "" theme "" + item.GetRawValueString(""Theme"").Replace("" "", """").Trim().ToLower() : """"; string active = isFirst ? ""active"" : """"; string alignment = """"; string maxWidth = item.GetRawValueString(""TextReadability"", ""max-width-on""); maxWidth = maxWidth == ""max-width-on"" ? ""mw-75ch d-inline-block"" : maxWidth; maxWidth = maxWidth == ""max-width-off"" ? """" : maxWidth; <div"); 35 BeginWriteAttribute("class", " class=\"", 3874, "\"", 3891, 1); 36 WriteAttributeValue("", 3882, active, 3882, 9, false); 37 EndWriteAttribute(); 38 WriteLiteral(">\n\t\t<div"); 39 BeginWriteAttribute("class", " class=\"", 3900, "\"", 3961, 4); 40 WriteAttributeValue("", 3908, "position-relative", 3908, 17, true); 41 WriteAttributeValue(" ", 3925, "h-100", 3926, 6, true); 42 WriteAttributeValue("", 3931, theme, 3931, 8, false); 43 WriteAttributeValue("", 3939, movePageBehindClass, 3939, 22, false); 44 EndWriteAttribute(); 45 WriteLiteral(">\n\t\t\t"); 46 Write(RenderImage(item)); 47 WriteLiteral("\n\n"); 48 switch (layout) { case "align-top-left-text-left": alignment = "text-start justify-content-start align-items-start"; break; case "align-top-center-text-center": alignment = "text-center justify-content-start align-items-start"; break; case "align-top-right-text-right": alignment = "text-end justify-content-start align-items-start"; break; case "align-middle-left-text-left": alignment = "text-start justify-content-center align-items-center"; break; case "align-middle-center-text-center": alignment = "text-center justify-content-center align-items-center"; break; case "align-middle-right-text-right": alignment = "text-end justify-content-center align-items-center"; break; case "align-bottom-left-text-left": alignment = "text-start justify-content-end align-items-end"; break; case "align-bottom-center-text-center": alignment = "text-center justify-content-end align-items-end"; break; case "align-bottom-right-text-right": alignment = "text-end justify-content-end align-items-end"; break; } WriteLiteral("\t\t\t<div class=\"position-relative h-100\">\n\t\t\t\t<div"); 49 BeginWriteAttribute("class", " class=\"", 5173, "\"", 5263, 7); 50 WriteAttributeValue("", 5181, "h-100", 5181, 5, true); 51 WriteAttributeValue(" ", 5186, "grid", 5187, 5, true); 52 WriteAttributeValue(" ", 5191, "grid-1", 5192, 7, true); 53 WriteAttributeValue(" ", 5198, carouselWidth, 5199, 16, false); 54 WriteAttributeValue(" ", 5215, carouselPadding, 5216, 16, false); 55 WriteAttributeValue(" ", 5232, alignment, 5233, 12, false); 56 WriteAttributeValue(" ", 5245, carouselHeight, 5246, 17, false); 57 EndWriteAttribute(); 58 WriteLiteral(">\n\t\t\t\t\t<div class=\"grid grid-1 gap-3 gap-md-4\">\n\t\t\t\t\t\t"); 59 Write(RenderTitle(item, titleFontSize, maxWidth)); 60 WriteLiteral("\n\t\t\t\t\t\t"); 61 Write(RenderText(item, subtitleFontSize, maxWidth)); 62 WriteLiteral("\n\t\t\t\t\t\t"); 63 Write(RenderButton(item, buttonSize)); 64 WriteLiteral("\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n}\n\n"); 65 Write(helper); 66 WriteLiteral(@" RenderImage(ItemViewModel item) { if (!string.IsNullOrEmpty(item.GetString(""Image""))) { var parms = new Dictionary<string, object>(); parms.Add(""cssClass"", ""h-100 w-100""); parms.Add(""columns"", Model.GridRowColumnCount); string imageFilter = item.GetRawValueString(""ImageFilter"", """"); imageFilter = imageFilter == ""no-filter"" ? """" : imageFilter; imageFilter = imageFilter == ""filter"" ? "" image-filter"" : imageFilter; <div"); 67 BeginWriteAttribute("class", " class=\"", 5951, "\"", 6019, 6); 68 WriteAttributeValue("", 5959, "position-absolute", 5959, 17, true); 69 WriteAttributeValue(" ", 5976, "top-0", 5977, 6, true); 70 WriteAttributeValue(" ", 5982, "bottom-0", 5983, 9, true); 71 WriteAttributeValue(" ", 5991, "end-0", 5992, 6, true); 72 WriteAttributeValue(" ", 5997, "start-0", 5998, 8, true); 73 WriteAttributeValue("", 6005, imageFilter, 6005, 14, false); 74 EndWriteAttribute(); 75 WriteLiteral(">\n\t\t\t"); 76 Write(RenderPartial("Components/Image.cshtml", item.GetFile("Image") ?? new Dynamicweb.Frontend.FileViewModel(), parms)); 77 WriteLiteral("\n\t\t</div>\n\t}\n}\n\n"); 78 Write(helper); 79 WriteLiteral(" RenderTitle(ItemViewModel item, string titleFontSize, string maxWidth)\n{\n\tif (!string.IsNullOrEmpty(item.GetString(\"Title\")) && !item.GetBoolean(\"HideTitle\"))\n\t{\n\t\t<h2"); 80 BeginWriteAttribute("class", " class=\"", 6330, "\"", 6356, 2); 81 WriteAttributeValue("", 6338, titleFontSize, 6338, 14, false); 82 WriteAttributeValue(" ", 6352, "m-0", 6353, 4, true); 83 EndWriteAttribute(); 84 WriteLiteral(">\n\t\t\t<span"); 85 BeginWriteAttribute("class", " class=\"", 6367, "\"", 6384, 1); 86 WriteAttributeValue("", 6375, maxWidth, 6375, 9, false); 87 EndWriteAttribute(); 88 WriteLiteral(">"); 89 Write(item.GetString("Title")); 90 WriteLiteral("</span>\n\t\t</h2>\n\t}\n}\n\n"); 91 Write(helper); 92 WriteLiteral(" RenderText(ItemViewModel item, string subtitleFontSize, string maxWidth)\n{\n\tif (!string.IsNullOrEmpty(item.GetString(\"Text\")))\n\t{\n\t\t<p"); 93 BeginWriteAttribute("class", " class=\"", 6574, "\"", 6608, 3); 94 WriteAttributeValue("", 6582, subtitleFontSize, 6582, 17, false); 95 WriteAttributeValue(" ", 6599, "lead", 6600, 5, true); 96 WriteAttributeValue(" ", 6604, "m-0", 6605, 4, true); 97 EndWriteAttribute(); 98 WriteLiteral(">\n\t\t\t<span"); 99 BeginWriteAttribute("class", " class=\"", 6619, "\"", 6636, 1); 100 WriteAttributeValue("", 6627, maxWidth, 6627, 9, false); 101 EndWriteAttribute(); 102 WriteLiteral(">"); 103 Write(item.GetString("Text")); 104 WriteLiteral("</span>\n\t\t</p>\n\t}\n}\n\n"); 105 Write(helper); 106 WriteLiteral(@" RenderButton(ItemViewModel item, string buttonSize) { string linkType = item.GetRawValueString(""LinkType"", ""page""); Dynamicweb.Frontend.LinkViewModel link = new Dynamicweb.Frontend.LinkViewModel(); string StretchedLink = item.GetRawValueString(""StretchedLink"", """"); StretchedLink = StretchedLink == ""item-not-clickable"" ? """" : StretchedLink; StretchedLink = StretchedLink == ""item-clickable"" ? "" stretched-link"" : StretchedLink; if (linkType == ""page"" && item.GetLink(""ButtonLink"") != null) { link = item.GetLink(""ButtonLink""); } if (linkType == ""product-group"") { IList<ProductGroupViewModel> selectedGroups = item.GetValue<IList<ProductGroupViewModel>>(""ProductGroupLink""); IList<string> groupIds = new List<string> { }; if (selectedGroups != null) { foreach (var fromGroup in selectedGroups) { groupIds.Add(fromGroup.Id); } } link = new Dynamicweb.Frontend.LinkViewModel() { Url = ""/Default.aspx?ID="" + GetPageIdByNavigationTag(""Shop"") + ""&GroupID="" + string.Join("","", grou"); 107 WriteLiteral(@"pIds).Trim(), IsExternal = false }; } if (linkType == ""product"") { ProductListViewModel products = item.GetValue<ProductListViewModel>(""ProductLink""); IList<string> productIds = new List<string> { }; if (products != null) { foreach (var product in products.Products) { productIds.Add(product.Id); } } string productParameter = productIds.Count == 1 ? ""ProductID"" : ""MainProductId""; string pageTag = productIds.Count == 1 ? ""ProductDetailPage"" : ""Shop""; link = new Dynamicweb.Frontend.LinkViewModel() { Url = ""/Default.aspx?ID="" + GetPageIdByNavigationTag(pageTag) + ""&"" + productParameter + ""="" + string.Join("","", productIds).Trim(), IsExternal = false }; } if (link != null && !string.IsNullOrEmpty(item.GetString(""ButtonLabel""))) { string target = Pageview.AreaSettings.GetBoolean(""OpenLinksInNewTab"") && link.IsExternal ? ""target=\""_blank\"""" : """"; string rel = Pageview.AreaSettings.GetBoolean(""OpenLinksInNewTab"") && link.IsExternal ? ""rel=\""noopener\"""" : """"; "); 108 WriteLiteral(@" string buttonStyle = item.GetRawValueString(""ButtonStyle"", ""primary""); buttonStyle = buttonStyle == ""primary"" ? ""btn-primary"" : buttonStyle; buttonStyle = buttonStyle == ""secondary"" ? ""btn-secondary"" : buttonStyle; buttonStyle = buttonStyle == ""link"" ? ""btn-link"" : buttonStyle; <div class=""m-0""> <a"); 109 BeginWriteAttribute("href", " href=\"", 9049, "\"", 9065, 1); 110 WriteAttributeValue("", 9056, link.Url, 9056, 9, false); 111 EndWriteAttribute(); 112 BeginWriteAttribute("class", " class=\"", 9066, "\"", 9119, 4); 113 WriteAttributeValue("", 9074, "btn", 9074, 3, true); 114 WriteAttributeValue(" ", 9077, buttonStyle, 9078, 12, false); 115 WriteAttributeValue("", 9090, buttonSize, 9090, 13, false); 116 WriteAttributeValue("", 9103, StretchedLink, 9103, 16, false); 117 EndWriteAttribute(); 118 WriteLiteral(" "); 119 Write(target); 120 WriteLiteral(" "); 121 Write(rel); 122 WriteLiteral(">"); 123 Write(item.GetString("ButtonLabel")); 124 WriteLiteral(@"</a> </div> } else if (link != null && !string.IsNullOrEmpty(link.Url)) { string target = Pageview.AreaSettings.GetBoolean(""OpenLinksInNewTab"") && link.IsExternal ? ""target=\""_blank\"""" : """"; string rel = Pageview.AreaSettings.GetBoolean(""OpenLinksInNewTab"") && link.IsExternal ? ""rel=\""noopener\"""" : """"; <a"); 125 BeginWriteAttribute("href", " href=\"", 9482, "\"", 9498, 1); 126 WriteAttributeValue("", 9489, link.Url, 9489, 9, false); 127 EndWriteAttribute(); 128 WriteLiteral(" "); 129 Write(target); 130 WriteLiteral(" "); 131 Write(rel); 132 WriteLiteral(" class=\""); 133 Write(StretchedLink); 134 WriteLiteral("\">\n\t\t\t<span class=\"visually-hidden\">"); 135 Write(Model.Item.GetString("Title")); 136 WriteLiteral(@"</span> </a> } } <script type=""module"" src=""~/Files/Templates/Designs/Swift/Assets/js/tiny-slider.js""></script> <script type=""module""> swift.AssetLoader.Load('Files/Templates/Designs/Swift/Assets/css/tiny-slider.css', 'css'); document.addEventListener('load.swift.assetloader', function () { var slider = tns({ container: ""#carousel_"); 137 Write(uniqueId); 138 WriteLiteral("\",\n\t\t\tcontrols: false,\n\t\t\tnav: false,\n\t\t\tautoplay: "); 139 Write(enableAutoplay); 140 WriteLiteral(",\n\t\t\tautoplayTimeout: "); 141 Write(interval); 142 WriteLiteral(",\n\t\t\tautoplayHoverPause: true,\n\t\t\tautoplayButtonOutput: false,\n\t\t\titems: 1,\n\t\t\tloop: "); 143 Write(enableAutoplay); 144 WriteLiteral(",\n\t\t\tmode: \""); 145 Write(animation); 146 WriteLiteral("\",\n\t\t\trewind: false,\n\t\t\tarrowKeys: false,\n\t\t\tlazyload: true,\n\t\t\tswipeAngle: 30,\n\t\t\tmouseDrag: true,\n\t\t\tpreventScrollOnTouch: \'auto\',\n\t\t\tresponsive: {\n\t\t\t\t992: {\n\t\t\t\t\tcontrols: "); 147 Write(enableControls); 148 WriteLiteral(@", mouseDrag: false, controlsText: [ '<span class=""tns-controls-icon"" style=""height:3em; width: 3em;""><span class=""visually-hidden"">Previous</span><span class=""icon-3""><svg viewBox=""0 0 16 16"" class=""bi bi-arrow-left"" fill=""currentColor"" xmlns=""http://www.w3.org/2000/svg""><path fill-rule=""evenodd"" d=""M15 8a.5.5 0 0 0-.5-.5H2.707l3.147-3.146a.5.5 0 1 0-.708-.708l-4 4a.5.5 0 0 0 0 .708l4 4a.5.5 0 0 0 .708-.708L2.707 8.5H14.5A.5.5 0 0 0 15 8z""/></svg></span></span>', '<span class=""tns-controls-icon"" style=""height:3em; width: 3em;""><span class=""visually-hidden"">Next</span><span class=""icon-3""><svg viewBox=""0 0 16 16"" class=""bi bi-arrow-right"" fill=""currentColor"" xmlns=""http://www.w3.org/2000/svg""><path fill-rule=""evenodd"" d=""M1 8a.5.5 0 0 1 .5-.5h11.793l-3.147-3.146a.5.5 0 0 1 .708-.708l4 4a.5.5 0 0 1 0 .708l-4 4a.5.5 0 0 1-.708-.708L13.293 8.5H1.5A.5.5 0 0 1 1 8z""/></svg></span></span>' ], } } }); }); </script> "); 149 if (movePageBehind && isFirstPoster) { WriteLiteral("\t<script>\n\t\t[\'resize\', \'load\'].forEach(function (e) {\n\t\t\twindow.addEventListener(e, () => swift.Scroll.setContentPosition());\n\t\t});\n\t</script>\n"); 150 } } 151 #pragma warning restore 1998 152 } 153 } 154 #pragma warning restore 1591 155
1 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel> @using Dynamicweb.Ecommerce.ProductCatalog @using System.Web @using Dynamicweb.Frontend @{ bool movePageBehind = false; bool isFirstPoster = false; string movePageBehindClass = ""; if (Pageview.Page.PropertyItem != null) { string headerCssClass = Pageview.Page.PropertyItem["MoveThisPageBehindTheHeader"] != null ? Pageview.Page.PropertyItem["MoveThisPageBehindTheHeader"].ToString() : "sticky-top"; movePageBehind = headerCssClass == "fixed-top" && !Pageview.IsVisualEditorMode ? true : false; if (movePageBehind) { movePageBehindClass = " poster-behind"; if (!Dynamicweb.Context.Current.Items.Contains("firstPosterIsRendered")) { isFirstPoster = true; Dynamicweb.Context.Current.Items.Add("firstPosterIsRendered", true); } } } var uniqueId = Pageview.CurrentParagraph.ID.ToString(); string title = Model.Item.GetString("Title"); var carouselItems = Model.Item?.GetItems("Carousel_Items") ?? Enumerable.Empty<Dynamicweb.Frontend.ItemViewModel>().ToList(); string enableControls = Model.Item.GetBoolean("EnableControls").ToString().ToLower(); string enableIndcators = Model.Item.GetBoolean("EnableIndicators").ToString().ToLower(); bool autoplay = Model.Item.GetBoolean("Autoplay"); string interval = (autoplay) ? Model.Item.GetString("Interval", "5000") : "0"; string enableAutoplay = autoplay.ToString().ToLower(); string animation = Model.Item.GetRawValueString("Animation", "carousel"); string carouselHeight = Model.Item.GetRawValueString("CarouselHeight", "h-100 min-vh-75 min-vh-md-100"); carouselHeight = carouselHeight == "small" ? "min-vh-25 min-vh-md-50" : carouselHeight; carouselHeight = carouselHeight == "medium" ? "min-vh-50 min-vh-md-75" : carouselHeight; carouselHeight = carouselHeight == "large" ? "min-vh-75 min-vh-md-100" : carouselHeight; string buttonSize = Model.Item.GetRawValueString("buttonSize", "regular"); buttonSize = buttonSize == "small" ? " btn-sm" : buttonSize; buttonSize = buttonSize == "regular" ? "" : buttonSize; buttonSize = buttonSize == "large" ? " btn-lg" : buttonSize; string carouselPadding = Model.Item.GetRawValueString("ContentPadding", ""); carouselPadding = carouselPadding == "none" ? "p-3 px-xl-3 py-xl-4" : carouselPadding; carouselPadding = carouselPadding == "small" ? "p-3 p-xl-4" : carouselPadding; carouselPadding = carouselPadding == "large" ? "p-4 p-xl-5" : carouselPadding; string titleFontSize = Model.Item.GetRawValueString("TitleFontSize", "display-1"); string subtitleFontSize = Model.Item.GetRawValueString("SubtitleFontSize", "fs-5"); } <div id="carousel_@uniqueId" class="js-slider item_@Model.Item.SystemName.ToLower()"> @{ bool isFirst = true; } @foreach (var item in carouselItems) { @RenderItem(item, isFirst, carouselHeight, carouselPadding, buttonSize, titleFontSize, subtitleFontSize, movePageBehindClass) isFirst = false; } </div> @helper RenderItem(ItemViewModel item, bool isFirst, string carouselHeight, string carouselPadding, string buttonSize, string titleFontSize, string subtitleFontSize, string movePageBehindClass) { string layout = item.GetRawValueString("Layout", "align-middle-center-text-center"); string carouselWidth = "container-xl"; int xPos = item?.GetFile("Image")?.FocalPositionFromLeft ?? 50; int yPos = item?.GetFile("Image")?.FocalPositionFromTop ?? 50; string theme = !string.IsNullOrWhiteSpace(item.GetRawValueString("Theme")) ? " theme " + item.GetRawValueString("Theme").Replace(" ", "").Trim().ToLower() : ""; string active = isFirst ? "active" : ""; string alignment = ""; string maxWidth = item.GetRawValueString("TextReadability", "max-width-on"); maxWidth = maxWidth == "max-width-on" ? "mw-75ch d-inline-block" : maxWidth; maxWidth = maxWidth == "max-width-off" ? "" : maxWidth; <div class="@(active)"> <div class="position-relative h-100@(theme)@(movePageBehindClass)"> @RenderImage(item) @switch (layout) { case "align-top-left-text-left": alignment = "text-start justify-content-start align-items-start"; break; case "align-top-center-text-center": alignment = "text-center justify-content-start align-items-start"; break; case "align-top-right-text-right": alignment = "text-end justify-content-start align-items-start"; break; case "align-middle-left-text-left": alignment = "text-start justify-content-center align-items-center"; break; case "align-middle-center-text-center": alignment = "text-center justify-content-center align-items-center"; break; case "align-middle-right-text-right": alignment = "text-end justify-content-center align-items-center"; break; case "align-bottom-left-text-left": alignment = "text-start justify-content-end align-items-end"; break; case "align-bottom-center-text-center": alignment = "text-center justify-content-end align-items-end"; break; case "align-bottom-right-text-right": alignment = "text-end justify-content-end align-items-end"; break; } <div class="position-relative h-100"> <div class="h-100 grid grid-1 @(carouselWidth) @carouselPadding @(alignment) @(carouselHeight)"> <div class="grid grid-1 gap-3 gap-md-4"> @RenderTitle(item, titleFontSize, maxWidth) @RenderText(item, subtitleFontSize, maxWidth) @RenderButton(item, buttonSize) </div> </div> </div> </div> </div> } @helper RenderImage(ItemViewModel item) { if (!string.IsNullOrEmpty(item.GetString("Image"))) { var parms = new Dictionary<string, object>(); parms.Add("cssClass", "h-100 w-100"); parms.Add("columns", Model.GridRowColumnCount); string imageFilter = item.GetRawValueString("ImageFilter", ""); imageFilter = imageFilter == "no-filter" ? "" : imageFilter; imageFilter = imageFilter == "filter" ? " image-filter" : imageFilter; <div class="position-absolute top-0 bottom-0 end-0 start-0@(imageFilter)"> @RenderPartial("Components/Image.cshtml", item.GetFile("Image") ?? new Dynamicweb.Frontend.FileViewModel(), parms) </div> } } @helper RenderTitle(ItemViewModel item, string titleFontSize, string maxWidth) { if (!string.IsNullOrEmpty(item.GetString("Title")) && !item.GetBoolean("HideTitle")) { <h2 class="@titleFontSize m-0"> <span class="@maxWidth">@item.GetString("Title")</span> </h2> } } @helper RenderText(ItemViewModel item, string subtitleFontSize, string maxWidth) { if (!string.IsNullOrEmpty(item.GetString("Text"))) { <p class="@subtitleFontSize lead m-0"> <span class="@maxWidth">@item.GetString("Text")</span> </p> } } @helper RenderButton(ItemViewModel item, string buttonSize) { string linkType = item.GetRawValueString("LinkType", "page"); Dynamicweb.Frontend.LinkViewModel link = new Dynamicweb.Frontend.LinkViewModel(); string StretchedLink = item.GetRawValueString("StretchedLink", ""); StretchedLink = StretchedLink == "item-not-clickable" ? "" : StretchedLink; StretchedLink = StretchedLink == "item-clickable" ? " stretched-link" : StretchedLink; if (linkType == "page" && item.GetLink("ButtonLink") != null) { link = item.GetLink("ButtonLink"); } if (linkType == "product-group") { IList<ProductGroupViewModel> selectedGroups = item.GetValue<IList<ProductGroupViewModel>>("ProductGroupLink"); IList<string> groupIds = new List<string> { }; if (selectedGroups != null) { foreach (var fromGroup in selectedGroups) { groupIds.Add(fromGroup.Id); } } link = new Dynamicweb.Frontend.LinkViewModel() { Url = "/Default.aspx?ID=" + GetPageIdByNavigationTag("Shop") + "&GroupID=" + string.Join(",", groupIds).Trim(), IsExternal = false }; } if (linkType == "product") { ProductListViewModel products = item.GetValue<ProductListViewModel>("ProductLink"); IList<string> productIds = new List<string> { }; if (products != null) { foreach (var product in products.Products) { productIds.Add(product.Id); } } string productParameter = productIds.Count == 1 ? "ProductID" : "MainProductId"; string pageTag = productIds.Count == 1 ? "ProductDetailPage" : "Shop"; link = new Dynamicweb.Frontend.LinkViewModel() { Url = "/Default.aspx?ID=" + GetPageIdByNavigationTag(pageTag) + "&" + productParameter + "=" + string.Join(",", productIds).Trim(), IsExternal = false }; } if (link != null && !string.IsNullOrEmpty(item.GetString("ButtonLabel"))) { string target = Pageview.AreaSettings.GetBoolean("OpenLinksInNewTab") && link.IsExternal ? "target=\"_blank\"" : ""; string rel = Pageview.AreaSettings.GetBoolean("OpenLinksInNewTab") && link.IsExternal ? "rel=\"noopener\"" : ""; string buttonStyle = item.GetRawValueString("ButtonStyle", "primary"); buttonStyle = buttonStyle == "primary" ? "btn-primary" : buttonStyle; buttonStyle = buttonStyle == "secondary" ? "btn-secondary" : buttonStyle; buttonStyle = buttonStyle == "link" ? "btn-link" : buttonStyle; <div class="m-0"> <a href="@link.Url" class="btn @buttonStyle@(buttonSize)@(StretchedLink)" @target @rel>@item.GetString("ButtonLabel")</a> </div> } else if (link != null && !string.IsNullOrEmpty(link.Url)) { string target = Pageview.AreaSettings.GetBoolean("OpenLinksInNewTab") && link.IsExternal ? "target=\"_blank\"" : ""; string rel = Pageview.AreaSettings.GetBoolean("OpenLinksInNewTab") && link.IsExternal ? "rel=\"noopener\"" : ""; <a href="@link.Url" @target @rel class="@StretchedLink"> <span class="visually-hidden">@Model.Item.GetString("Title")</span> </a> } } <script type="module" src="~/Files/Templates/Designs/Swift/Assets/js/tiny-slider.js"></script> <script type="module"> swift.AssetLoader.Load('Files/Templates/Designs/Swift/Assets/css/tiny-slider.css', 'css'); document.addEventListener('load.swift.assetloader', function () { var slider = tns({ container: "#carousel_@uniqueId", controls: false, nav: false, autoplay: @enableAutoplay, autoplayTimeout: @interval, autoplayHoverPause: true, autoplayButtonOutput: false, items: 1, loop: @enableAutoplay, mode: "@animation", rewind: false, arrowKeys: false, lazyload: true, swipeAngle: 30, mouseDrag: true, preventScrollOnTouch: 'auto', responsive: { 992: { controls: @enableControls, mouseDrag: false, controlsText: [ '<span class="tns-controls-icon" style="height:3em; width: 3em;"><span class="visually-hidden">Previous</span><span class="icon-3"><svg viewBox="0 0 16 16" class="bi bi-arrow-left" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M15 8a.5.5 0 0 0-.5-.5H2.707l3.147-3.146a.5.5 0 1 0-.708-.708l-4 4a.5.5 0 0 0 0 .708l4 4a.5.5 0 0 0 .708-.708L2.707 8.5H14.5A.5.5 0 0 0 15 8z"/></svg></span></span>', '<span class="tns-controls-icon" style="height:3em; width: 3em;"><span class="visually-hidden">Next</span><span class="icon-3"><svg viewBox="0 0 16 16" class="bi bi-arrow-right" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M1 8a.5.5 0 0 1 .5-.5h11.793l-3.147-3.146a.5.5 0 0 1 .708-.708l4 4a.5.5 0 0 1 0 .708l-4 4a.5.5 0 0 1-.708-.708L13.293 8.5H1.5A.5.5 0 0 1 1 8z"/></svg></span></span>' ], } } }); }); </script> @if (movePageBehind && isFirstPoster) { <script> ['resize', 'load'].forEach(function (e) { window.addEventListener(e, () => swift.Scroll.setContentPosition()); }); </script> }
Det er uhyggeligt at komme i gang med Wiser smart home
Start med en af vores pakkerUdvalgte kategorier
Populære produkter lige nu
Error executing template "Designs/Swift/Paragraph/Swift_RelatedProducts.cshtml" System.NullReferenceException: Object reference not set to an instance of an object. at CompiledRazorTemplates.Dynamic.RazorEngine_b5c46b1834ee4b26a23a0ca67e69da79.ExecuteAsync() at RazorEngine.Templating.TemplateBase.Run(ExecuteContext context, TextWriter reader) at RazorEngine.Templating.RazorEngineCore.RunTemplate(ICompiledTemplate template, TextWriter writer, Object model, DynamicViewBag viewBag) at RazorEngine.Templating.RazorEngineService.Run(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag) at RazorEngine.Templating.DynamicWrapperService.Run(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag) at RazorEngine.Templating.RazorEngineServiceExtensions.Run(IRazorEngineService service, String name, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag) at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass23_0.<Run>b__0(TextWriter writer) at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter) at RazorEngine.Templating.RazorEngineServiceExtensions.Run(IRazorEngineService service, String name, Type modelType, Object model, DynamicViewBag viewBag) at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template) in /_/src/Application/Providers/Dynamicweb.Rendering.Providers.NetCore/Razor/RazorTemplateRenderingProvider.cs:line 99 at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template) in E:\A10\_w\2\s\src\Core\Dynamicweb.Core\Rendering\TemplateRenderingService.cs:line 21 at Dynamicweb.Rendering.Template.RenderRazorTemplate() in E:\A10\_w\2\s\src\Core\Dynamicweb.Core\Rendering\Template.cs:line 749
1 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel> 2 @using Dynamicweb.Core 3 @using Dynamicweb.Ecommerce.ProductCatalog 4 5 @{ 6 ProductViewModel product = null; 7 if (Dynamicweb.Context.Current.Items.Contains("ProductDetails")) 8 { 9 product = (ProductViewModel)Dynamicweb.Context.Current.Items["ProductDetails"]; 10 } 11 else if (Pageview.Page.Item["DummyProduct"] != null && Pageview.IsVisualEditorMode) 12 { 13 var pageViewModel = Dynamicweb.Frontend.ContentViewModelFactory.CreatePageInfoViewModel(Pageview.Page); 14 ProductListViewModel productList = pageViewModel.Item.GetValue("DummyProduct") != null ? pageViewModel.Item.GetValue("DummyProduct") as ProductListViewModel : new ProductListViewModel(); 15 16 if (productList?.Products is object) 17 { 18 product = productList.Products[0]; 19 } 20 } 21 22 string title = Model?.Item?.GetRawValueString("Title", Translate("Products")); 23 string campaignValues = string.Join(",", Model.Item.GetList("CampaignBadges")?.GetRawValue().OfType<string>().ToList()); 24 25 //Styling 26 string titleFontSize = Model.Item.GetRawValueString("TitleFontSize", "h3"); 27 string subtitleFontSize = Model.Item.GetRawValueString("SubtitleFontSize", "fs-5"); 28 string buttonStyle = Model.Item.GetRawValueString("ButtonStyle", ""); 29 buttonStyle = buttonStyle == "primary" ? " btn-primary" : buttonStyle; 30 buttonStyle = buttonStyle == "secondary" ? " btn-secondary" : buttonStyle; 31 buttonStyle = buttonStyle == "link" ? " btn-link" : buttonStyle; 32 string maxWidth = Model.Item.GetRawValueString("TextReadability", ""); 33 maxWidth = maxWidth == "max-width-on" ? " mw-75ch" : maxWidth; 34 maxWidth = maxWidth == "max-width-off" ? "" : maxWidth; 35 36 string generalTheme = !string.IsNullOrWhiteSpace(Model.Item.GetRawValueString("GeneralTheme")) ? " theme " + Model.Item.GetRawValueString("GeneralTheme").Replace(" ", "").Trim().ToLower() : ""; 37 string theme = !string.IsNullOrWhiteSpace(Model.Item.GetRawValueString("Theme")) ? " theme " + Model.Item.GetRawValueString("Theme").Replace(" ", "").Trim().ToLower() : ""; 38 string imageTheme = !string.IsNullOrWhiteSpace(Model.Item.GetRawValueString("ImageTheme")) ? " theme " + Model.Item.GetRawValueString("ImageTheme").Replace(" ", "").Trim().ToLower() : ""; 39 40 //Link generation 41 string pageId = !string.IsNullOrEmpty(Model.Item.GetRawValueString("ProductSliderServicePage")) ? Model.Item.GetLink("ProductSliderServicePage").PageId.ToString() : ""; 42 if (string.IsNullOrEmpty(pageId)) 43 { 44 pageId = GetPageIdByNavigationTag("ProductSliderService").ToString(); 45 } 46 47 string url = "/Default.aspx?ID=" + pageId; 48 if (!url.Contains("LayoutTemplate", StringComparison.OrdinalIgnoreCase)) 49 { 50 url += url.Contains("?") ? "&LayoutTemplate=Designs/Swift/Swift_PageClean.cshtml" : "?LayoutTemplate=Designs/Swift/Swift_PageClean.cshtml"; 51 } 52 if (Pageview.IsVisualEditorMode) 53 { 54 url += "&VisualEdit=True"; 55 } 56 57 bool isLazyLoadingForProductInfoEnabled = Dynamicweb.Core.Converter.ToBoolean(Dynamicweb.Context.Current.Items["IsLazyLoadingForProductInfoEnabled"]); 58 if (isLazyLoadingForProductInfoEnabled) 59 { 60 url += "&getproductinfo=true"; 61 } 62 63 //Source type 64 string sourceType = Model.Item.GetRawValueString("RelationType", "trending"); 65 IList<string> relateFromGroupIds = new List<string> { }; 66 IList<string> relateFromProductVariantIds = new List<string> { }; 67 IList<string> relateFromProductIds = new List<string> { }; 68 bool hasVariants = false; 69 70 //--- VARIANTS --- 71 if (sourceType == "variants" && Model.Item.GetValue<ProductListViewModel>("ProductsToRelateToVariants") is ProductListViewModel productsToRelateToVariants) 72 { 73 foreach (var productSelection in productsToRelateToVariants.Products) 74 { 75 relateFromProductIds.Add(productSelection.Id); 76 } 77 } 78 79 //--- MOST SOLD --- 80 if (sourceType == "most-sold" && Model.Item.GetValue<IList<ProductGroupViewModel>>("GroupsToRelateToMostSold") is IList<ProductGroupViewModel> groupsToRelateToMostSold) 81 { 82 foreach (var fromGroup in groupsToRelateToMostSold) 83 { 84 relateFromGroupIds.Add(fromGroup.Id); 85 } 86 } 87 88 //--- TRENDING --- 89 if (sourceType == "trending" && Model.Item.GetValue<IList<ProductGroupViewModel>>("GroupsToRelateToTrending") is IList<ProductGroupViewModel> groupsToRelateToTrending) 90 { 91 foreach (var fromGroup in groupsToRelateToTrending) 92 { 93 relateFromGroupIds.Add(fromGroup.Id); 94 } 95 } 96 97 //--- LATEST --- 98 if (sourceType == "latest" && Model.Item.GetValue<IList<ProductGroupViewModel>>("GroupsToRelateToLatest") is IList<ProductGroupViewModel> groupsToRelateToLatest) 99 { 100 foreach (var fromGroup in groupsToRelateToLatest) 101 { 102 relateFromGroupIds.Add(fromGroup.Id); 103 } 104 } 105 106 //--- FREQUENTLY BOUGHT --- 107 if (sourceType == "frequently" && Model.Item.GetValue<ProductListViewModel>("ProductsToRelateTo") is ProductListViewModel productsToRelateTo) 108 { 109 foreach (var fromProduct in productsToRelateTo.Products) 110 { 111 relateFromProductIds.Add(fromProduct.Id); 112 } 113 } 114 115 //--- SELECTED PRODUCTS --- 116 if ((sourceType == "selected" || sourceType == "frequently") && Model.Item.GetValue<ProductListViewModel>("Products") is ProductListViewModel products) 117 { 118 hasVariants = products.Products.Any(p => !string.IsNullOrEmpty(p.VariantId)); 119 foreach (var productSelection in products.Products) 120 { 121 if (hasVariants) 122 { 123 if (!string.IsNullOrEmpty(productSelection.VariantId)) 124 { 125 relateFromProductVariantIds.Add($"{productSelection.Id} {productSelection.VariantId}"); 126 } 127 else 128 { 129 relateFromProductVariantIds.Add($"{productSelection.Id}"); 130 } 131 } 132 relateFromProductIds.Add($"{productSelection.Id}"); 133 } 134 } 135 136 //--- RELATED PRODUCTS --- 137 if (sourceType == "related-products" && Model.Item.GetValue<ProductListViewModel>("ProductsToRelateTo2") is ProductListViewModel selectedRelationProduct) 138 { 139 if (selectedRelationProduct.Products.Any()) 140 { 141 product = selectedRelationProduct.Products.FirstOrDefault(); 142 } 143 144 if (product?.RelatedGroups != null) 145 { 146 foreach (var group in product.RelatedGroups) 147 { 148 foreach (var relatedProduct in group.Products) 149 { 150 if (!string.IsNullOrEmpty(relatedProduct.VariantId)) 151 { 152 relateFromProductVariantIds.Add($"{relatedProduct.ProductId} {relatedProduct.VariantId}"); 153 } 154 else 155 { 156 relateFromProductVariantIds.Add($"{relatedProduct.ProductId}"); 157 } 158 } 159 } 160 } 161 } 162 163 //Create group id collection and products id collection strings 164 string groupIds = product is object ? product.PrimaryOrDefaultGroup.Id : string.Join(",", relateFromGroupIds); 165 string productVariantIds = relateFromProductVariantIds.Count > 0 ? string.Join(",", relateFromProductVariantIds) : ""; 166 string productIds = product is object && relateFromProductIds.Count == 0 ? product.Id : string.Join(",", relateFromProductIds); 167 168 //Set the parameters to the url 169 string linkParameters = ""; 170 linkParameters += sourceType != "related-products" && sourceType != "frequently" && sourceType != "selected" ? "&GroupId=" + groupIds : ""; 171 linkParameters += !string.IsNullOrEmpty(productIds) && sourceType != "most-sold" && sourceType != "trending" && sourceType != "latest" && sourceType != "frequently" && sourceType != "related-products" ? "&MainProductId=" + productIds : ""; 172 linkParameters += !string.IsNullOrEmpty(productVariantIds) && sourceType == "related-products" ? "&ProductVariantId=" + productVariantIds : ""; 173 linkParameters += sourceType == "variants" ? "&IsVariant=true" : ""; 174 linkParameters += sourceType == "latest" ? "&SortBy=Created" : ""; 175 linkParameters += sourceType == "most-sold" ? "&SortBy=OrderCount" : ""; 176 linkParameters += sourceType == "trending" ? "&SortBy=OrderCountGrowth" : ""; 177 linkParameters += !string.IsNullOrEmpty(productIds) && sourceType == "frequently" ? $"&BoughtWithProductIds=[{productIds}]" : ""; 178 var productListPageId = GetPageIdByNavigationTag("Shop"); 179 string link = "/Default.aspx?ID=" + productListPageId + linkParameters; 180 181 // Slider settings (documentation: swiffyslider.com/configuration) 182 string navigationStyle = $"{Model.Item.GetRawValueString("NavigationStyle", "slider-nav-round")}"; 183 string navigationPlacement = $"{Model.Item.GetRawValueString("NavigationPlacement", "slider-nav-on-slides")}"; 184 string indicatorStyle = $"{Model.Item.GetRawValueString("IndicatorStyle", "slider-indicators-hidden")}"; 185 string revealSlides = Model.Item.GetRawValueString("RevealSlides", "no-reveal") == "reveal" ? "slider-item-reveal" : string.Empty; 186 string navigationAlwaysVisible = (Model.Item.GetBoolean("NavigationAlwaysVisible")) ? "slider-nav-visible" : string.Empty; 187 string navigationVisibleOnTouch = (Model.Item.GetBoolean("NavigationVisibleOnTouch")) ? "slider-nav-touch" : string.Empty; 188 string navigationShowScrollbar = (Model.Item.GetBoolean("NavigationShowScrollbar")) ? "slider-nav-scrollbar" : string.Empty; 189 string navigationSmall = (Model.Item.GetBoolean("NavigationSmall")) ? "slider-nav-sm" : string.Empty; 190 string navigationInvertColors = (Model.Item.GetBoolean("NavigationInvertColors")) ? "slider-nav-dark" : string.Empty; 191 string navigationSlideEntirePage = (Model.Item.GetBoolean("NavigationSlideEntirePage")) ? "slider-nav-page" : string.Empty; 192 string navigationNoLoop = (Model.Item.GetBoolean("NavigationNoLoop")) ? "slider-nav-noloop" : string.Empty; 193 string indicatorsOutsideSlider = (Model.Item.GetBoolean("IndicatorsOutsideSlider") && indicatorStyle != string.Empty) ? "slider-indicators-outside" : string.Empty; 194 string indicatorsHighlightActive = (Model.Item.GetBoolean("IndicatorsHighlightActive")) ? "slider-indicators-highlight" : string.Empty; 195 string indicatorsInvertColors = (Model.Item.GetBoolean("IndicatorsInvertedColors")) ? "slider-indicators-dark" : string.Empty; 196 string indicatorsVisibleOnSmallDevices = (Model.Item.GetBoolean("IndicatorsVisibleOnSmallDevices")) ? "slider-indicators-sm" : string.Empty; 197 198 bool productsFound = true; 199 if (string.IsNullOrEmpty(groupIds) && string.IsNullOrEmpty(productIds) && string.IsNullOrEmpty(productVariantIds)) 200 { 201 if (Pageview.IsVisualEditorMode) 202 { 203 productIds = product.Id; 204 sourceType = "selected"; 205 } 206 else 207 { 208 productsFound = false; 209 } 210 } 211 } 212 213 @*Container element for the request*@ 214 @if (productsFound) 215 { 216 <form method="post" action="@url" id="RelatedProductsForm_@Model.ID" data-response-target-element="RelatedProducts_@Model.ID" data-preloader="inline" data-update-url="false" class="item_@Model.Item.SystemName.ToLower()"> 217 <input type="hidden" name="ModelID" value="@Model.ID"> 218 <input type="hidden" name="SourceType" value="@sourceType"> 219 220 @*--- SLIDER SETTINGS ---*@ 221 <input type="hidden" name="NavigationStyle" value="@navigationStyle"> 222 <input type="hidden" name="NavigationPlacement" value="@navigationPlacement"> 223 <input type="hidden" name="IndicatorStyle" value="@indicatorStyle"> 224 <input type="hidden" name="RevealSlides" value="@revealSlides"> 225 <input type="hidden" name="NavigationAlwaysVisible" value="@(navigationAlwaysVisible)"> 226 <input type="hidden" name="NavigationVisibleOnTouch" value="@(navigationVisibleOnTouch)"> 227 <input type="hidden" name="NavigationShowScrollbar" value="@(navigationShowScrollbar)"> 228 <input type="hidden" name="NavigationSmall" value="@(navigationSmall)"> 229 <input type="hidden" name="NavigationInvertColors" value="@(navigationInvertColors)"> 230 <input type="hidden" name="NavigationNoLoop" value="@(navigationNoLoop)"> 231 <input type="hidden" name="NavigationSlideEntirePage" value="@(navigationSlideEntirePage)"> 232 <input type="hidden" name="IndicatorsOutsideSlider" value="@(indicatorsOutsideSlider)"> 233 <input type="hidden" name="IndicatorsHighlightActive" value="@(indicatorsHighlightActive)"> 234 <input type="hidden" name="IndicatorsInvertColors" value="@(indicatorsInvertColors)"> 235 <input type="hidden" name="IndicatorsVisibleOnSmallDevices" value="@(indicatorsVisibleOnSmallDevices)"> 236 237 @*--- VARIANTS ---*@ 238 @if (sourceType == "variants") 239 { 240 <input type="hidden" name="isVariant" value="true"> 241 <input type="hidden" name="MainProductID" id="MainProductID_@Model.ID" value="@productIds"> 242 } 243 244 @*--- MOST SOLD ---*@ 245 @if (sourceType == "most-sold") 246 { 247 <input type="hidden" name="SortBy" value="OrderCount"> 248 if (groupIds != "") 249 { 250 <input type="hidden" name="GroupId" value="@groupIds"> 251 } 252 } 253 254 @*--- TRENDING ---*@ 255 @if (sourceType == "trending") 256 { 257 <input type="hidden" name="SortBy" value="OrderCountGrowth"> 258 if (groupIds != "") 259 { 260 <input type="hidden" name="GroupId" value="@groupIds"> 261 } 262 } 263 264 @*--- FREQUENTLY BOUGHT ---*@ 265 @if (sourceType == "frequently" && !string.IsNullOrEmpty(productIds)) 266 { 267 <input type="hidden" name="BoughtWithProductIds" value="[@productIds]"> 268 } 269 @if (sourceType != "frequently" && hasVariants) 270 { 271 <input type="hidden" name="ProductVariantId" value="@productVariantIds"> 272 } 273 274 @*--- LATEST ---*@ 275 @if (sourceType == "latest") 276 { 277 <input type="hidden" name="SortBy" value="Created"> 278 <input type="hidden" name="GroupId" value="@groupIds"> 279 } 280 281 @*--- SELECTED PRODUCTS ---*@ 282 @if (sourceType == "selected" && !string.IsNullOrEmpty(productIds) && !hasVariants) 283 { 284 <input type="hidden" name="MainProductId" id="MainProductID_@Model.ID" value="@productIds"> 285 } 286 @if (sourceType == "selected" && hasVariants) 287 { 288 <input type="hidden" name="ProductVariantId" value="@productVariantIds"> 289 } 290 291 @*--- RELATED PRODUCTS ---*@ 292 @if (sourceType == "related-products") 293 { 294 <input type="hidden" name="ProductVariantId" id="MainProductID_@Model.ID" value="@productVariantIds"> 295 } 296 297 @* General parameters *@ 298 <input type="hidden" name="Link" value="@link"> 299 <input type="hidden" name="HideTitle" value="@Model.Item.GetString("HideTitle")"> 300 301 @if (Model.Item.GetInt32("ProductsCount") != 0) 302 { 303 <input type="hidden" name="PageSize" value="@Model.Item.GetInt32("ProductsCount")"> 304 } 305 <input type="hidden" name="HeadingTitle" id="RelatedProductsTitle_@Model.ID" value="@title"> 306 @if (!string.IsNullOrEmpty(Model.Item.GetString("Subtitle"))) 307 { 308 <input type="hidden" name="Subtitle" value="@Model.Item.GetString("Subtitle")"> 309 } 310 @if (!string.IsNullOrEmpty(Model.Item.GetString("LinkText"))) 311 { 312 <input type="hidden" name="LinkText" value="@Model.Item.GetString("LinkText")"> 313 } 314 @if (!string.IsNullOrEmpty(Model.Item.GetString("ImageAspectRatio"))) 315 { 316 string ratio = Model.Item.GetRawValueString("ImageAspectRatio", ""); 317 ratio = ratio != "0" ? ratio : ""; 318 <input type="hidden" name="ImageAspectRatio" value="@ratio"> 319 } 320 @if (!string.IsNullOrEmpty(Model.Item.GetString("Layout"))) 321 { 322 <input type="hidden" name="Layout" value="@Model.Item.GetRawValueString("Layout")"> 323 } 324 @if (titleFontSize != "") 325 { 326 <input type="hidden" name="TitleFontSize" value="@titleFontSize"> 327 } 328 @if (subtitleFontSize != "") 329 { 330 <input type="hidden" name="SubtitleFontSize" value="@subtitleFontSize"> 331 } 332 @if (buttonStyle != "") 333 { 334 <input type="hidden" name="ButtonStyle" value="@buttonStyle"> 335 } 336 @if (generalTheme != "") 337 { 338 <input type="hidden" name="GeneralTheme" value="@generalTheme"> 339 } 340 @if (theme != "") 341 { 342 <input type="hidden" name="Theme" value="@theme"> 343 } 344 @if (imageTheme != "") 345 { 346 <input type="hidden" name="ImageTheme" value="@imageTheme"> 347 } 348 @if (!string.IsNullOrEmpty(Model.Item.GetString("ContentPadding"))) 349 { 350 string contentPadding = Model.Item.GetRawValueString("ContentPadding"); 351 <input type="hidden" name="ContentPadding" value="@contentPadding"> 352 } 353 <input type="hidden" name="TextReadability" value="@maxWidth"> 354 <input type="hidden" name="ParentColumnSize" id="ParentColumnSize_@Model.ID" value="12"> 355 356 <input type="hidden" name="SaleBadgeType" value="@Model.Item.GetRawValue("SaleBadgeType")"> 357 <input type="hidden" name="SaleBadgeCssClassName" value="@Model.Item.GetRawValue("SaleBadgeDesign")"> 358 <input type="hidden" name="NewBadgeCssClassName" value="@Model.Item.GetRawValue("NewBadgeDesign")"> 359 <input type="hidden" name="NewPublicationDays" value="@Model.Item.GetInt32("NewPublicationDays")"> 360 361 @if (campaignValues != string.Empty) 362 { 363 <input type="hidden" name="CampaignBadgesValues" value="@campaignValues"> 364 } 365 </form> 366 367 <script type="module" src="/Files/Templates/Designs/Swift/Assets/js/swiffy-slider.js"></script> 368 <script> 369 window.addEventListener("load", () => { 370 swift.AssetLoader.Load('/Files/Templates/Designs/Swift/Assets/css/swiffy-slider.min.css', 'css'); 371 }); 372 </script> 373 374 if (Pageview.IsVisualEditorMode) 375 { 376 <div class="alert alert-info" role="alert"> 377 <span>@Translate("Product slider: Edit this column to configure")</span> 378 </div> 379 } 380 381 if (sourceType != "related-products") 382 { 383 <div class="w-100 h-100"> 384 <div id="@Model.ID" class="user-select-none" style="scroll-margin-top:var(--header-height,150px)"></div> 385 <div id="RelatedProducts_@Model.ID" class="h-100 swift_product_slider_container"></div> 386 </div> 387 } 388 else if (product?.RelatedGroups != null) 389 { 390 @* Create multiple slider containers, if type is Product relation *@ 391 <div class="grid w-100 h-100@(generalTheme)" style="grid-row-gap: 4rem"> 392 <div id="@Model.ID" class="user-select-none" style="scroll-margin-top:var(--header-height,150px)"></div> 393 @foreach (var group in product.RelatedGroups) 394 { 395 <div id="RelatedProducts_@(Model.ID)_@group.Id" class="g-col-12 h-100 swift_product_slider_container"></div> 396 } 397 </div> 398 } 399 400 @* Initialize *@ 401 if (sourceType != "related-products") 402 { 403 <script type="module"> 404 if (document.querySelector("#RelatedProducts_@Model.ID").closest("[data-col-size]")) { 405 document.querySelector("#ParentColumnSize_@Model.ID").value = document.querySelector("#RelatedProducts_@Model.ID").closest("[data-col-size]").getAttribute("data-col-size"); 406 } 407 swift.PageUpdater.Update(document.querySelector("#RelatedProductsForm_@Model.ID")).then(function () { 408 setTimeout(function() { 409 const isVisualEditor = @(Converter.ToString(Pageview.IsVisualEditorMode).ToLowerInvariant()); 410 const productSliderContainer = document.querySelector(".swift_product_slider_container"); 411 412 if (productSliderContainer && productSliderContainer.innerHTML !== "") { 413 productSliderContainer.classList.remove("d-none"); 414 } 415 else if (!isVisualEditor) { 416 productSliderContainer.closest("[class*=column]").classList.add("d-none"); 417 } 418 }, 150); 419 }); 420 </script> 421 } 422 else if (product?.RelatedGroups != null) 423 { 424 @* Create multiple sliders, if type is Product relation *@ 425 foreach (var group in product.RelatedGroups) 426 { 427 IList<string> fromProductIds = new List<string> { }; 428 429 foreach (var relatedProduct in group.Products) 430 { 431 if (!string.IsNullOrEmpty(relatedProduct.VariantId)) 432 { 433 fromProductIds.Add($"{relatedProduct.ProductId} {relatedProduct.VariantId}"); 434 } 435 else 436 { 437 fromProductIds.Add($"{relatedProduct.ProductId}"); 438 } 439 } 440 <script type="module"> 441 document.querySelector("#ParentColumnSize_@Model.ID").value = document.querySelector("#RelatedProducts_@(Model.ID)_@group.Id").closest("[data-col-size]").getAttribute("data-col-size"); 442 document.querySelector("#MainProductID_@Model.ID").value = "@string.Join(",", fromProductIds)"; 443 document.querySelector("#RelatedProductsTitle_@Model.ID").value = "@group.Name"; 444 document.querySelector("#RelatedProductsForm_@Model.ID").setAttribute("data-response-target-element", "RelatedProducts_@(Model.ID)_@group.Id"); 445 446 swift.PageUpdater.Update(document.querySelector("#RelatedProductsForm_@Model.ID")); 447 </script> 448 } 449 } 450 } 451
Få tips og guides til gør-det-selv-projekterne
Eglo er Månedens Mærke
Det betyder, at du lige nu kan spare penge på hele Eglos lampesortiment. Du finder din favoritlampe lige her under. Gælder t.o.m. 01/08-2021
Hvad er dit næste projekt i din bolig?
Find inspiration, og de bedste materialer fra de førende producenter hos os. Uanset om det er inde eller ude kan din bolig sikkert trænge til fornyelse. Vi har alt hvad du har behov for til opgaven; fra haveredskaber. værktøj, vandslanger, højtryksrensere, udendørs belysning eller terrassevarmere til at forlænge dagene i haven.
God lyskvalitet kan sikre dig bedre velvære.
Vi bruger mere tid indendørs end nogensinde før. Vores valg af belysning har aldrig haft større betydning. Hvorfor ikke starte det rigtige sted? - Vælg en LED lyskilde eller LED lampe, som passer til dig og dine behov. Ved at vælge LED belysning fremfor traditionelle lyskilder kan du opnå samme høje lyskvalitet, men som også giver en besparelse på din elregning. Bedre for vores forbrug, din pengepung og i sidste ende vores miljø.
Populære mærker
Populære mærker
Vores kunder er især glade for disse mærker
Hvem er Greenline.dk?
Greenline.dk er Danmarks største og ældste online forhandler af el-artikler og alle, både private og erhverv, kan handle hos os.
I snart 40 år har vi stået for en nem, hurtig og sikker handel. Uanset om du besøgte Niels i garagen i Hillested på Lolland, hvor det hele begyndte i 1980´erne, om du bestilte pr. postordre eller fax i 90erne eller på internettet fra 00´erne, så har du altid kunnet forvente en nærværende ekspedition og en engageret kundeservice med lyst til at hjælpe dig.
Det er de værdier, som har gjort Greenline til den virksomhed den er i dag.
Vi vil nemlig være kendt for Danmarks bedste kundeservice, og selvom alt kan klares over internettet, så er hjælpen altid lige i nærheden.