CAREERS

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/Paragraph/Swift_TextAdvanced.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_66b0f3e7120d4388b72c8017b5fd214b.RenderCustomCSS(IEnumerable`1 decorations) in G:\Domains\Sites\uat-qmx.mydwsite5.com\Files\Templates\Designs\Swift\Paragraph\Swift_TextAdvanced.cshtml:line 28
   at CompiledRazorTemplates.Dynamic.RazorEngine_66b0f3e7120d4388b72c8017b5fd214b.Execute() in G:\Domains\Sites\uat-qmx.mydwsite5.com\Files\Templates\Designs\Swift\Paragraph\Swift_TextAdvanced.cshtml:line 56
   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.ParagraphViewModel> 2 3 @functions 4 { 5 private string RenderContent(string content, string heading, string fontSize, string color, string opacity, string margin, string marginMobile, string cssClass) 6 { 7 var classes = new List<string> { }; 8 if (!string.IsNullOrEmpty(fontSize)) { classes.Add(fontSize); } 9 if (!string.IsNullOrEmpty(color)) { classes.Add(color); } 10 if (!string.IsNullOrEmpty(opacity)) { classes.Add(opacity); } 11 if (!string.IsNullOrEmpty(margin)) { classes.Add(margin); } 12 if (!string.IsNullOrEmpty(marginMobile)) { classes.Add(marginMobile); } 13 if (!string.IsNullOrEmpty(cssClass)) { classes.Add(cssClass); } 14 15 var tagStart = $"<{heading} class=\"{string.Join(" ", classes)}\">"; 16 var tagEnd = $"</{heading}>"; 17 18 return tagStart + content + tagEnd; 19 } 20 21 string RenderCustomCSS(IEnumerable<string> decorations) 22 { 23 var cssClasses = new List<string>(); 24 25 foreach (var itemId in decorations) 26 { 27 var item = Dynamicweb.Content.Services.Items.GetItem("Swift_Css", itemId); 28 item.TryGetValue("Class", out object classes); 29 30 if (classes is null) 31 { 32 continue; 33 } 34 35 var cssString = (string)classes; 36 37 if (cssString.StartsWith("[")) 38 { 39 var cssArray = Dynamicweb.Core.Converter.Deserialize<string[]>(cssString); 40 cssClasses.AddRange(cssArray); 41 } 42 else 43 { 44 cssClasses.Add(cssString.Replace(",", " ")); 45 } 46 } 47 48 return string.Join(" ", cssClasses).Trim(); 49 } 50 } 51 52 @{ 53 54 string theme = !string.IsNullOrWhiteSpace(Model.Item.GetRawValueString("Theme")) ? $" theme {Model.Item.GetRawValueString("Theme").Replace(" ", "").Trim().ToLower()}" : ""; 55 var decorations = Model.Item?.GetList("CssDecorations")?.GetRawValue().OfType<string>() ?? Enumerable.Empty<string>(); 56 string css = RenderCustomCSS(decorations); 57 58 string eyebrow = Model.Item.GetString("Eyebrow", string.Empty).Replace(System.Environment.NewLine, "<br>"); 59 string eyebrowHeadingLevel = Model.Item.GetString("EyebrowHeadingLevel", "h3"); 60 string eyebrowFontSize = Model.Item.GetRawValueString("EyebrowFontSize", "h5"); 61 string eyebrowColor = Model.Item.GetString("EyebrowColor", "text-inherit"); 62 string eyebrowTextOpacity = Model.Item.GetString("EyebrowTextOpacity", "opacity-100"); 63 string eyebrowCssClass = Model.Item.GetString("EyebrowCssClass", string.Empty); 64 string eyebrowSpacingBottomDesktop = Model.Item.GetRawValueString("EyebrowSpacingBottomDesktop", "default"); 65 eyebrowSpacingBottomDesktop = eyebrowSpacingBottomDesktop != "default" ? eyebrowSpacingBottomDesktop : string.Empty; 66 string eyebrowSpacingBottomMobile = Model.Item.GetRawValueString("EyebrowSpacingBottomMobile", "default"); 67 eyebrowSpacingBottomMobile = eyebrowSpacingBottomMobile != "default" ? eyebrowSpacingBottomMobile : string.Empty; 68 69 string title = Model.Item.GetString("Title", string.Empty).Replace(System.Environment.NewLine, "<br>"); 70 string titleHeadingLevel = Model.Item.GetString("TitleHeadingLevel", "h2"); 71 string titleFontSize = Model.Item.GetRawValueString("TitleFontSize", "h2"); 72 string titleColor = Model.Item.GetString("TitleColor", "text-inherit"); 73 string titleTextOpacity = Model.Item.GetString("TitleTextOpacity", "opacity-100"); 74 string titleCssClass = Model.Item.GetString("TitleCssClass", string.Empty); 75 string titleSpacingBottomDesktop = Model.Item.GetRawValueString("TitleSpacingBottomDesktop", "default"); 76 titleSpacingBottomDesktop = titleSpacingBottomDesktop != "default" ? titleSpacingBottomDesktop : string.Empty; 77 string titleSpacingBottomMobile = Model.Item.GetRawValueString("TitleSpacingBottomMobile", "default"); 78 titleSpacingBottomMobile = titleSpacingBottomMobile != "default" ? titleSpacingBottomMobile : string.Empty; 79 80 string subtitle = Model.Item.GetString("Subtitle", string.Empty).Replace(System.Environment.NewLine, "<br>"); 81 string subtitleHeadingLevel = Model.Item.GetString("SubtitleHeadingLevel", "p"); 82 string subtitleFontSize = Model.Item.GetRawValueString("SubtitleFontSize", "fs-5"); 83 string subtitleColor = Model.Item.GetString("SubtitleColor", "text-inherit"); 84 string subtitleTextOpacity = Model.Item.GetString("SubtitleTextOpacity", "opacity-100"); 85 string subtitleCssClass = Model.Item.GetString("SubtitleCssClass", string.Empty); 86 string subtitleSpacingBottomDesktop = Model.Item.GetRawValueString("SubtitleSpacingBottomDesktop", "default"); 87 subtitleSpacingBottomDesktop = subtitleSpacingBottomDesktop != "default" ? subtitleSpacingBottomDesktop : string.Empty; 88 string subtitleSpacingBottomMobile = Model.Item.GetRawValueString("SubtitleSpacingBottomMobile", "default"); 89 subtitleSpacingBottomMobile = subtitleSpacingBottomMobile != "default" ? subtitleSpacingBottomMobile : string.Empty; 90 91 string text = Model.Item.GetString("Text", string.Empty); 92 string textFontSize = Model.Item.GetRawValueString("TextFontSize", "fs-6"); 93 string textColor = Model.Item.GetString("TextColor", "text-inherit"); 94 string TextOpacity = Model.Item.GetString("TextOpacity", "opacity-100"); 95 string textCssClass = Model.Item.GetString("TextCssClass", string.Empty); 96 string textSpacingBottomDesktop = Model.Item.GetRawValueString("TextSpacingBottomDesktop", "mb-lg-4"); 97 textSpacingBottomDesktop = textSpacingBottomDesktop != "default" ? textSpacingBottomDesktop : string.Empty; 98 string textSpacingBottomMobile = Model.Item.GetRawValueString("TextSpacingBottomMobile", "mb-3"); 99 textSpacingBottomMobile = textSpacingBottomMobile != "default" ? textSpacingBottomMobile : string.Empty; 100 101 string contentAlignment = Model.Item.GetRawValueString("ContentAlignment", "align-items-center justify-content-center"); 102 string contentTextAlignment = Model.Item.GetRawValueString("ContentTextAlignment", "text-start"); 103 string contentSpacingStartDesktop = Model.Item.GetRawValueString("ContentSpacingStartDesktop", "default"); 104 contentSpacingStartDesktop = contentSpacingStartDesktop != "default" ? contentSpacingStartDesktop : string.Empty; 105 string contentSpacingStartMobile = Model.Item.GetRawValueString("ContentSpacingStartMobile", "default"); 106 contentSpacingStartMobile = contentSpacingStartMobile != "default" ? contentSpacingStartMobile : string.Empty; 107 string contentSpacingEndDesktop = Model.Item.GetRawValueString("ContentSpacingEndDesktop", "default"); 108 contentSpacingEndDesktop = contentSpacingEndDesktop != "default" ? contentSpacingEndDesktop : string.Empty; 109 string contentSpacingEndMobile = Model.Item.GetRawValueString("ContentSpacingEndMobile", "default"); 110 contentSpacingEndMobile = contentSpacingEndMobile != "default" ? contentSpacingEndMobile : string.Empty; 111 string contentSpacingTopDesktop = Model.Item.GetRawValueString("ContentSpacingTopDesktop", "default"); 112 contentSpacingTopDesktop = contentSpacingTopDesktop != "default" ? contentSpacingTopDesktop : string.Empty; 113 string contentSpacingTopMobile = Model.Item.GetRawValueString("ContentSpacingTopMobile", "default"); 114 contentSpacingTopMobile = contentSpacingTopMobile != "default" ? contentSpacingTopMobile : string.Empty; 115 string contentSpacingBottomDesktop = Model.Item.GetRawValueString("ContentSpacingBottomDesktop", "default"); 116 contentSpacingBottomDesktop = contentSpacingBottomDesktop != "default" ? contentSpacingBottomDesktop : string.Empty; 117 string contentSpacingBottomMobile = Model.Item.GetRawValueString("ContentSpacingBottomMobile", "default"); 118 contentSpacingBottomMobile = contentSpacingBottomMobile != "default" ? contentSpacingBottomMobile : string.Empty; 119 string contentCssClass = Model.Item.GetString("ContentCssClass", string.Empty); 120 121 var contentClasses = new List<string> { }; 122 if (contentSpacingStartDesktop != "default") { contentClasses.Add(contentSpacingStartDesktop.Trim()); } 123 if (contentSpacingStartMobile != "default") { contentClasses.Add(contentSpacingStartMobile.Trim()); } 124 if (contentSpacingEndDesktop != "default") { contentClasses.Add(contentSpacingEndDesktop.Trim()); } 125 if (contentSpacingEndMobile != "default") { contentClasses.Add(contentSpacingEndMobile.Trim()); } 126 if (contentSpacingTopDesktop != "default") { contentClasses.Add(contentSpacingTopDesktop.Trim()); } 127 if (contentSpacingTopMobile != "default") { contentClasses.Add(contentSpacingTopMobile.Trim()); } 128 if (contentSpacingBottomDesktop != "default") { contentClasses.Add(contentSpacingBottomDesktop.Trim()); } 129 if (contentSpacingBottomMobile != "default") { contentClasses.Add(contentSpacingBottomMobile.Trim()); } 130 if (!string.IsNullOrEmpty(contentCssClass)) { contentClasses.Add(contentCssClass); } 131 132 //Button 1 133 var button1Link = Model.Item.GetLink("Button1Link"); 134 var button1Label = Model.Item.GetString("Button1Label", string.Empty); 135 var button1Icon = Model.Item.GetRawValueString("Button1Icon"); 136 var button1IconPosition = Model.Item.GetRawValueString("Button1IconPosition", "right"); 137 var button1Style = Model.Item.GetRawValueString("Button1Style", "btn-primary"); 138 139 //Button 2 140 var button2Link = Model.Item.GetLink("Button2Link"); 141 var button2Label = Model.Item.GetString("Button2Label", string.Empty); 142 var button2Icon = Model.Item.GetRawValueString("Button2Icon"); 143 var button2IconPosition = Model.Item.GetRawValueString("Button2IconPosition", "right"); 144 var button2Style = Model.Item.GetRawValueString("Button2Style", "btn-primary"); 145 } 146 147 <div class="h-100 d-flex position-relative @(contentAlignment)@(theme) item_@Model.Item.SystemName.ToLower()"> 148 <div id="@Model.ID" class="user-select-none position-absolute top-0" style="scroll-margin-top: var(--header-height, 150px)"></div> 149 <div class="d-inline-flex flex-column @(contentTextAlignment) @(string.Join(" ",contentClasses).Trim()) @(css)"> 150 151 @if (!string.IsNullOrEmpty(eyebrow)) 152 { 153 @RenderContent(eyebrow, eyebrowHeadingLevel, eyebrowFontSize, eyebrowColor, eyebrowTextOpacity, eyebrowSpacingBottomDesktop, eyebrowSpacingBottomMobile, eyebrowCssClass) 154 } 155 156 @if (!string.IsNullOrEmpty(title)) 157 { 158 @RenderContent(title, titleHeadingLevel, titleFontSize, titleColor, titleTextOpacity, titleSpacingBottomDesktop, titleSpacingBottomMobile, titleCssClass) 159 } 160 161 @if (!string.IsNullOrEmpty(subtitle)) 162 { 163 @RenderContent(subtitle, subtitleHeadingLevel, subtitleFontSize, subtitleColor, subtitleTextOpacity, subtitleSpacingBottomDesktop, subtitleSpacingBottomMobile, subtitleCssClass) 164 } 165 166 @if (!string.IsNullOrEmpty(text)) 167 { 168 @RenderContent(text, "div", textFontSize, textColor, TextOpacity, textSpacingBottomDesktop, textSpacingBottomMobile, $"mb-0-last-child {textCssClass}") 169 } 170 171 @if (button1Link is object || button2Link is object) 172 { 173 if (contentTextAlignment == "text-start") 174 { 175 contentAlignment = "justify-content-start"; 176 } 177 if (contentTextAlignment == "text-center") 178 { 179 contentAlignment = "justify-content-center"; 180 } 181 if (contentTextAlignment == "text-end") 182 { 183 contentAlignment = "justify-content-end"; 184 } 185 186 <div class="d-flex flex-wrap @(contentAlignment) gap-3"> 187 @if (button1Link is object && !string.IsNullOrEmpty(button1Label)) 188 { 189 string target = Pageview.AreaSettings.GetBoolean("OpenLinksInNewTab") && button1Link.IsExternal ? "target=\"_blank\"" : string.Empty; 190 string rel = Pageview.AreaSettings.GetBoolean("OpenLinksInNewTab") && button1Link.IsExternal ? "rel=\"noopener\"" : string.Empty; 191 192 <a href="@button1Link.Url" @target @rel class="btn @(button1Style)"> 193 @if (button1Icon is object) 194 { 195 <span class="d-flex align-items-center gap-1 @(button1IconPosition)"> 196 @button1Label 197 @if (System.IO.Path.GetExtension(button1Icon).ToLower() == ".svg") 198 { 199 if (!button1Icon.ToLower().Contains("none") && button1Icon != string.Empty) 200 { 201 <span class="icon-auto"> 202 @ReadFile(button1Icon) 203 </span> 204 } 205 } 206 </span> 207 } 208 else 209 { 210 @button1Label 211 } 212 </a> 213 } 214 215 @if (button2Link is object && !string.IsNullOrEmpty(button1Label)) 216 { 217 string target = Pageview.AreaSettings.GetBoolean("OpenLinksInNewTab") && button2Link.IsExternal ? "target=\"_blank\"" : string.Empty; 218 string rel = Pageview.AreaSettings.GetBoolean("OpenLinksInNewTab") && button2Link.IsExternal ? "rel=\"noopener\"" : string.Empty; 219 220 <a href="@button2Link.Url" @target @rel class="btn @(button2Style)"> 221 @if (button2Icon is object) 222 { 223 <span class="d-flex align-items-center gap-1 @(button2IconPosition)"> 224 @button2Label 225 @if (System.IO.Path.GetExtension(button2Icon).ToLower() == ".svg") 226 { 227 if (!button2Icon.ToLower().Contains("none") && button2Icon != string.Empty) 228 { 229 <span class="icon-auto"> 230 @ReadFile(button2Icon) 231 </span> 232 } 233 } 234 </span> 235 } 236 else 237 { 238 @button2Label 239 } 240 </a> 241 } 242 </div> 243 } 244 @if (!string.IsNullOrEmpty(Model.ModuleSystemName)) 245 { 246 <div class="item_@Model.Item.SystemName.ToLower() @textSpacingBottomDesktop @textSpacingBottomMobile mb-0-last-child mt-3"> 247 @Model.GetModuleOutput() 248 </div> 249 } 250 </div> 251 </div> 252

Qosina is a family-owned and operated, leading global supplier of OEM medical device components to the medical and pharmaceutical industries. We are based in Suffolk County, NY, with a European office in Milan, Italy. Within Qosina is our Qosmedix division, a global, full-service provider of wholesale beauty supplies for the cosmetic, skin care and fragrance industries.

Mission Statement

Error executing template "/Designs/Swift/Grid/Page/RowTemplates/2Columns.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_ad0337abc13d4c52abcde86581839961.Execute() in G:\Domains\Sites\uat-qmx.mydwsite5.com\Files\Templates\Designs\Swift\Grid\Page\RowTemplates\2Columns.cshtml:line 162
   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 containerClass = "container-xl"; 82 string width = Model.Item.GetRawValueString("Width", "container-xl"); 83 if (width == "none") 84 { 85 containerClass = "container-fluid px-0"; 86 } 87 if (width == "stretch") { 88 containerClass = "container-fluid"; 89 } 90 if (width == "compressed") { 91 containerClass = " container-compressed"; 92 } 93 94 string rowClass = string.Empty; 95 string spaceBetweenColumns = Model.Item.GetRawValueString("SpaceBetweenColumns", string.Empty).ToLower(); 96 string spaceBetweenColumnsMobile = Model.Item.GetRawValueString("SpaceBetweenColumnsMobile", string.Empty).ToLower(); 97 //Mobile 98 if (spaceBetweenColumnsMobile == "auto") 99 { 100 spaceBetweenColumnsMobile = spaceBetweenColumns; 101 } 102 if (spaceBetweenColumnsMobile == "stick") { 103 rowClass = " gap-0"; 104 } 105 if (spaceBetweenColumnsMobile == "spacing-medium") 106 { 107 rowClass = " gap-4"; 108 } 109 if (spaceBetweenColumnsMobile == "spacing-large") { 110 rowClass = " gap-5"; 111 } 112 //Desktop 113 if (spaceBetweenColumns == "stick") { 114 rowClass += " gap-lg-0"; 115 } 116 if (spaceBetweenColumns == "spacing-medium") 117 { 118 rowClass += " gap-lg-4"; 119 } 120 if (spaceBetweenColumns == "spacing-large") { 121 rowClass += " gap-lg-5"; 122 } 123 124 string theme = !string.IsNullOrWhiteSpace(Model.Item.GetRawValueString("Theme")) ? " theme " + Model.Item.GetRawValueString("Theme").Replace(" ", "").Trim().ToLower() : ""; 125 126 string animationOnScrollCol1 = Model.Item.GetRawValueString("AnimationOnScrollCol1", "no-animation"); 127 animationOnScrollCol1 = animationOnScrollCol1 != "no-animation" ? "data-aos=" + "'" + animationOnScrollCol1 + "'" : ""; 128 string animationOnScrollCol2 = Model.Item.GetRawValueString("AnimationOnScrollCol2", "no-animation"); 129 animationOnScrollCol2 = animationOnScrollCol2 != "no-animation" ? "data-aos=" + "'" + animationOnScrollCol2 + "'" : ""; 130 131 string hideOverflow = " overflow-hidden"; 132 hideOverflow = 133 animationOnScrollCol1 != "" || 134 animationOnScrollCol2 != "" 135 ? hideOverflow : ""; 136 137 Dynamicweb.Frontend.FileViewModel backgroundImage = Model.Item.GetFile("BackgroundImage"); 138 string backgroundImagePath = backgroundImage?.Path ?? string.Empty; 139 backgroundImagePath = !string.IsNullOrEmpty(backgroundImagePath) ? $"/Admin/Public/GetImage.ashx?image={backgroundImagePath}&width=2600&format=webp&compression=75" : string.Empty; 140 backgroundImagePath = Dynamicweb.Core.Encoders.HtmlEncoder.UrlPathEncode(backgroundImagePath); 141 string backgroundRepeat = Model.Item.GetRawValueString("BackgroundImageRepeat", "no-repeat"); 142 string backgroundImageSize = Model.Item.GetRawValueString("BackgroundImageSize", "initial"); 143 int xPos = backgroundImage?.FocalPositionFromLeft ?? 50; 144 int yPos = backgroundImage?.FocalPositionFromTop ?? 50; 145 string cssPosition = $"{xPos}% {yPos}%"; 146 string gradient = Model.Item.GetRawValueString("Gradient", string.Empty); 147 string gradientOpacity = Model.Item.GetRawValueString("GradientOpacity", "0.00"); 148 string gradientString = "linear-gradient(" + gradient + "deg," + "rgba(var(--swift-foreground-color-rgb)," + gradientOpacity + "), rgba(var(--swift-background-color-rgb)," + gradientOpacity + "))"; 149 string backgroundImageString = "url(" + backgroundImagePath + ")"; 150 string backgroundImagePositionString = "background-position:" + cssPosition + ";"; 151 string backgroundRepeatString = "background-repeat:" + backgroundRepeat + ";"; 152 string backgroundImageSizeString = "background-size:" + backgroundImageSize + ";"; 153 string styleString = string.Empty; 154 155 var decorations = Model.Item?.GetList("CssDecorations")?.GetRawValue().OfType<string>() ?? Enumerable.Empty<string>(); 156 var css = string.Empty; 157 var cssClasses = new List<string> { }; 158 159 foreach (var itemId in decorations) 160 { 161 var item = Dynamicweb.Content.Services.Items.GetItem("Swift_Css", itemId); 162 item.TryGetValue("Class", out object classes); 163 if (classes is null) 164 { 165 continue; 166 } 167 168 var cssString = (string)classes; 169 if (cssString.StartsWith("[")) 170 { 171 var cssArray = Dynamicweb.Core.Converter.Deserialize<string[]>(cssString); 172 cssClasses.AddRange(cssArray); 173 } 174 else 175 { 176 cssClasses.Add(cssString.Replace(",", " ")); 177 } 178 } 179 css = string.Join(" ", cssClasses).Trim(); 180 181 @* Only gradient *@ 182 183 if (!string.IsNullOrEmpty(gradient) && string.IsNullOrEmpty(backgroundImagePath) && gradientOpacity != ("0.00")) 184 { 185 styleString += "style=\"background-image:" + gradientString + ";\""; 186 } 187 188 @* Only background image *@ 189 190 else if (string.IsNullOrEmpty(gradient) && !string.IsNullOrEmpty(backgroundImagePath)) 191 { 192 styleString += "style=\"background-image:" + backgroundImageString + "; " + backgroundImagePositionString + backgroundRepeatString + backgroundImageSizeString + "\""; 193 } 194 195 @* Gradient and background image *@ 196 197 else if (!string.IsNullOrEmpty(gradient) && !string.IsNullOrEmpty(backgroundImagePath)) 198 { 199 styleString += "style=\"background-image:" + gradientString + "," + backgroundImageString + ";" + backgroundImagePositionString + backgroundRepeatString + backgroundImageSizeString + "\""; 200 } 201 202 int mobileColumnSize = Dynamicweb.Core.Converter.ToInt32(Model.Item.GetRawValueString("MobileColumnBehaviour", "1")); 203 int mobileOrderFirst = Dynamicweb.Core.Converter.ToInt32(Model.Item.GetRawValueString("MobileOrderFirst", "1")); 204 205 if (Pageview.IsVisualEditorMode || !string.IsNullOrWhiteSpace(Model.Column(1).Output()) || !string.IsNullOrWhiteSpace(Model.Column(2).Output())) 206 { 207 <div class="@(sectionClass)@(theme) @(css) item_@Model.Item.SystemName.ToLower()" @styleString data-swift-gridrow> 208 <div class="@containerClass@(hideOverflow)"> 209 <div class="grid grid-@(mobileColumnSize) grid-lg-@Model.Columns.Count()@(rowClass)"> 210 <div class="g-col @(Model.Column(1).ColumnNumber == mobileOrderFirst ? "order-first order-lg-0" : string.Empty)" data-col-size="6" @animationOnScrollCol1 style="--bs-columns:12"> 211 @Model.Column(1).Output() 212 </div> 213 <div class="g-col @(Model.Column(2).ColumnNumber == mobileOrderFirst ? "order-first order-lg-0" : string.Empty)" data-col-size="6" @animationOnScrollCol2 style="--bs-columns:12"> 214 @Model.Column(2).Output() 215 </div> 216 </div> 217 </div> 218 </div> 219 } 220 } 221
Error executing template "/Designs/Swift/Grid/Page/RowTemplates/2Columns.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_ad0337abc13d4c52abcde86581839961.Execute() in G:\Domains\Sites\uat-qmx.mydwsite5.com\Files\Templates\Designs\Swift\Grid\Page\RowTemplates\2Columns.cshtml:line 162
   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 containerClass = "container-xl"; 82 string width = Model.Item.GetRawValueString("Width", "container-xl"); 83 if (width == "none") 84 { 85 containerClass = "container-fluid px-0"; 86 } 87 if (width == "stretch") { 88 containerClass = "container-fluid"; 89 } 90 if (width == "compressed") { 91 containerClass = " container-compressed"; 92 } 93 94 string rowClass = string.Empty; 95 string spaceBetweenColumns = Model.Item.GetRawValueString("SpaceBetweenColumns", string.Empty).ToLower(); 96 string spaceBetweenColumnsMobile = Model.Item.GetRawValueString("SpaceBetweenColumnsMobile", string.Empty).ToLower(); 97 //Mobile 98 if (spaceBetweenColumnsMobile == "auto") 99 { 100 spaceBetweenColumnsMobile = spaceBetweenColumns; 101 } 102 if (spaceBetweenColumnsMobile == "stick") { 103 rowClass = " gap-0"; 104 } 105 if (spaceBetweenColumnsMobile == "spacing-medium") 106 { 107 rowClass = " gap-4"; 108 } 109 if (spaceBetweenColumnsMobile == "spacing-large") { 110 rowClass = " gap-5"; 111 } 112 //Desktop 113 if (spaceBetweenColumns == "stick") { 114 rowClass += " gap-lg-0"; 115 } 116 if (spaceBetweenColumns == "spacing-medium") 117 { 118 rowClass += " gap-lg-4"; 119 } 120 if (spaceBetweenColumns == "spacing-large") { 121 rowClass += " gap-lg-5"; 122 } 123 124 string theme = !string.IsNullOrWhiteSpace(Model.Item.GetRawValueString("Theme")) ? " theme " + Model.Item.GetRawValueString("Theme").Replace(" ", "").Trim().ToLower() : ""; 125 126 string animationOnScrollCol1 = Model.Item.GetRawValueString("AnimationOnScrollCol1", "no-animation"); 127 animationOnScrollCol1 = animationOnScrollCol1 != "no-animation" ? "data-aos=" + "'" + animationOnScrollCol1 + "'" : ""; 128 string animationOnScrollCol2 = Model.Item.GetRawValueString("AnimationOnScrollCol2", "no-animation"); 129 animationOnScrollCol2 = animationOnScrollCol2 != "no-animation" ? "data-aos=" + "'" + animationOnScrollCol2 + "'" : ""; 130 131 string hideOverflow = " overflow-hidden"; 132 hideOverflow = 133 animationOnScrollCol1 != "" || 134 animationOnScrollCol2 != "" 135 ? hideOverflow : ""; 136 137 Dynamicweb.Frontend.FileViewModel backgroundImage = Model.Item.GetFile("BackgroundImage"); 138 string backgroundImagePath = backgroundImage?.Path ?? string.Empty; 139 backgroundImagePath = !string.IsNullOrEmpty(backgroundImagePath) ? $"/Admin/Public/GetImage.ashx?image={backgroundImagePath}&width=2600&format=webp&compression=75" : string.Empty; 140 backgroundImagePath = Dynamicweb.Core.Encoders.HtmlEncoder.UrlPathEncode(backgroundImagePath); 141 string backgroundRepeat = Model.Item.GetRawValueString("BackgroundImageRepeat", "no-repeat"); 142 string backgroundImageSize = Model.Item.GetRawValueString("BackgroundImageSize", "initial"); 143 int xPos = backgroundImage?.FocalPositionFromLeft ?? 50; 144 int yPos = backgroundImage?.FocalPositionFromTop ?? 50; 145 string cssPosition = $"{xPos}% {yPos}%"; 146 string gradient = Model.Item.GetRawValueString("Gradient", string.Empty); 147 string gradientOpacity = Model.Item.GetRawValueString("GradientOpacity", "0.00"); 148 string gradientString = "linear-gradient(" + gradient + "deg," + "rgba(var(--swift-foreground-color-rgb)," + gradientOpacity + "), rgba(var(--swift-background-color-rgb)," + gradientOpacity + "))"; 149 string backgroundImageString = "url(" + backgroundImagePath + ")"; 150 string backgroundImagePositionString = "background-position:" + cssPosition + ";"; 151 string backgroundRepeatString = "background-repeat:" + backgroundRepeat + ";"; 152 string backgroundImageSizeString = "background-size:" + backgroundImageSize + ";"; 153 string styleString = string.Empty; 154 155 var decorations = Model.Item?.GetList("CssDecorations")?.GetRawValue().OfType<string>() ?? Enumerable.Empty<string>(); 156 var css = string.Empty; 157 var cssClasses = new List<string> { }; 158 159 foreach (var itemId in decorations) 160 { 161 var item = Dynamicweb.Content.Services.Items.GetItem("Swift_Css", itemId); 162 item.TryGetValue("Class", out object classes); 163 if (classes is null) 164 { 165 continue; 166 } 167 168 var cssString = (string)classes; 169 if (cssString.StartsWith("[")) 170 { 171 var cssArray = Dynamicweb.Core.Converter.Deserialize<string[]>(cssString); 172 cssClasses.AddRange(cssArray); 173 } 174 else 175 { 176 cssClasses.Add(cssString.Replace(",", " ")); 177 } 178 } 179 css = string.Join(" ", cssClasses).Trim(); 180 181 @* Only gradient *@ 182 183 if (!string.IsNullOrEmpty(gradient) && string.IsNullOrEmpty(backgroundImagePath) && gradientOpacity != ("0.00")) 184 { 185 styleString += "style=\"background-image:" + gradientString + ";\""; 186 } 187 188 @* Only background image *@ 189 190 else if (string.IsNullOrEmpty(gradient) && !string.IsNullOrEmpty(backgroundImagePath)) 191 { 192 styleString += "style=\"background-image:" + backgroundImageString + "; " + backgroundImagePositionString + backgroundRepeatString + backgroundImageSizeString + "\""; 193 } 194 195 @* Gradient and background image *@ 196 197 else if (!string.IsNullOrEmpty(gradient) && !string.IsNullOrEmpty(backgroundImagePath)) 198 { 199 styleString += "style=\"background-image:" + gradientString + "," + backgroundImageString + ";" + backgroundImagePositionString + backgroundRepeatString + backgroundImageSizeString + "\""; 200 } 201 202 int mobileColumnSize = Dynamicweb.Core.Converter.ToInt32(Model.Item.GetRawValueString("MobileColumnBehaviour", "1")); 203 int mobileOrderFirst = Dynamicweb.Core.Converter.ToInt32(Model.Item.GetRawValueString("MobileOrderFirst", "1")); 204 205 if (Pageview.IsVisualEditorMode || !string.IsNullOrWhiteSpace(Model.Column(1).Output()) || !string.IsNullOrWhiteSpace(Model.Column(2).Output())) 206 { 207 <div class="@(sectionClass)@(theme) @(css) item_@Model.Item.SystemName.ToLower()" @styleString data-swift-gridrow> 208 <div class="@containerClass@(hideOverflow)"> 209 <div class="grid grid-@(mobileColumnSize) grid-lg-@Model.Columns.Count()@(rowClass)"> 210 <div class="g-col @(Model.Column(1).ColumnNumber == mobileOrderFirst ? "order-first order-lg-0" : string.Empty)" data-col-size="6" @animationOnScrollCol1 style="--bs-columns:12"> 211 @Model.Column(1).Output() 212 </div> 213 <div class="g-col @(Model.Column(2).ColumnNumber == mobileOrderFirst ? "order-first order-lg-0" : string.Empty)" data-col-size="6" @animationOnScrollCol2 style="--bs-columns:12"> 214 @Model.Column(2).Output() 215 </div> 216 </div> 217 </div> 218 </div> 219 } 220 } 221
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
AUG 2023-AUG 2024 USA

We are a great place to work!

Qosina is proud to be Great Place to Work-Certified™! This certification is recognized worldwide by employees and employers alike and is the global benchmark for identifying and recognizing an outstanding employee experience. Qosina promotes career development, continuing education, and a challenging and innovative work environment. We believe our employees are our greatest and most important assets, and that it is our responsibility to provide growth, stability and a healthy work-life balance.

Perks

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/Paragraph/Swift_TextAdvanced.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_66b0f3e7120d4388b72c8017b5fd214b.RenderCustomCSS(IEnumerable`1 decorations) in G:\Domains\Sites\uat-qmx.mydwsite5.com\Files\Templates\Designs\Swift\Paragraph\Swift_TextAdvanced.cshtml:line 28
   at CompiledRazorTemplates.Dynamic.RazorEngine_66b0f3e7120d4388b72c8017b5fd214b.Execute() in G:\Domains\Sites\uat-qmx.mydwsite5.com\Files\Templates\Designs\Swift\Paragraph\Swift_TextAdvanced.cshtml:line 56
   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.ParagraphViewModel> 2 3 @functions 4 { 5 private string RenderContent(string content, string heading, string fontSize, string color, string opacity, string margin, string marginMobile, string cssClass) 6 { 7 var classes = new List<string> { }; 8 if (!string.IsNullOrEmpty(fontSize)) { classes.Add(fontSize); } 9 if (!string.IsNullOrEmpty(color)) { classes.Add(color); } 10 if (!string.IsNullOrEmpty(opacity)) { classes.Add(opacity); } 11 if (!string.IsNullOrEmpty(margin)) { classes.Add(margin); } 12 if (!string.IsNullOrEmpty(marginMobile)) { classes.Add(marginMobile); } 13 if (!string.IsNullOrEmpty(cssClass)) { classes.Add(cssClass); } 14 15 var tagStart = $"<{heading} class=\"{string.Join(" ", classes)}\">"; 16 var tagEnd = $"</{heading}>"; 17 18 return tagStart + content + tagEnd; 19 } 20 21 string RenderCustomCSS(IEnumerable<string> decorations) 22 { 23 var cssClasses = new List<string>(); 24 25 foreach (var itemId in decorations) 26 { 27 var item = Dynamicweb.Content.Services.Items.GetItem("Swift_Css", itemId); 28 item.TryGetValue("Class", out object classes); 29 30 if (classes is null) 31 { 32 continue; 33 } 34 35 var cssString = (string)classes; 36 37 if (cssString.StartsWith("[")) 38 { 39 var cssArray = Dynamicweb.Core.Converter.Deserialize<string[]>(cssString); 40 cssClasses.AddRange(cssArray); 41 } 42 else 43 { 44 cssClasses.Add(cssString.Replace(",", " ")); 45 } 46 } 47 48 return string.Join(" ", cssClasses).Trim(); 49 } 50 } 51 52 @{ 53 54 string theme = !string.IsNullOrWhiteSpace(Model.Item.GetRawValueString("Theme")) ? $" theme {Model.Item.GetRawValueString("Theme").Replace(" ", "").Trim().ToLower()}" : ""; 55 var decorations = Model.Item?.GetList("CssDecorations")?.GetRawValue().OfType<string>() ?? Enumerable.Empty<string>(); 56 string css = RenderCustomCSS(decorations); 57 58 string eyebrow = Model.Item.GetString("Eyebrow", string.Empty).Replace(System.Environment.NewLine, "<br>"); 59 string eyebrowHeadingLevel = Model.Item.GetString("EyebrowHeadingLevel", "h3"); 60 string eyebrowFontSize = Model.Item.GetRawValueString("EyebrowFontSize", "h5"); 61 string eyebrowColor = Model.Item.GetString("EyebrowColor", "text-inherit"); 62 string eyebrowTextOpacity = Model.Item.GetString("EyebrowTextOpacity", "opacity-100"); 63 string eyebrowCssClass = Model.Item.GetString("EyebrowCssClass", string.Empty); 64 string eyebrowSpacingBottomDesktop = Model.Item.GetRawValueString("EyebrowSpacingBottomDesktop", "default"); 65 eyebrowSpacingBottomDesktop = eyebrowSpacingBottomDesktop != "default" ? eyebrowSpacingBottomDesktop : string.Empty; 66 string eyebrowSpacingBottomMobile = Model.Item.GetRawValueString("EyebrowSpacingBottomMobile", "default"); 67 eyebrowSpacingBottomMobile = eyebrowSpacingBottomMobile != "default" ? eyebrowSpacingBottomMobile : string.Empty; 68 69 string title = Model.Item.GetString("Title", string.Empty).Replace(System.Environment.NewLine, "<br>"); 70 string titleHeadingLevel = Model.Item.GetString("TitleHeadingLevel", "h2"); 71 string titleFontSize = Model.Item.GetRawValueString("TitleFontSize", "h2"); 72 string titleColor = Model.Item.GetString("TitleColor", "text-inherit"); 73 string titleTextOpacity = Model.Item.GetString("TitleTextOpacity", "opacity-100"); 74 string titleCssClass = Model.Item.GetString("TitleCssClass", string.Empty); 75 string titleSpacingBottomDesktop = Model.Item.GetRawValueString("TitleSpacingBottomDesktop", "default"); 76 titleSpacingBottomDesktop = titleSpacingBottomDesktop != "default" ? titleSpacingBottomDesktop : string.Empty; 77 string titleSpacingBottomMobile = Model.Item.GetRawValueString("TitleSpacingBottomMobile", "default"); 78 titleSpacingBottomMobile = titleSpacingBottomMobile != "default" ? titleSpacingBottomMobile : string.Empty; 79 80 string subtitle = Model.Item.GetString("Subtitle", string.Empty).Replace(System.Environment.NewLine, "<br>"); 81 string subtitleHeadingLevel = Model.Item.GetString("SubtitleHeadingLevel", "p"); 82 string subtitleFontSize = Model.Item.GetRawValueString("SubtitleFontSize", "fs-5"); 83 string subtitleColor = Model.Item.GetString("SubtitleColor", "text-inherit"); 84 string subtitleTextOpacity = Model.Item.GetString("SubtitleTextOpacity", "opacity-100"); 85 string subtitleCssClass = Model.Item.GetString("SubtitleCssClass", string.Empty); 86 string subtitleSpacingBottomDesktop = Model.Item.GetRawValueString("SubtitleSpacingBottomDesktop", "default"); 87 subtitleSpacingBottomDesktop = subtitleSpacingBottomDesktop != "default" ? subtitleSpacingBottomDesktop : string.Empty; 88 string subtitleSpacingBottomMobile = Model.Item.GetRawValueString("SubtitleSpacingBottomMobile", "default"); 89 subtitleSpacingBottomMobile = subtitleSpacingBottomMobile != "default" ? subtitleSpacingBottomMobile : string.Empty; 90 91 string text = Model.Item.GetString("Text", string.Empty); 92 string textFontSize = Model.Item.GetRawValueString("TextFontSize", "fs-6"); 93 string textColor = Model.Item.GetString("TextColor", "text-inherit"); 94 string TextOpacity = Model.Item.GetString("TextOpacity", "opacity-100"); 95 string textCssClass = Model.Item.GetString("TextCssClass", string.Empty); 96 string textSpacingBottomDesktop = Model.Item.GetRawValueString("TextSpacingBottomDesktop", "mb-lg-4"); 97 textSpacingBottomDesktop = textSpacingBottomDesktop != "default" ? textSpacingBottomDesktop : string.Empty; 98 string textSpacingBottomMobile = Model.Item.GetRawValueString("TextSpacingBottomMobile", "mb-3"); 99 textSpacingBottomMobile = textSpacingBottomMobile != "default" ? textSpacingBottomMobile : string.Empty; 100 101 string contentAlignment = Model.Item.GetRawValueString("ContentAlignment", "align-items-center justify-content-center"); 102 string contentTextAlignment = Model.Item.GetRawValueString("ContentTextAlignment", "text-start"); 103 string contentSpacingStartDesktop = Model.Item.GetRawValueString("ContentSpacingStartDesktop", "default"); 104 contentSpacingStartDesktop = contentSpacingStartDesktop != "default" ? contentSpacingStartDesktop : string.Empty; 105 string contentSpacingStartMobile = Model.Item.GetRawValueString("ContentSpacingStartMobile", "default"); 106 contentSpacingStartMobile = contentSpacingStartMobile != "default" ? contentSpacingStartMobile : string.Empty; 107 string contentSpacingEndDesktop = Model.Item.GetRawValueString("ContentSpacingEndDesktop", "default"); 108 contentSpacingEndDesktop = contentSpacingEndDesktop != "default" ? contentSpacingEndDesktop : string.Empty; 109 string contentSpacingEndMobile = Model.Item.GetRawValueString("ContentSpacingEndMobile", "default"); 110 contentSpacingEndMobile = contentSpacingEndMobile != "default" ? contentSpacingEndMobile : string.Empty; 111 string contentSpacingTopDesktop = Model.Item.GetRawValueString("ContentSpacingTopDesktop", "default"); 112 contentSpacingTopDesktop = contentSpacingTopDesktop != "default" ? contentSpacingTopDesktop : string.Empty; 113 string contentSpacingTopMobile = Model.Item.GetRawValueString("ContentSpacingTopMobile", "default"); 114 contentSpacingTopMobile = contentSpacingTopMobile != "default" ? contentSpacingTopMobile : string.Empty; 115 string contentSpacingBottomDesktop = Model.Item.GetRawValueString("ContentSpacingBottomDesktop", "default"); 116 contentSpacingBottomDesktop = contentSpacingBottomDesktop != "default" ? contentSpacingBottomDesktop : string.Empty; 117 string contentSpacingBottomMobile = Model.Item.GetRawValueString("ContentSpacingBottomMobile", "default"); 118 contentSpacingBottomMobile = contentSpacingBottomMobile != "default" ? contentSpacingBottomMobile : string.Empty; 119 string contentCssClass = Model.Item.GetString("ContentCssClass", string.Empty); 120 121 var contentClasses = new List<string> { }; 122 if (contentSpacingStartDesktop != "default") { contentClasses.Add(contentSpacingStartDesktop.Trim()); } 123 if (contentSpacingStartMobile != "default") { contentClasses.Add(contentSpacingStartMobile.Trim()); } 124 if (contentSpacingEndDesktop != "default") { contentClasses.Add(contentSpacingEndDesktop.Trim()); } 125 if (contentSpacingEndMobile != "default") { contentClasses.Add(contentSpacingEndMobile.Trim()); } 126 if (contentSpacingTopDesktop != "default") { contentClasses.Add(contentSpacingTopDesktop.Trim()); } 127 if (contentSpacingTopMobile != "default") { contentClasses.Add(contentSpacingTopMobile.Trim()); } 128 if (contentSpacingBottomDesktop != "default") { contentClasses.Add(contentSpacingBottomDesktop.Trim()); } 129 if (contentSpacingBottomMobile != "default") { contentClasses.Add(contentSpacingBottomMobile.Trim()); } 130 if (!string.IsNullOrEmpty(contentCssClass)) { contentClasses.Add(contentCssClass); } 131 132 //Button 1 133 var button1Link = Model.Item.GetLink("Button1Link"); 134 var button1Label = Model.Item.GetString("Button1Label", string.Empty); 135 var button1Icon = Model.Item.GetRawValueString("Button1Icon"); 136 var button1IconPosition = Model.Item.GetRawValueString("Button1IconPosition", "right"); 137 var button1Style = Model.Item.GetRawValueString("Button1Style", "btn-primary"); 138 139 //Button 2 140 var button2Link = Model.Item.GetLink("Button2Link"); 141 var button2Label = Model.Item.GetString("Button2Label", string.Empty); 142 var button2Icon = Model.Item.GetRawValueString("Button2Icon"); 143 var button2IconPosition = Model.Item.GetRawValueString("Button2IconPosition", "right"); 144 var button2Style = Model.Item.GetRawValueString("Button2Style", "btn-primary"); 145 } 146 147 <div class="h-100 d-flex position-relative @(contentAlignment)@(theme) item_@Model.Item.SystemName.ToLower()"> 148 <div id="@Model.ID" class="user-select-none position-absolute top-0" style="scroll-margin-top: var(--header-height, 150px)"></div> 149 <div class="d-inline-flex flex-column @(contentTextAlignment) @(string.Join(" ",contentClasses).Trim()) @(css)"> 150 151 @if (!string.IsNullOrEmpty(eyebrow)) 152 { 153 @RenderContent(eyebrow, eyebrowHeadingLevel, eyebrowFontSize, eyebrowColor, eyebrowTextOpacity, eyebrowSpacingBottomDesktop, eyebrowSpacingBottomMobile, eyebrowCssClass) 154 } 155 156 @if (!string.IsNullOrEmpty(title)) 157 { 158 @RenderContent(title, titleHeadingLevel, titleFontSize, titleColor, titleTextOpacity, titleSpacingBottomDesktop, titleSpacingBottomMobile, titleCssClass) 159 } 160 161 @if (!string.IsNullOrEmpty(subtitle)) 162 { 163 @RenderContent(subtitle, subtitleHeadingLevel, subtitleFontSize, subtitleColor, subtitleTextOpacity, subtitleSpacingBottomDesktop, subtitleSpacingBottomMobile, subtitleCssClass) 164 } 165 166 @if (!string.IsNullOrEmpty(text)) 167 { 168 @RenderContent(text, "div", textFontSize, textColor, TextOpacity, textSpacingBottomDesktop, textSpacingBottomMobile, $"mb-0-last-child {textCssClass}") 169 } 170 171 @if (button1Link is object || button2Link is object) 172 { 173 if (contentTextAlignment == "text-start") 174 { 175 contentAlignment = "justify-content-start"; 176 } 177 if (contentTextAlignment == "text-center") 178 { 179 contentAlignment = "justify-content-center"; 180 } 181 if (contentTextAlignment == "text-end") 182 { 183 contentAlignment = "justify-content-end"; 184 } 185 186 <div class="d-flex flex-wrap @(contentAlignment) gap-3"> 187 @if (button1Link is object && !string.IsNullOrEmpty(button1Label)) 188 { 189 string target = Pageview.AreaSettings.GetBoolean("OpenLinksInNewTab") && button1Link.IsExternal ? "target=\"_blank\"" : string.Empty; 190 string rel = Pageview.AreaSettings.GetBoolean("OpenLinksInNewTab") && button1Link.IsExternal ? "rel=\"noopener\"" : string.Empty; 191 192 <a href="@button1Link.Url" @target @rel class="btn @(button1Style)"> 193 @if (button1Icon is object) 194 { 195 <span class="d-flex align-items-center gap-1 @(button1IconPosition)"> 196 @button1Label 197 @if (System.IO.Path.GetExtension(button1Icon).ToLower() == ".svg") 198 { 199 if (!button1Icon.ToLower().Contains("none") && button1Icon != string.Empty) 200 { 201 <span class="icon-auto"> 202 @ReadFile(button1Icon) 203 </span> 204 } 205 } 206 </span> 207 } 208 else 209 { 210 @button1Label 211 } 212 </a> 213 } 214 215 @if (button2Link is object && !string.IsNullOrEmpty(button1Label)) 216 { 217 string target = Pageview.AreaSettings.GetBoolean("OpenLinksInNewTab") && button2Link.IsExternal ? "target=\"_blank\"" : string.Empty; 218 string rel = Pageview.AreaSettings.GetBoolean("OpenLinksInNewTab") && button2Link.IsExternal ? "rel=\"noopener\"" : string.Empty; 219 220 <a href="@button2Link.Url" @target @rel class="btn @(button2Style)"> 221 @if (button2Icon is object) 222 { 223 <span class="d-flex align-items-center gap-1 @(button2IconPosition)"> 224 @button2Label 225 @if (System.IO.Path.GetExtension(button2Icon).ToLower() == ".svg") 226 { 227 if (!button2Icon.ToLower().Contains("none") && button2Icon != string.Empty) 228 { 229 <span class="icon-auto"> 230 @ReadFile(button2Icon) 231 </span> 232 } 233 } 234 </span> 235 } 236 else 237 { 238 @button2Label 239 } 240 </a> 241 } 242 </div> 243 } 244 @if (!string.IsNullOrEmpty(Model.ModuleSystemName)) 245 { 246 <div class="item_@Model.Item.SystemName.ToLower() @textSpacingBottomDesktop @textSpacingBottomMobile mb-0-last-child mt-3"> 247 @Model.GetModuleOutput() 248 </div> 249 } 250 </div> 251 </div> 252
Error executing template "Designs/Swift/Paragraph/Swift_TextAdvanced.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_66b0f3e7120d4388b72c8017b5fd214b.RenderCustomCSS(IEnumerable`1 decorations) in G:\Domains\Sites\uat-qmx.mydwsite5.com\Files\Templates\Designs\Swift\Paragraph\Swift_TextAdvanced.cshtml:line 28
   at CompiledRazorTemplates.Dynamic.RazorEngine_66b0f3e7120d4388b72c8017b5fd214b.Execute() in G:\Domains\Sites\uat-qmx.mydwsite5.com\Files\Templates\Designs\Swift\Paragraph\Swift_TextAdvanced.cshtml:line 56
   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.ParagraphViewModel> 2 3 @functions 4 { 5 private string RenderContent(string content, string heading, string fontSize, string color, string opacity, string margin, string marginMobile, string cssClass) 6 { 7 var classes = new List<string> { }; 8 if (!string.IsNullOrEmpty(fontSize)) { classes.Add(fontSize); } 9 if (!string.IsNullOrEmpty(color)) { classes.Add(color); } 10 if (!string.IsNullOrEmpty(opacity)) { classes.Add(opacity); } 11 if (!string.IsNullOrEmpty(margin)) { classes.Add(margin); } 12 if (!string.IsNullOrEmpty(marginMobile)) { classes.Add(marginMobile); } 13 if (!string.IsNullOrEmpty(cssClass)) { classes.Add(cssClass); } 14 15 var tagStart = $"<{heading} class=\"{string.Join(" ", classes)}\">"; 16 var tagEnd = $"</{heading}>"; 17 18 return tagStart + content + tagEnd; 19 } 20 21 string RenderCustomCSS(IEnumerable<string> decorations) 22 { 23 var cssClasses = new List<string>(); 24 25 foreach (var itemId in decorations) 26 { 27 var item = Dynamicweb.Content.Services.Items.GetItem("Swift_Css", itemId); 28 item.TryGetValue("Class", out object classes); 29 30 if (classes is null) 31 { 32 continue; 33 } 34 35 var cssString = (string)classes; 36 37 if (cssString.StartsWith("[")) 38 { 39 var cssArray = Dynamicweb.Core.Converter.Deserialize<string[]>(cssString); 40 cssClasses.AddRange(cssArray); 41 } 42 else 43 { 44 cssClasses.Add(cssString.Replace(",", " ")); 45 } 46 } 47 48 return string.Join(" ", cssClasses).Trim(); 49 } 50 } 51 52 @{ 53 54 string theme = !string.IsNullOrWhiteSpace(Model.Item.GetRawValueString("Theme")) ? $" theme {Model.Item.GetRawValueString("Theme").Replace(" ", "").Trim().ToLower()}" : ""; 55 var decorations = Model.Item?.GetList("CssDecorations")?.GetRawValue().OfType<string>() ?? Enumerable.Empty<string>(); 56 string css = RenderCustomCSS(decorations); 57 58 string eyebrow = Model.Item.GetString("Eyebrow", string.Empty).Replace(System.Environment.NewLine, "<br>"); 59 string eyebrowHeadingLevel = Model.Item.GetString("EyebrowHeadingLevel", "h3"); 60 string eyebrowFontSize = Model.Item.GetRawValueString("EyebrowFontSize", "h5"); 61 string eyebrowColor = Model.Item.GetString("EyebrowColor", "text-inherit"); 62 string eyebrowTextOpacity = Model.Item.GetString("EyebrowTextOpacity", "opacity-100"); 63 string eyebrowCssClass = Model.Item.GetString("EyebrowCssClass", string.Empty); 64 string eyebrowSpacingBottomDesktop = Model.Item.GetRawValueString("EyebrowSpacingBottomDesktop", "default"); 65 eyebrowSpacingBottomDesktop = eyebrowSpacingBottomDesktop != "default" ? eyebrowSpacingBottomDesktop : string.Empty; 66 string eyebrowSpacingBottomMobile = Model.Item.GetRawValueString("EyebrowSpacingBottomMobile", "default"); 67 eyebrowSpacingBottomMobile = eyebrowSpacingBottomMobile != "default" ? eyebrowSpacingBottomMobile : string.Empty; 68 69 string title = Model.Item.GetString("Title", string.Empty).Replace(System.Environment.NewLine, "<br>"); 70 string titleHeadingLevel = Model.Item.GetString("TitleHeadingLevel", "h2"); 71 string titleFontSize = Model.Item.GetRawValueString("TitleFontSize", "h2"); 72 string titleColor = Model.Item.GetString("TitleColor", "text-inherit"); 73 string titleTextOpacity = Model.Item.GetString("TitleTextOpacity", "opacity-100"); 74 string titleCssClass = Model.Item.GetString("TitleCssClass", string.Empty); 75 string titleSpacingBottomDesktop = Model.Item.GetRawValueString("TitleSpacingBottomDesktop", "default"); 76 titleSpacingBottomDesktop = titleSpacingBottomDesktop != "default" ? titleSpacingBottomDesktop : string.Empty; 77 string titleSpacingBottomMobile = Model.Item.GetRawValueString("TitleSpacingBottomMobile", "default"); 78 titleSpacingBottomMobile = titleSpacingBottomMobile != "default" ? titleSpacingBottomMobile : string.Empty; 79 80 string subtitle = Model.Item.GetString("Subtitle", string.Empty).Replace(System.Environment.NewLine, "<br>"); 81 string subtitleHeadingLevel = Model.Item.GetString("SubtitleHeadingLevel", "p"); 82 string subtitleFontSize = Model.Item.GetRawValueString("SubtitleFontSize", "fs-5"); 83 string subtitleColor = Model.Item.GetString("SubtitleColor", "text-inherit"); 84 string subtitleTextOpacity = Model.Item.GetString("SubtitleTextOpacity", "opacity-100"); 85 string subtitleCssClass = Model.Item.GetString("SubtitleCssClass", string.Empty); 86 string subtitleSpacingBottomDesktop = Model.Item.GetRawValueString("SubtitleSpacingBottomDesktop", "default"); 87 subtitleSpacingBottomDesktop = subtitleSpacingBottomDesktop != "default" ? subtitleSpacingBottomDesktop : string.Empty; 88 string subtitleSpacingBottomMobile = Model.Item.GetRawValueString("SubtitleSpacingBottomMobile", "default"); 89 subtitleSpacingBottomMobile = subtitleSpacingBottomMobile != "default" ? subtitleSpacingBottomMobile : string.Empty; 90 91 string text = Model.Item.GetString("Text", string.Empty); 92 string textFontSize = Model.Item.GetRawValueString("TextFontSize", "fs-6"); 93 string textColor = Model.Item.GetString("TextColor", "text-inherit"); 94 string TextOpacity = Model.Item.GetString("TextOpacity", "opacity-100"); 95 string textCssClass = Model.Item.GetString("TextCssClass", string.Empty); 96 string textSpacingBottomDesktop = Model.Item.GetRawValueString("TextSpacingBottomDesktop", "mb-lg-4"); 97 textSpacingBottomDesktop = textSpacingBottomDesktop != "default" ? textSpacingBottomDesktop : string.Empty; 98 string textSpacingBottomMobile = Model.Item.GetRawValueString("TextSpacingBottomMobile", "mb-3"); 99 textSpacingBottomMobile = textSpacingBottomMobile != "default" ? textSpacingBottomMobile : string.Empty; 100 101 string contentAlignment = Model.Item.GetRawValueString("ContentAlignment", "align-items-center justify-content-center"); 102 string contentTextAlignment = Model.Item.GetRawValueString("ContentTextAlignment", "text-start"); 103 string contentSpacingStartDesktop = Model.Item.GetRawValueString("ContentSpacingStartDesktop", "default"); 104 contentSpacingStartDesktop = contentSpacingStartDesktop != "default" ? contentSpacingStartDesktop : string.Empty; 105 string contentSpacingStartMobile = Model.Item.GetRawValueString("ContentSpacingStartMobile", "default"); 106 contentSpacingStartMobile = contentSpacingStartMobile != "default" ? contentSpacingStartMobile : string.Empty; 107 string contentSpacingEndDesktop = Model.Item.GetRawValueString("ContentSpacingEndDesktop", "default"); 108 contentSpacingEndDesktop = contentSpacingEndDesktop != "default" ? contentSpacingEndDesktop : string.Empty; 109 string contentSpacingEndMobile = Model.Item.GetRawValueString("ContentSpacingEndMobile", "default"); 110 contentSpacingEndMobile = contentSpacingEndMobile != "default" ? contentSpacingEndMobile : string.Empty; 111 string contentSpacingTopDesktop = Model.Item.GetRawValueString("ContentSpacingTopDesktop", "default"); 112 contentSpacingTopDesktop = contentSpacingTopDesktop != "default" ? contentSpacingTopDesktop : string.Empty; 113 string contentSpacingTopMobile = Model.Item.GetRawValueString("ContentSpacingTopMobile", "default"); 114 contentSpacingTopMobile = contentSpacingTopMobile != "default" ? contentSpacingTopMobile : string.Empty; 115 string contentSpacingBottomDesktop = Model.Item.GetRawValueString("ContentSpacingBottomDesktop", "default"); 116 contentSpacingBottomDesktop = contentSpacingBottomDesktop != "default" ? contentSpacingBottomDesktop : string.Empty; 117 string contentSpacingBottomMobile = Model.Item.GetRawValueString("ContentSpacingBottomMobile", "default"); 118 contentSpacingBottomMobile = contentSpacingBottomMobile != "default" ? contentSpacingBottomMobile : string.Empty; 119 string contentCssClass = Model.Item.GetString("ContentCssClass", string.Empty); 120 121 var contentClasses = new List<string> { }; 122 if (contentSpacingStartDesktop != "default") { contentClasses.Add(contentSpacingStartDesktop.Trim()); } 123 if (contentSpacingStartMobile != "default") { contentClasses.Add(contentSpacingStartMobile.Trim()); } 124 if (contentSpacingEndDesktop != "default") { contentClasses.Add(contentSpacingEndDesktop.Trim()); } 125 if (contentSpacingEndMobile != "default") { contentClasses.Add(contentSpacingEndMobile.Trim()); } 126 if (contentSpacingTopDesktop != "default") { contentClasses.Add(contentSpacingTopDesktop.Trim()); } 127 if (contentSpacingTopMobile != "default") { contentClasses.Add(contentSpacingTopMobile.Trim()); } 128 if (contentSpacingBottomDesktop != "default") { contentClasses.Add(contentSpacingBottomDesktop.Trim()); } 129 if (contentSpacingBottomMobile != "default") { contentClasses.Add(contentSpacingBottomMobile.Trim()); } 130 if (!string.IsNullOrEmpty(contentCssClass)) { contentClasses.Add(contentCssClass); } 131 132 //Button 1 133 var button1Link = Model.Item.GetLink("Button1Link"); 134 var button1Label = Model.Item.GetString("Button1Label", string.Empty); 135 var button1Icon = Model.Item.GetRawValueString("Button1Icon"); 136 var button1IconPosition = Model.Item.GetRawValueString("Button1IconPosition", "right"); 137 var button1Style = Model.Item.GetRawValueString("Button1Style", "btn-primary"); 138 139 //Button 2 140 var button2Link = Model.Item.GetLink("Button2Link"); 141 var button2Label = Model.Item.GetString("Button2Label", string.Empty); 142 var button2Icon = Model.Item.GetRawValueString("Button2Icon"); 143 var button2IconPosition = Model.Item.GetRawValueString("Button2IconPosition", "right"); 144 var button2Style = Model.Item.GetRawValueString("Button2Style", "btn-primary"); 145 } 146 147 <div class="h-100 d-flex position-relative @(contentAlignment)@(theme) item_@Model.Item.SystemName.ToLower()"> 148 <div id="@Model.ID" class="user-select-none position-absolute top-0" style="scroll-margin-top: var(--header-height, 150px)"></div> 149 <div class="d-inline-flex flex-column @(contentTextAlignment) @(string.Join(" ",contentClasses).Trim()) @(css)"> 150 151 @if (!string.IsNullOrEmpty(eyebrow)) 152 { 153 @RenderContent(eyebrow, eyebrowHeadingLevel, eyebrowFontSize, eyebrowColor, eyebrowTextOpacity, eyebrowSpacingBottomDesktop, eyebrowSpacingBottomMobile, eyebrowCssClass) 154 } 155 156 @if (!string.IsNullOrEmpty(title)) 157 { 158 @RenderContent(title, titleHeadingLevel, titleFontSize, titleColor, titleTextOpacity, titleSpacingBottomDesktop, titleSpacingBottomMobile, titleCssClass) 159 } 160 161 @if (!string.IsNullOrEmpty(subtitle)) 162 { 163 @RenderContent(subtitle, subtitleHeadingLevel, subtitleFontSize, subtitleColor, subtitleTextOpacity, subtitleSpacingBottomDesktop, subtitleSpacingBottomMobile, subtitleCssClass) 164 } 165 166 @if (!string.IsNullOrEmpty(text)) 167 { 168 @RenderContent(text, "div", textFontSize, textColor, TextOpacity, textSpacingBottomDesktop, textSpacingBottomMobile, $"mb-0-last-child {textCssClass}") 169 } 170 171 @if (button1Link is object || button2Link is object) 172 { 173 if (contentTextAlignment == "text-start") 174 { 175 contentAlignment = "justify-content-start"; 176 } 177 if (contentTextAlignment == "text-center") 178 { 179 contentAlignment = "justify-content-center"; 180 } 181 if (contentTextAlignment == "text-end") 182 { 183 contentAlignment = "justify-content-end"; 184 } 185 186 <div class="d-flex flex-wrap @(contentAlignment) gap-3"> 187 @if (button1Link is object && !string.IsNullOrEmpty(button1Label)) 188 { 189 string target = Pageview.AreaSettings.GetBoolean("OpenLinksInNewTab") && button1Link.IsExternal ? "target=\"_blank\"" : string.Empty; 190 string rel = Pageview.AreaSettings.GetBoolean("OpenLinksInNewTab") && button1Link.IsExternal ? "rel=\"noopener\"" : string.Empty; 191 192 <a href="@button1Link.Url" @target @rel class="btn @(button1Style)"> 193 @if (button1Icon is object) 194 { 195 <span class="d-flex align-items-center gap-1 @(button1IconPosition)"> 196 @button1Label 197 @if (System.IO.Path.GetExtension(button1Icon).ToLower() == ".svg") 198 { 199 if (!button1Icon.ToLower().Contains("none") && button1Icon != string.Empty) 200 { 201 <span class="icon-auto"> 202 @ReadFile(button1Icon) 203 </span> 204 } 205 } 206 </span> 207 } 208 else 209 { 210 @button1Label 211 } 212 </a> 213 } 214 215 @if (button2Link is object && !string.IsNullOrEmpty(button1Label)) 216 { 217 string target = Pageview.AreaSettings.GetBoolean("OpenLinksInNewTab") && button2Link.IsExternal ? "target=\"_blank\"" : string.Empty; 218 string rel = Pageview.AreaSettings.GetBoolean("OpenLinksInNewTab") && button2Link.IsExternal ? "rel=\"noopener\"" : string.Empty; 219 220 <a href="@button2Link.Url" @target @rel class="btn @(button2Style)"> 221 @if (button2Icon is object) 222 { 223 <span class="d-flex align-items-center gap-1 @(button2IconPosition)"> 224 @button2Label 225 @if (System.IO.Path.GetExtension(button2Icon).ToLower() == ".svg") 226 { 227 if (!button2Icon.ToLower().Contains("none") && button2Icon != string.Empty) 228 { 229 <span class="icon-auto"> 230 @ReadFile(button2Icon) 231 </span> 232 } 233 } 234 </span> 235 } 236 else 237 { 238 @button2Label 239 } 240 </a> 241 } 242 </div> 243 } 244 @if (!string.IsNullOrEmpty(Model.ModuleSystemName)) 245 { 246 <div class="item_@Model.Item.SystemName.ToLower() @textSpacingBottomDesktop @textSpacingBottomMobile mb-0-last-child mt-3"> 247 @Model.GetModuleOutput() 248 </div> 249 } 250 </div> 251 </div> 252

EEO Statement

The equal employment opportunity policy of the Qosina Corp. provides for a fair and equal employment opportunity for all associates and job applicants regardless of race, color, religious creed, national origin, ancestry, age, gender, pregnancy, sexual orientation, gender identity, age, marital status, familial status, disability or genetic information, in compliance with applicable federal, state and local law. Qosina hires and promotes individuals solely on the basis of their qualifications for the job to be filled.

Qosina reasonably accommodates qualified individuals with disabilities to enable them to receive equal employment opportunity and/or perform the essential functions of the job, unless the accommodation would impose an undue hardship to the Company. This applies to all applicants and associates.

We also provide a work environment in which each associate is able to be productive and work to the best of his or her ability. We do not condone or tolerate an atmosphere of intimidation or harassment. We expect and require the cooperation of all associates in maintaining an atmosphere free from discrimination and harassment with mutual respect by and for all associates and applicants.

By clicking 'Accept All' you consent that we may collect information about you for various purposes, including: Statistics and Marketing