Fyll i formuläret nedan om du vill returnera en produkt.

Du kan läsa mer om våra försäljningsvillkor samt reklamations- och ångerrätten här. 

 
 

 

 

Error executing template "/Designs/Swift/Grid/Page/RowTemplates/3Columns_3-6-3.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_b784ac2d677c4a58a4959d1acab78ae4.Execute() in D:\DW9\Solutions\witt.dk\Files\Templates\Designs\Swift\Grid\Page\RowTemplates\3Columns_3-6-3.cshtml:line 8
   at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context, TextWriter reader)
   at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
   at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass16_0.<RunCompile>b__0(TextWriter writer)
   at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
   at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template)
   at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template)
   at Dynamicweb.Rendering.Template.RenderRazorTemplate()

1 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.GridRowViewModel> 2 @using Dynamicweb.Content.Items 3 4 @{ 5 string sectionClass = "py-2"; 6 string containerClass = "container-xl"; 7 8 string spaceBetweenRows = Model.Item.GetRawValueString("SpaceBetweenRows", "").ToLower(); 9 if (spaceBetweenRows != "spacing") 10 { 11 sectionClass = ""; 12 } 13 if (spaceBetweenRows == "spacing-large") 14 { 15 sectionClass = "py-4 py-lg-6"; 16 } 17 if (spaceBetweenRows == "spacing-top") 18 { 19 sectionClass = "pt-4 pt-lg-6"; 20 } 21 if (spaceBetweenRows == "spacing-bottom") 22 { 23 sectionClass = "pb-4 pb-6"; 24 } 25 26 string width = Model.Item.GetRawValueString("Width", "").ToLower(); 27 if (width == "stretch") 28 { 29 containerClass = "container-fluid"; 30 } 31 if (width == "none") 32 { 33 containerClass = ""; 34 } 35 if (width == "compressed") 36 { 37 containerClass = " container-compressed"; 38 } 39 40 string rowClass = "gap-3"; 41 string spaceBetweenColumns = Model.Item.GetRawValueString("SpaceBetweenColumns", "").ToLower(); 42 if (spaceBetweenColumns == "stick") 43 { 44 rowClass = "gap-0"; 45 } 46 if (spaceBetweenColumns == "spacing-medium") 47 { 48 rowClass = "gap-lg-4"; 49 } 50 if (spaceBetweenColumns == "spacing-large") 51 { 52 rowClass = "gap-1 gap-md-4 gap-lg-5"; 53 } 54 55 string theme = !string.IsNullOrWhiteSpace(Model.Item.GetRawValueString("Theme")) ? " theme " + Model.Item.GetRawValueString("Theme").Replace(" ", "").Trim().ToLower() : ""; 56 57 string animationOnScrollCol1 = Model.Item.GetRawValueString("AnimationOnScrollCol1", "no-animation"); 58 animationOnScrollCol1 = animationOnScrollCol1 != "no-animation" ? "data-aos=" + "'" + animationOnScrollCol1 + "'" : ""; 59 string animationOnScrollCol2 = Model.Item.GetRawValueString("AnimationOnScrollCol2", "no-animation"); 60 animationOnScrollCol2 = animationOnScrollCol2 != "no-animation" ? "data-aos=" + "'" + animationOnScrollCol2 + "'" : ""; 61 string animationOnScrollCol3 = Model.Item.GetRawValueString("AnimationOnScrollCol3", "no-animation"); 62 animationOnScrollCol3 = animationOnScrollCol3 != "no-animation" ? "data-aos=" + "'" + animationOnScrollCol3 + "'" : ""; 63 64 string hideOverflow = " overflow-hidden"; 65 hideOverflow = 66 animationOnScrollCol1 != "" || 67 animationOnScrollCol2 != "" || 68 animationOnScrollCol3 != "" 69 ? hideOverflow : ""; 70 71 Dynamicweb.Frontend.FileViewModel backgroundImage = Model.Item.GetFile("BackgroundImage"); 72 string backgroundImagePath = backgroundImage?.Path ?? string.Empty; 73 string imagePath = $"/Admin/Public/GetImage.ashx?image={backgroundImagePath}&width=960&format=webp"; 74 backgroundImagePath = Dynamicweb.Context.Current.Server.UrlEncode(backgroundImagePath); 75 string backgroundRepeat = Model.Item.GetRawValueString("BackgroundImageRepeat", "no-repeat"); 76 string backgroundImageSize = Model.Item.GetRawValueString("BackgroundImageSize", "initial"); 77 int xPos = backgroundImage?.FocalPositionFromLeft ?? 50; 78 int yPos = backgroundImage?.FocalPositionFromTop ?? 50; 79 string cssPosition = $"{xPos}% {yPos}%"; 80 string gradient = Model.Item.GetRawValueString("Gradient", string.Empty); 81 string gradientOpacity = Model.Item.GetRawValueString("GradientOpacity", "0.00"); 82 string gradientString = "linear-gradient(" + gradient + "deg," + "rgba(var(--swift-foreground-color-rgb)," + gradientOpacity + "), rgba(var(--swift-background-color-rgb)," + gradientOpacity + "))"; 83 string backgroundImageString = "url(" + backgroundImagePath + ")"; 84 string backgroundImagePositionString = "background-position:" + cssPosition + ";"; 85 string backgroundRepeatString = "background-repeat:" + backgroundRepeat + ";"; 86 string backgroundImageSizeString = "background-size:" + backgroundImageSize + ";"; 87 string styleString = string.Empty; 88 89 @* Only gradient *@ 90 91 if (!string.IsNullOrEmpty(gradient) && string.IsNullOrEmpty(backgroundImagePath) && gradientOpacity != ("0.00")) 92 { 93 styleString += "style=\"background-image:" + gradientString + ";\""; 94 } 95 96 @* Only background image *@ 97 98 else if (string.IsNullOrEmpty(gradient) && !string.IsNullOrEmpty(backgroundImagePath)) 99 { 100 styleString += "style=\"background-image:" + backgroundImageString + "," + backgroundImagePositionString + backgroundRepeatString + backgroundImageSizeString + "\""; 101 } 102 103 @* Gradient and background image *@ 104 105 else if (!string.IsNullOrEmpty(gradient) && !string.IsNullOrEmpty(backgroundImagePath)) 106 { 107 styleString += "style=\"background-image:" + gradientString + "," + backgroundImageString + ";" + backgroundImagePositionString + backgroundRepeatString + backgroundImageSizeString + "\""; 108 } 109 110 } 111 112 <div class="@(sectionClass)@(theme)" @styleString> 113 <div class="@containerClass@(hideOverflow)"> 114 <div class="grid @rowClass"> 115 <div class="g-col-12 g-col-lg-3" data-col-size="3" @animationOnScrollCol1> 116 @Model.Column(1).Output() 117 </div> 118 <div class="g-col-12 g-col-lg-6" data-col-size="6" @animationOnScrollCol2> 119 @Model.Column(2).Output() 120 </div> 121 <div class="g-col-12 g-col-lg-3" data-col-size="3" @animationOnScrollCol3> 122 @Model.Column(3).Output() 123 </div> 124 </div> 125 </div> 126 </div> 127