LOCATION & DIRECTIONS

2002-Q Orville Drive North Ronkonkoma, NY 11779

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_fca5450fb93345dc8dafcaf4987c2521.Execute() in G:\Domains\Sites\uat-qmx.mydwsite5.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
Error executing template "/Designs/Swift/Grid/Page/RowTemplates/3Columns.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_07ddd0da859d4eb2950273c489489790.Execute() in G:\Domains\Sites\uat-qmx.mydwsite5.com\Files\Templates\Designs\Swift\Grid\Page\RowTemplates\3Columns.cshtml:line 168
   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-3"; 6 string spaceBetweenRows = Model.Item.GetRawValueString("SpaceBetweenRows", "spacing"); 7 string spaceBetweenRowsMobile = Model.Item.GetRawValueString("SpaceBetweenRowsMobile", "auto"); 8 9 //Row spacing mobile auto 10 if (spaceBetweenRowsMobile == "auto") { 11 spaceBetweenRowsMobile = spaceBetweenRows; 12 } 13 14 //Row spacing mobile 15 switch (spaceBetweenRowsMobile) { 16 case "none": //No spacing 17 sectionClass = "py-0"; 18 break; 19 case "spacing": //Small spacing top and bottom 20 sectionClass = "py-3"; 21 break; 22 case "spacing-small-top": //Small spacing top 23 sectionClass = "pt-3"; 24 break; 25 case "spacing-small-bottom": //Small spacing bottom 26 sectionClass = "pb-3"; 27 break; 28 case "spacing-medium": //Medium spacing top and bottom 29 sectionClass = "py-4"; 30 break; 31 case "spacing-medium-top": //Medium spacing top 32 sectionClass = "pt-4"; 33 break; 34 case "spacing-medium-bottom": //Medium spacing bottom 35 sectionClass = "pb-4"; 36 break; 37 case "spacing-large": //Large spacing top and bottom 38 sectionClass = "py-5"; 39 break; 40 case "spacing-top": //Large spacing top 41 sectionClass = "pt-5"; 42 break; 43 case "spacing-bottom": //Large spacing bottom 44 sectionClass = "pb-5"; 45 break; 46 } 47 48 //Row spacing dekstop 49 switch (spaceBetweenRows) { 50 case "none": //No spacing 51 sectionClass += " py-lg-0"; 52 break; 53 case "spacing": //Small spacing top and bottom 54 sectionClass += " py-lg-3"; 55 break; 56 case "spacing-small-top": //Small spacing top 57 sectionClass += " pt-lg-3 pb-lg-0"; 58 break; 59 case "spacing-small-bottom": //Small spacing bottom 60 sectionClass += " pb-lg-3 pt-lg-0"; 61 break; 62 case "spacing-medium": //Medium spacing top and bottom 63 sectionClass += " py-lg-5"; 64 break; 65 case "spacing-medium-top": //Medium spacing top 66 sectionClass += " pt-lg-5 pb-lg-0"; 67 break; 68 case "spacing-medium-bottom": //Medium spacing bottom 69 sectionClass += " pb-lg-5 pt-lg-0"; 70 break; 71 case "spacing-large": //Large spacing top and bottom 72 sectionClass += " py-lg-6"; 73 break; 74 case "spacing-top": //Large spacing top 75 sectionClass += " pt-lg-6 pb-lg-0"; 76 break; 77 case "spacing-bottom": //Large spacing bottom 78 sectionClass += " pb-lg-6 pt-lg-0"; 79 break; 80 } 81 82 string width = Model.Item.GetRawValueString("Width", "").ToLower(); 83 string containerClass = "container-xl"; 84 if (width == "stretch") 85 { 86 containerClass = "container-fluid"; 87 } 88 if (width == "none") 89 { 90 containerClass = "container-fluid px-0"; 91 } 92 if (width == "compressed") 93 { 94 containerClass = " container-compressed"; 95 } 96 97 string rowClass = string.Empty; 98 string spaceBetweenColumns = Model.Item.GetRawValueString("SpaceBetweenColumns", string.Empty).ToLower(); 99 string spaceBetweenColumnsMobile = Model.Item.GetRawValueString("SpaceBetweenColumnsMobile", string.Empty).ToLower(); 100 //Mobile 101 if (spaceBetweenColumnsMobile == "auto") 102 { 103 spaceBetweenColumnsMobile = spaceBetweenColumns; 104 } 105 if (spaceBetweenColumnsMobile == "stick") { 106 rowClass = " gap-0"; 107 } 108 if (spaceBetweenColumnsMobile == "spacing-medium") 109 { 110 rowClass = " gap-4"; 111 } 112 if (spaceBetweenColumnsMobile == "spacing-large") { 113 rowClass = " gap-5"; 114 } 115 //Desktop 116 if (spaceBetweenColumns == "stick") { 117 rowClass += " gap-lg-0"; 118 } 119 if (spaceBetweenColumns == "spacing-medium") 120 { 121 rowClass += " gap-lg-4"; 122 } 123 if (spaceBetweenColumns == "spacing-large") { 124 rowClass += " gap-lg-5"; 125 } 126 127 string theme = !string.IsNullOrWhiteSpace(Model.Item.GetRawValueString("Theme")) ? " theme " + Model.Item.GetRawValueString("Theme").Replace(" ", "").Trim().ToLower() : ""; 128 129 string animationOnScrollCol1 = Model.Item.GetRawValueString("AnimationOnScrollCol1", "no-animation"); 130 animationOnScrollCol1 = animationOnScrollCol1 != "no-animation" ? "data-aos=" + "'" + animationOnScrollCol1 + "'" : ""; 131 string animationOnScrollCol2 = Model.Item.GetRawValueString("AnimationOnScrollCol2", "no-animation"); 132 animationOnScrollCol2 = animationOnScrollCol2 != "no-animation" ? "data-aos=" + "'" + animationOnScrollCol2 + "'" : ""; 133 string animationOnScrollCol3 = Model.Item.GetRawValueString("AnimationOnScrollCol3", "no-animation"); 134 animationOnScrollCol3 = animationOnScrollCol3 != "no-animation" ? "data-aos=" + "'" + animationOnScrollCol3 + "'" : ""; 135 136 string hideOverflow = " overflow-hidden"; 137 hideOverflow = 138 animationOnScrollCol1 != "" || 139 animationOnScrollCol2 != "" || 140 animationOnScrollCol3 != "" 141 ? hideOverflow : ""; 142 143 Dynamicweb.Frontend.FileViewModel backgroundImage = Model.Item.GetFile("BackgroundImage"); 144 string backgroundImagePath = backgroundImage?.Path ?? string.Empty; 145 backgroundImagePath = !string.IsNullOrEmpty(backgroundImagePath) ? $"/Admin/Public/GetImage.ashx?image={backgroundImagePath}&width=2600&format=webp&compression=75" : string.Empty; 146 backgroundImagePath = Dynamicweb.Core.Encoders.HtmlEncoder.UrlPathEncode(backgroundImagePath); 147 string backgroundRepeat = Model.Item.GetRawValueString("BackgroundImageRepeat", "no-repeat"); 148 string backgroundImageSize = Model.Item.GetRawValueString("BackgroundImageSize", "initial"); 149 int xPos = backgroundImage?.FocalPositionFromLeft ?? 50; 150 int yPos = backgroundImage?.FocalPositionFromTop ?? 50; 151 string cssPosition = $"{xPos}% {yPos}%"; 152 string gradient = Model.Item.GetRawValueString("Gradient", string.Empty); 153 string gradientOpacity = Model.Item.GetRawValueString("GradientOpacity", "0.00"); 154 string gradientString = "linear-gradient(" + gradient + "deg," + "rgba(var(--swift-foreground-color-rgb)," + gradientOpacity + "), rgba(var(--swift-background-color-rgb)," + gradientOpacity + "))"; 155 string backgroundImageString = "url(" + backgroundImagePath + ")"; 156 string backgroundImagePositionString = "background-position:" + cssPosition + ";"; 157 string backgroundRepeatString = "background-repeat:" + backgroundRepeat + ";"; 158 string backgroundImageSizeString = "background-size:" + backgroundImageSize + ";"; 159 string styleString = string.Empty; 160 161 var decorations = Model.Item?.GetList("CssDecorations")?.GetRawValue().OfType<string>() ?? Enumerable.Empty<string>(); 162 var css = string.Empty; 163 var cssClasses = new List<string> { }; 164 165 foreach (var itemId in decorations) 166 { 167 var item = Dynamicweb.Content.Services.Items.GetItem("Swift_Css", itemId); 168 item.TryGetValue("Class", out object classes); 169 if (classes is null) 170 { 171 continue; 172 } 173 174 var cssString = (string)classes; 175 if (cssString.StartsWith("[")) 176 { 177 var cssArray = Dynamicweb.Core.Converter.Deserialize<string[]>(cssString); 178 cssClasses.AddRange(cssArray); 179 } 180 else 181 { 182 cssClasses.Add(cssString.Replace(",", " ")); 183 } 184 } 185 css = string.Join(" ", cssClasses).Trim(); 186 187 @* Only gradient *@ 188 189 if (!string.IsNullOrEmpty(gradient) && string.IsNullOrEmpty(backgroundImagePath) && gradientOpacity != ("0.00")) 190 { 191 styleString += "style=\"background-image:" + gradientString + ";\""; 192 } 193 194 @* Only background image *@ 195 196 else if (string.IsNullOrEmpty(gradient) && !string.IsNullOrEmpty(backgroundImagePath)) 197 { 198 styleString += "style=\"background-image:" + backgroundImageString + "; " + backgroundImagePositionString + backgroundRepeatString + backgroundImageSizeString + "\""; 199 } 200 201 @* Gradient and background image *@ 202 203 else if (!string.IsNullOrEmpty(gradient) && !string.IsNullOrEmpty(backgroundImagePath)) 204 { 205 styleString += "style=\"background-image:" + gradientString + "," + backgroundImageString + ";" + backgroundImagePositionString + backgroundRepeatString + backgroundImageSizeString + "\""; 206 } 207 208 int mobileColumnSize = Dynamicweb.Core.Converter.ToInt32(Model.Item.GetRawValueString("MobileColumnBehaviour", "1")); 209 int mobileOrderFirst = Dynamicweb.Core.Converter.ToInt32(Model.Item.GetRawValueString("MobileOrderFirst", "1")); 210 211 if (Pageview.IsVisualEditorMode || !string.IsNullOrWhiteSpace(Model.Column(1).Output()) || !string.IsNullOrWhiteSpace(Model.Column(2).Output()) || !string.IsNullOrWhiteSpace(Model.Column(3).Output())) 212 { 213 <div class="@(sectionClass)@(theme) @(css) item_@Model.Item.SystemName.ToLower()" @styleString data-swift-gridrow> 214 <div class="@containerClass@(hideOverflow)"> 215 <div class="grid grid-@(mobileColumnSize) grid-lg-@Model.Columns.Count()@(rowClass)"> 216 <div class="g-col @(Model.Column(1).ColumnNumber == mobileOrderFirst ? "order-first order-lg-0" : string.Empty)" data-col-size="4" @animationOnScrollCol1 style="--bs-columns:12"> 217 @Model.Column(1).Output() 218 </div> 219 <div class="g-col @(Model.Column(2).ColumnNumber == mobileOrderFirst ? "order-first order-lg-0" : string.Empty)" data-col-size="4" @animationOnScrollCol2 style="--bs-columns:12"> 220 @Model.Column(2).Output() 221 </div> 222 <div class="g-col @(Model.Column(3).ColumnNumber == mobileOrderFirst ? "order-first order-lg-0" : string.Empty)" data-col-size="4" @animationOnScrollCol3 style="--bs-columns:12"> 223 @Model.Column(3).Output() 224 </div> 225 </div> 226 </div> 227 </div> 228 } 229 } 230
By clicking 'Accept All' you consent that we may collect information about you for various purposes, including: Statistics and Marketing