Snabba & Säkra Formbyten
Vi är glada att kunna presentera våra exklusiva erbjudanden för November från Mouldshop!
Upptäck framtiden för formsprutning med Flosense, din partner när det gäller att uppnå precision, effektivitet och oöverträffad kvalitet i varje projekt.
AV BESTÄLLNINGAR SKICKAS SAMMA DAG
30 DISTRIBUTÖRER
VÄRLDEN ÖVER
ARTIKELNR.
KUNSKAP OM
INDUSTRIN
BÄSTA
KUNDSERVICE
I EUROPA INOM TILLBEHÖR -
FÖRBRUKNINGS-
ARTIKLAR
NÄR VI GRUNDADES
Error executing template "/Designs/Swift/Grid/Page/RowTemplates/1Column.cshtml" System.NullReferenceException: Object reference not set to an instance of an object. at CompiledRazorTemplates.Dynamic.RazorEngine_91d869af04d44660aa1e198e68339761.Execute() in D:\dynamicweb.net\Solutions\Dynamicweb\HCTswift.staging.dynamicweb-cms.com\files\Templates\Designs\Swift\Grid\Page\RowTemplates\1Column.cshtml:line 129 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 3 @{ 4 string sectionClass = "py-3"; 5 string spaceBetweenRows = Model.Item.GetRawValueString("SpaceBetweenRows", "spacing"); 6 string spaceBetweenRowsMobile = Model.Item.GetRawValueString("SpaceBetweenRowsMobile", "auto"); 7 8 //Row spacing mobile auto 9 if (spaceBetweenRowsMobile == "auto") { 10 spaceBetweenRowsMobile = spaceBetweenRows; 11 } 12 13 //Row spacing mobile 14 switch (spaceBetweenRowsMobile) { 15 case "none": //No spacing 16 sectionClass = "py-0"; 17 break; 18 case "spacing": //Small spacing top and bottom 19 sectionClass = "py-3"; 20 break; 21 case "spacing-small-top": //Small spacing top 22 sectionClass = "pt-3"; 23 break; 24 case "spacing-small-bottom": //Small spacing bottom 25 sectionClass = "pb-3"; 26 break; 27 case "spacing-medium": //Medium spacing top and bottom 28 sectionClass = "py-4"; 29 break; 30 case "spacing-medium-top": //Medium spacing top 31 sectionClass = "pt-4"; 32 break; 33 case "spacing-medium-bottom": //Medium spacing bottom 34 sectionClass = "pb-4"; 35 break; 36 case "spacing-large": //Large spacing top and bottom 37 sectionClass = "py-5"; 38 break; 39 case "spacing-top": //Large spacing top 40 sectionClass = "pt-5"; 41 break; 42 case "spacing-bottom": //Large spacing bottom 43 sectionClass = "pb-5"; 44 break; 45 } 46 47 //Row spacing dekstop 48 switch (spaceBetweenRows) { 49 case "none": //No spacing 50 sectionClass += " py-lg-0"; 51 break; 52 case "spacing": //Small spacing top and bottom 53 sectionClass += " py-lg-3"; 54 break; 55 case "spacing-small-top": //Small spacing top 56 sectionClass += " pt-lg-3 pb-lg-0"; 57 break; 58 case "spacing-small-bottom": //Small spacing bottom 59 sectionClass += " pb-lg-3 pt-lg-0"; 60 break; 61 case "spacing-medium": //Medium spacing top and bottom 62 sectionClass += " py-lg-5"; 63 break; 64 case "spacing-medium-top": //Medium spacing top 65 sectionClass += " pt-lg-5 pb-lg-0"; 66 break; 67 case "spacing-medium-bottom": //Medium spacing bottom 68 sectionClass += " pb-lg-5 pt-lg-0"; 69 break; 70 case "spacing-large": //Large spacing top and bottom 71 sectionClass += " py-lg-6"; 72 break; 73 case "spacing-top": //Large spacing top 74 sectionClass += " pt-lg-6 pb-lg-0"; 75 break; 76 case "spacing-bottom": //Large spacing bottom 77 sectionClass += " pb-lg-6 pt-lg-0"; 78 break; 79 } 80 81 string width = Model.Item.GetRawValueString("Width"); 82 string containerClass = "container-xl"; 83 if (width == "stretch") 84 { 85 containerClass = "container-fluid"; 86 } 87 if (width == "none") 88 { 89 containerClass = "container-fluid px-0"; 90 } 91 if (width == "compressed") 92 { 93 containerClass = " container-compressed"; 94 } 95 96 string theme = !string.IsNullOrWhiteSpace(Model.Item.GetRawValueString("Theme")) ? " theme " + Model.Item.GetRawValueString("Theme").Replace(" ", "").Trim().ToLower() : ""; 97 98 string animationOnScrollCol1 = Model.Item.GetRawValueString("AnimationOnScroll", "no-animation"); 99 animationOnScrollCol1 = animationOnScrollCol1 != "no-animation" ? "data-aos=" + "'" + animationOnScrollCol1 + "'" : ""; 100 101 string hideOverflow = " overflow-hidden"; 102 hideOverflow = animationOnScrollCol1 != "" ? hideOverflow : ""; 103 104 Dynamicweb.Frontend.FileViewModel backgroundImage = Model.Item.GetFile("BackgroundImage"); 105 string backgroundImagePath = backgroundImage?.Path ?? string.Empty; 106 backgroundImagePath = !string.IsNullOrEmpty(backgroundImagePath) ? $"/Admin/Public/GetImage.ashx?image={backgroundImagePath}&width=2600&format=webp&compression=75" : string.Empty; 107 backgroundImagePath = Dynamicweb.Core.Encoders.HtmlEncoder.UrlPathEncode(backgroundImagePath); 108 string backgroundRepeat = Model.Item.GetRawValueString("BackgroundImageRepeat", "no-repeat"); 109 string backgroundImageSize = Model.Item.GetRawValueString("BackgroundImageSize", "initial"); 110 int xPos = backgroundImage?.FocalPositionFromLeft ?? 50; 111 int yPos = backgroundImage?.FocalPositionFromTop ?? 50; 112 string cssPosition = $"{xPos}% {yPos}%"; 113 string gradient = Model.Item.GetRawValueString("Gradient", string.Empty); 114 string gradientOpacity = Model.Item.GetRawValueString("GradientOpacity", "0.00"); 115 string gradientString = "linear-gradient(" + gradient + "deg," + "rgba(var(--swift-foreground-color-rgb)," + gradientOpacity + "), rgba(var(--swift-background-color-rgb)," + gradientOpacity + "))"; 116 string backgroundImageString = "url(" + backgroundImagePath + ")"; 117 string backgroundImagePositionString = "background-position:" + cssPosition + ";"; 118 string backgroundRepeatString = "background-repeat:" + backgroundRepeat + ";"; 119 string backgroundImageSizeString = "background-size:" + backgroundImageSize + ";"; 120 string styleString = string.Empty; 121 122 var decorations = Model.Item?.GetList("CssDecorations")?.GetRawValue().OfType<string>() ?? Enumerable.Empty<string>(); 123 var css = string.Empty; 124 var cssClasses = new List<string> { }; 125 126 foreach (var itemId in decorations) 127 { 128 var item = Dynamicweb.Content.Services.Items.GetItem("Swift_Css", itemId); 129 item.TryGetValue("Class", out object classes); 130 if (classes is null) 131 { 132 continue; 133 } 134 135 var cssString = (string)classes; 136 if (cssString.StartsWith("[")) 137 { 138 var cssArray = Dynamicweb.Core.Converter.Deserialize<string[]>(cssString); 139 cssClasses.AddRange(cssArray); 140 } 141 else 142 { 143 cssClasses.Add(cssString.Replace(",", " ")); 144 } 145 } 146 css = string.Join(" ", cssClasses).Trim(); 147 148 @* Only gradient *@ 149 150 if (!string.IsNullOrEmpty(gradient) && string.IsNullOrEmpty(backgroundImagePath) && gradientOpacity != ("0.00")) 151 { 152 styleString += "style=\"background-image:" + gradientString + ";\""; 153 } 154 155 @* Only background image *@ 156 157 else if (string.IsNullOrEmpty(gradient) && !string.IsNullOrEmpty(backgroundImagePath)) 158 { 159 styleString += "style=\"background-image:" + backgroundImageString + "; " + backgroundImagePositionString + backgroundRepeatString + backgroundImageSizeString + "\""; 160 } 161 162 @* Gradient and background image *@ 163 164 else if (!string.IsNullOrEmpty(gradient) && !string.IsNullOrEmpty(backgroundImagePath)) 165 { 166 styleString += "style=\"background-image:" + gradientString + "," + backgroundImageString + ";" + backgroundImagePositionString + backgroundRepeatString + backgroundImageSizeString + "\""; 167 } 168 169 if (Pageview.IsVisualEditorMode || !string.IsNullOrWhiteSpace(Model.Column(1).Output())) 170 { 171 <div class="@(sectionClass)@(theme) @(css) item_@Model.Item.SystemName.ToLower()" @styleString data-swift-gridrow> 172 <div class="@containerClass@(hideOverflow)"> 173 <div class="grid grid-1"> 174 <div class="g-col" data-col-size="12" @animationOnScrollCol1 style="--bs-columns:12"> 175 @Model.Column(1).Output() 176 </div> 177 </div> 178 </div> 179 </div> 180 } 181 } 182
Upptäck våra nya produkte: Förbättra din proccess med de senaste innovationerna.
Vi är glada att kunna presentera våra exklusiva erbjudanden för November från Mouldshop!
Upptäck framtidens online-shopping med vår nylanserade webbshopsplattfor.