LEVERANTÖRER

Välkommen till vår leverantörssida, där kvalitet möter pålitlighet inom plastindustrin. Varje leverantör som listas på vår webbplats representerar toppen av kvalitet, innovation och trovärdighet.

Vi förstår att grunden för vårt produktsortiment bygger på styrkan i våra partnerskap med dessa ansedda leverantörer. Från globala ledare till specialiserade nischleverantörer, säkerställer vårt breda utbud av leverantörer att vi kan tillgodose alla dina behov inom branschen med högsta precision och kvalitet.

Utforska världen av våra leverantörer, där varje namn är synonymt med kvalitet och kundnöjdhet.

MOULDPRO

Precision inom Plast: Innovativ Formsprutning

Upptäck Precision och Innovation med MOULDPRO – Din Expert på Lösningar för Formsprutning av Plast.

På MOULDPRO är vi specialiserade på att höja standarden inom formsprutning av plast. Vårt omfattande produktsortiment, som inkluderar formsprejer, förbrukningsvaror, vattenkopplingar, specialverktyg och tillbehör, är noggrant utformat för att möta de dynamiska behoven hos yrkesverksamma inom formsprutning. Vårt engagemang sträcker sig bortom att bara leverera produkter; vi är dedikerade till att leverera kvalitet i varje artikel vi erbjuder.

I samarbete med ett nätverk av kunniga och noggrant utvalda distributörer, säkerställer MOULDPRO inte bara tillgången till förstklassiga produkter utan också en rikedom av branschexpertis och enastående kundservice. Vår orubbliga strävan efter kvalitet märks tydligt genom våra konkurrenskraftiga priser och vår lyhördhet för kundfeedback, vilket driver den kontinuerliga utvecklingen av vårt produktsortiment.

Ett särskilt bevis på vår innovation är utvecklingen av Quick Mould Change (QMC)-produkter, specifikt utformade för att möta branschens unika utmaningar. MOULDPRO, som värdesätter personlig uppmärksamhet och omsorg, är en betydande och etablerad leverantör med många års samlad erfarenhet inom plastindustrin. Vår strategi är centrerad kring att leverera produkter av högsta kvalitet i tid, säkerställa valuta för pengarna och upprätthålla en stark global närvaro genom vårt distributionsnätverk.

Vi inbjuder dig att utforska vår katalog, övertygade om att du kommer att hitta de perfekta lösningarna för dina behov. Din tillfredsställelse driver oss att förbättra och överträffa oss själva varje dag. Välkommen till MOULDPRO, där kvalitet möter innovation i plastformsprutningens värld.

Flosense

Vi presenterar Flosense: Din Partner för Avancerade Formsprutningslösningar.

På Flosense specialiserar vi oss på att förbättra effektiviteten och precisionen i formsprutningsprocessen. Vårt fokus ligger på att utveckla innovativa övervakningssystem som inte bara är prisvärda och flexibla, utan också avgörande för att säkerställa högsta kvalitet och prestanda i formsprutningsoperationer. Våra lösningar är utformade för enkel installation och användarvänlighet, vilket gör dem till ett idealiskt val för formsprutare som prioriterar både kostnadseffektivitet och överlägsen produktionskapacitet.

Flosense är mer än bara en produkt – det är ett åtagande om kvalitet inom formsprutningsindustrin. Genom att erbjuda tillförlitlig och insiktsfull övervakning av viktiga processparametrar hjälper vi våra kunder att uppnå oöverträffad stabilitet och effektivitet i sin verksamhet. Följ med oss och omfamna en framtid av perfekt formsprutning med Flosense vid din sida.

Error executing template "/Designs/Swift/Grid/Page/RowTemplates/6Columns.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_fc7b3362ec6c489fbd913d0a1564fe93.Execute() in D:\dynamicweb.net\Solutions\Dynamicweb\HCTswift.staging.dynamicweb-cms.com\files\Templates\Designs\Swift\Grid\Page\RowTemplates\6Columns.cshtml:line 177
   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 string animationOnScrollCol4 = Model.Item.GetRawValueString("AnimationOnScrollCol4", "no-animation"); 136 animationOnScrollCol4 = animationOnScrollCol4 != "no-animation" ? "data-aos=" + "'" + animationOnScrollCol4 + "'" : ""; 137 string animationOnScrollCol5 = Model.Item.GetRawValueString("AnimationOnScrollCol5", "no-animation"); 138 animationOnScrollCol5 = animationOnScrollCol5 != "no-animation" ? "data-aos=" + "'" + animationOnScrollCol5 + "'" : ""; 139 string animationOnScrollCol6 = Model.Item.GetRawValueString("AnimationOnScrollCol6", "no-animation"); 140 animationOnScrollCol6 = animationOnScrollCol6 != "no-animation" ? "data-aos=" + "'" + animationOnScrollCol6 + "'" : ""; 141 142 string hideOverflow = " overflow-hidden"; 143 hideOverflow = 144 animationOnScrollCol1 != "" || 145 animationOnScrollCol2 != "" || 146 animationOnScrollCol3 != "" || 147 animationOnScrollCol4 != "" || 148 animationOnScrollCol5 != "" || 149 animationOnScrollCol6 != "" 150 ? hideOverflow : ""; 151 152 Dynamicweb.Frontend.FileViewModel backgroundImage = Model.Item.GetFile("BackgroundImage"); 153 string backgroundImagePath = backgroundImage?.Path ?? string.Empty; 154 backgroundImagePath = !string.IsNullOrEmpty(backgroundImagePath) ? $"/Admin/Public/GetImage.ashx?image={backgroundImagePath}&width=2600&format=webp&compression=75" : string.Empty; 155 backgroundImagePath = Dynamicweb.Core.Encoders.HtmlEncoder.UrlPathEncode(backgroundImagePath); 156 string backgroundRepeat = Model.Item.GetRawValueString("BackgroundImageRepeat", "no-repeat"); 157 string backgroundImageSize = Model.Item.GetRawValueString("BackgroundImageSize", "initial"); 158 int xPos = backgroundImage?.FocalPositionFromLeft ?? 50; 159 int yPos = backgroundImage?.FocalPositionFromTop ?? 50; 160 string cssPosition = $"{xPos}% {yPos}%"; 161 string gradient = Model.Item.GetRawValueString("Gradient", string.Empty); 162 string gradientOpacity = Model.Item.GetRawValueString("GradientOpacity", "0.00"); 163 string gradientString = "linear-gradient(" + gradient + "deg," + "rgba(var(--swift-foreground-color-rgb)," + gradientOpacity + "), rgba(var(--swift-background-color-rgb)," + gradientOpacity + "))"; 164 string backgroundImageString = "url(" + backgroundImagePath + ")"; 165 string backgroundImagePositionString = "background-position:" + cssPosition + ";"; 166 string backgroundRepeatString = "background-repeat:" + backgroundRepeat + ";"; 167 string backgroundImageSizeString = "background-size:" + backgroundImageSize + ";"; 168 string styleString = string.Empty; 169 170 var decorations = Model.Item?.GetList("CssDecorations")?.GetRawValue().OfType<string>() ?? Enumerable.Empty<string>(); 171 var css = string.Empty; 172 var cssClasses = new List<string> { }; 173 174 foreach (var itemId in decorations) 175 { 176 var item = Dynamicweb.Content.Services.Items.GetItem("Swift_Css", itemId); 177 item.TryGetValue("Class", out object classes); 178 if (classes is null) 179 { 180 continue; 181 } 182 183 var cssString = (string)classes; 184 if (cssString.StartsWith("[")) 185 { 186 var cssArray = Dynamicweb.Core.Converter.Deserialize<string[]>(cssString); 187 cssClasses.AddRange(cssArray); 188 } 189 else 190 { 191 cssClasses.Add(cssString.Replace(",", " ")); 192 } 193 } 194 css = string.Join(" ", cssClasses).Trim(); 195 196 @* Only gradient *@ 197 198 if (!string.IsNullOrEmpty(gradient) && string.IsNullOrEmpty(backgroundImagePath) && gradientOpacity != ("0.00")) 199 { 200 styleString += "style=\"background-image:" + gradientString + ";\""; 201 } 202 203 @* Only background image *@ 204 205 else if (string.IsNullOrEmpty(gradient) && !string.IsNullOrEmpty(backgroundImagePath)) 206 { 207 styleString += "style=\"background-image:" + backgroundImageString + "; " + backgroundImagePositionString + backgroundRepeatString + backgroundImageSizeString + "\""; 208 } 209 210 @* Gradient and background image *@ 211 212 else if (!string.IsNullOrEmpty(gradient) && !string.IsNullOrEmpty(backgroundImagePath)) 213 { 214 styleString += "style=\"background-image:" + gradientString + "," + backgroundImageString + ";" + backgroundImagePositionString + backgroundRepeatString + backgroundImageSizeString + "\""; 215 } 216 217 int mobileColumnSize = Dynamicweb.Core.Converter.ToInt32(Model.Item.GetRawValueString("MobileColumnBehaviour", "1")); 218 int mobileOrderFirst = Dynamicweb.Core.Converter.ToInt32(Model.Item.GetRawValueString("MobileOrderFirst", "1")); 219 220 if (Pageview.IsVisualEditorMode || !string.IsNullOrWhiteSpace(Model.Column(1).Output()) || !string.IsNullOrWhiteSpace(Model.Column(2).Output()) || !string.IsNullOrWhiteSpace(Model.Column(3).Output()) || !string.IsNullOrWhiteSpace(Model.Column(4).Output()) || !string.IsNullOrWhiteSpace(Model.Column(5).Output()) || !string.IsNullOrWhiteSpace(Model.Column(6).Output())) 221 { 222 <div class="@(sectionClass)@(theme) @(css) item_@Model.Item.SystemName.ToLower()" @styleString data-swift-gridrow> 223 <div class="@containerClass@(hideOverflow)"> 224 <div class="grid grid-@(mobileColumnSize) grid-lg-@Model.Columns.Count()@(rowClass)"> 225 <div class="g-col @(Model.Column(1).ColumnNumber == mobileOrderFirst ? "order-first order-lg-0" : string.Empty)" data-col-size="2" @animationOnScrollCol1 style="--bs-columns:12"> 226 @Model.Column(1).Output() 227 </div> 228 <div class="g-col @(Model.Column(2).ColumnNumber == mobileOrderFirst ? "order-first order-lg-0" : string.Empty)" data-col-size="2" @animationOnScrollCol2 style="--bs-columns:12"> 229 @Model.Column(2).Output() 230 </div> 231 <div class="g-col @(Model.Column(3).ColumnNumber == mobileOrderFirst ? "order-first order-lg-0" : string.Empty)" data-col-size="2" @animationOnScrollCol3 style="--bs-columns:12"> 232 @Model.Column(3).Output() 233 </div> 234 <div class="g-col @(Model.Column(4).ColumnNumber == mobileOrderFirst ? "order-first order-lg-0" : string.Empty)" data-col-size="2" @animationOnScrollCol4 style="--bs-columns:12"> 235 @Model.Column(4).Output() 236 </div> 237 <div class="g-col @(Model.Column(5).ColumnNumber == mobileOrderFirst ? "order-first order-lg-0" : string.Empty)" data-col-size="2" @animationOnScrollCol5 style="--bs-columns:12"> 238 @Model.Column(5).Output() 239 </div> 240 <div class="g-col @(Model.Column(6).ColumnNumber == mobileOrderFirst ? "order-first order-lg-0" : string.Empty)" data-col-size="2" @animationOnScrollCol6 style="--bs-columns:12"> 241 @Model.Column(6).Output() 242 </div> 243 </div> 244 </div> 245 </div> 246 } 247 } 248
Error executing template "/Designs/Swift/Grid/Page/RowTemplates/6Columns.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_fc7b3362ec6c489fbd913d0a1564fe93.Execute() in D:\dynamicweb.net\Solutions\Dynamicweb\HCTswift.staging.dynamicweb-cms.com\files\Templates\Designs\Swift\Grid\Page\RowTemplates\6Columns.cshtml:line 177
   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 string animationOnScrollCol4 = Model.Item.GetRawValueString("AnimationOnScrollCol4", "no-animation"); 136 animationOnScrollCol4 = animationOnScrollCol4 != "no-animation" ? "data-aos=" + "'" + animationOnScrollCol4 + "'" : ""; 137 string animationOnScrollCol5 = Model.Item.GetRawValueString("AnimationOnScrollCol5", "no-animation"); 138 animationOnScrollCol5 = animationOnScrollCol5 != "no-animation" ? "data-aos=" + "'" + animationOnScrollCol5 + "'" : ""; 139 string animationOnScrollCol6 = Model.Item.GetRawValueString("AnimationOnScrollCol6", "no-animation"); 140 animationOnScrollCol6 = animationOnScrollCol6 != "no-animation" ? "data-aos=" + "'" + animationOnScrollCol6 + "'" : ""; 141 142 string hideOverflow = " overflow-hidden"; 143 hideOverflow = 144 animationOnScrollCol1 != "" || 145 animationOnScrollCol2 != "" || 146 animationOnScrollCol3 != "" || 147 animationOnScrollCol4 != "" || 148 animationOnScrollCol5 != "" || 149 animationOnScrollCol6 != "" 150 ? hideOverflow : ""; 151 152 Dynamicweb.Frontend.FileViewModel backgroundImage = Model.Item.GetFile("BackgroundImage"); 153 string backgroundImagePath = backgroundImage?.Path ?? string.Empty; 154 backgroundImagePath = !string.IsNullOrEmpty(backgroundImagePath) ? $"/Admin/Public/GetImage.ashx?image={backgroundImagePath}&width=2600&format=webp&compression=75" : string.Empty; 155 backgroundImagePath = Dynamicweb.Core.Encoders.HtmlEncoder.UrlPathEncode(backgroundImagePath); 156 string backgroundRepeat = Model.Item.GetRawValueString("BackgroundImageRepeat", "no-repeat"); 157 string backgroundImageSize = Model.Item.GetRawValueString("BackgroundImageSize", "initial"); 158 int xPos = backgroundImage?.FocalPositionFromLeft ?? 50; 159 int yPos = backgroundImage?.FocalPositionFromTop ?? 50; 160 string cssPosition = $"{xPos}% {yPos}%"; 161 string gradient = Model.Item.GetRawValueString("Gradient", string.Empty); 162 string gradientOpacity = Model.Item.GetRawValueString("GradientOpacity", "0.00"); 163 string gradientString = "linear-gradient(" + gradient + "deg," + "rgba(var(--swift-foreground-color-rgb)," + gradientOpacity + "), rgba(var(--swift-background-color-rgb)," + gradientOpacity + "))"; 164 string backgroundImageString = "url(" + backgroundImagePath + ")"; 165 string backgroundImagePositionString = "background-position:" + cssPosition + ";"; 166 string backgroundRepeatString = "background-repeat:" + backgroundRepeat + ";"; 167 string backgroundImageSizeString = "background-size:" + backgroundImageSize + ";"; 168 string styleString = string.Empty; 169 170 var decorations = Model.Item?.GetList("CssDecorations")?.GetRawValue().OfType<string>() ?? Enumerable.Empty<string>(); 171 var css = string.Empty; 172 var cssClasses = new List<string> { }; 173 174 foreach (var itemId in decorations) 175 { 176 var item = Dynamicweb.Content.Services.Items.GetItem("Swift_Css", itemId); 177 item.TryGetValue("Class", out object classes); 178 if (classes is null) 179 { 180 continue; 181 } 182 183 var cssString = (string)classes; 184 if (cssString.StartsWith("[")) 185 { 186 var cssArray = Dynamicweb.Core.Converter.Deserialize<string[]>(cssString); 187 cssClasses.AddRange(cssArray); 188 } 189 else 190 { 191 cssClasses.Add(cssString.Replace(",", " ")); 192 } 193 } 194 css = string.Join(" ", cssClasses).Trim(); 195 196 @* Only gradient *@ 197 198 if (!string.IsNullOrEmpty(gradient) && string.IsNullOrEmpty(backgroundImagePath) && gradientOpacity != ("0.00")) 199 { 200 styleString += "style=\"background-image:" + gradientString + ";\""; 201 } 202 203 @* Only background image *@ 204 205 else if (string.IsNullOrEmpty(gradient) && !string.IsNullOrEmpty(backgroundImagePath)) 206 { 207 styleString += "style=\"background-image:" + backgroundImageString + "; " + backgroundImagePositionString + backgroundRepeatString + backgroundImageSizeString + "\""; 208 } 209 210 @* Gradient and background image *@ 211 212 else if (!string.IsNullOrEmpty(gradient) && !string.IsNullOrEmpty(backgroundImagePath)) 213 { 214 styleString += "style=\"background-image:" + gradientString + "," + backgroundImageString + ";" + backgroundImagePositionString + backgroundRepeatString + backgroundImageSizeString + "\""; 215 } 216 217 int mobileColumnSize = Dynamicweb.Core.Converter.ToInt32(Model.Item.GetRawValueString("MobileColumnBehaviour", "1")); 218 int mobileOrderFirst = Dynamicweb.Core.Converter.ToInt32(Model.Item.GetRawValueString("MobileOrderFirst", "1")); 219 220 if (Pageview.IsVisualEditorMode || !string.IsNullOrWhiteSpace(Model.Column(1).Output()) || !string.IsNullOrWhiteSpace(Model.Column(2).Output()) || !string.IsNullOrWhiteSpace(Model.Column(3).Output()) || !string.IsNullOrWhiteSpace(Model.Column(4).Output()) || !string.IsNullOrWhiteSpace(Model.Column(5).Output()) || !string.IsNullOrWhiteSpace(Model.Column(6).Output())) 221 { 222 <div class="@(sectionClass)@(theme) @(css) item_@Model.Item.SystemName.ToLower()" @styleString data-swift-gridrow> 223 <div class="@containerClass@(hideOverflow)"> 224 <div class="grid grid-@(mobileColumnSize) grid-lg-@Model.Columns.Count()@(rowClass)"> 225 <div class="g-col @(Model.Column(1).ColumnNumber == mobileOrderFirst ? "order-first order-lg-0" : string.Empty)" data-col-size="2" @animationOnScrollCol1 style="--bs-columns:12"> 226 @Model.Column(1).Output() 227 </div> 228 <div class="g-col @(Model.Column(2).ColumnNumber == mobileOrderFirst ? "order-first order-lg-0" : string.Empty)" data-col-size="2" @animationOnScrollCol2 style="--bs-columns:12"> 229 @Model.Column(2).Output() 230 </div> 231 <div class="g-col @(Model.Column(3).ColumnNumber == mobileOrderFirst ? "order-first order-lg-0" : string.Empty)" data-col-size="2" @animationOnScrollCol3 style="--bs-columns:12"> 232 @Model.Column(3).Output() 233 </div> 234 <div class="g-col @(Model.Column(4).ColumnNumber == mobileOrderFirst ? "order-first order-lg-0" : string.Empty)" data-col-size="2" @animationOnScrollCol4 style="--bs-columns:12"> 235 @Model.Column(4).Output() 236 </div> 237 <div class="g-col @(Model.Column(5).ColumnNumber == mobileOrderFirst ? "order-first order-lg-0" : string.Empty)" data-col-size="2" @animationOnScrollCol5 style="--bs-columns:12"> 238 @Model.Column(5).Output() 239 </div> 240 <div class="g-col @(Model.Column(6).ColumnNumber == mobileOrderFirst ? "order-first order-lg-0" : string.Empty)" data-col-size="2" @animationOnScrollCol6 style="--bs-columns:12"> 241 @Model.Column(6).Output() 242 </div> 243 </div> 244 </div> 245 </div> 246 } 247 } 248
Error executing template "/Designs/Swift/Grid/Page/RowTemplates/6Columns.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_fc7b3362ec6c489fbd913d0a1564fe93.Execute() in D:\dynamicweb.net\Solutions\Dynamicweb\HCTswift.staging.dynamicweb-cms.com\files\Templates\Designs\Swift\Grid\Page\RowTemplates\6Columns.cshtml:line 177
   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 string animationOnScrollCol4 = Model.Item.GetRawValueString("AnimationOnScrollCol4", "no-animation"); 136 animationOnScrollCol4 = animationOnScrollCol4 != "no-animation" ? "data-aos=" + "'" + animationOnScrollCol4 + "'" : ""; 137 string animationOnScrollCol5 = Model.Item.GetRawValueString("AnimationOnScrollCol5", "no-animation"); 138 animationOnScrollCol5 = animationOnScrollCol5 != "no-animation" ? "data-aos=" + "'" + animationOnScrollCol5 + "'" : ""; 139 string animationOnScrollCol6 = Model.Item.GetRawValueString("AnimationOnScrollCol6", "no-animation"); 140 animationOnScrollCol6 = animationOnScrollCol6 != "no-animation" ? "data-aos=" + "'" + animationOnScrollCol6 + "'" : ""; 141 142 string hideOverflow = " overflow-hidden"; 143 hideOverflow = 144 animationOnScrollCol1 != "" || 145 animationOnScrollCol2 != "" || 146 animationOnScrollCol3 != "" || 147 animationOnScrollCol4 != "" || 148 animationOnScrollCol5 != "" || 149 animationOnScrollCol6 != "" 150 ? hideOverflow : ""; 151 152 Dynamicweb.Frontend.FileViewModel backgroundImage = Model.Item.GetFile("BackgroundImage"); 153 string backgroundImagePath = backgroundImage?.Path ?? string.Empty; 154 backgroundImagePath = !string.IsNullOrEmpty(backgroundImagePath) ? $"/Admin/Public/GetImage.ashx?image={backgroundImagePath}&width=2600&format=webp&compression=75" : string.Empty; 155 backgroundImagePath = Dynamicweb.Core.Encoders.HtmlEncoder.UrlPathEncode(backgroundImagePath); 156 string backgroundRepeat = Model.Item.GetRawValueString("BackgroundImageRepeat", "no-repeat"); 157 string backgroundImageSize = Model.Item.GetRawValueString("BackgroundImageSize", "initial"); 158 int xPos = backgroundImage?.FocalPositionFromLeft ?? 50; 159 int yPos = backgroundImage?.FocalPositionFromTop ?? 50; 160 string cssPosition = $"{xPos}% {yPos}%"; 161 string gradient = Model.Item.GetRawValueString("Gradient", string.Empty); 162 string gradientOpacity = Model.Item.GetRawValueString("GradientOpacity", "0.00"); 163 string gradientString = "linear-gradient(" + gradient + "deg," + "rgba(var(--swift-foreground-color-rgb)," + gradientOpacity + "), rgba(var(--swift-background-color-rgb)," + gradientOpacity + "))"; 164 string backgroundImageString = "url(" + backgroundImagePath + ")"; 165 string backgroundImagePositionString = "background-position:" + cssPosition + ";"; 166 string backgroundRepeatString = "background-repeat:" + backgroundRepeat + ";"; 167 string backgroundImageSizeString = "background-size:" + backgroundImageSize + ";"; 168 string styleString = string.Empty; 169 170 var decorations = Model.Item?.GetList("CssDecorations")?.GetRawValue().OfType<string>() ?? Enumerable.Empty<string>(); 171 var css = string.Empty; 172 var cssClasses = new List<string> { }; 173 174 foreach (var itemId in decorations) 175 { 176 var item = Dynamicweb.Content.Services.Items.GetItem("Swift_Css", itemId); 177 item.TryGetValue("Class", out object classes); 178 if (classes is null) 179 { 180 continue; 181 } 182 183 var cssString = (string)classes; 184 if (cssString.StartsWith("[")) 185 { 186 var cssArray = Dynamicweb.Core.Converter.Deserialize<string[]>(cssString); 187 cssClasses.AddRange(cssArray); 188 } 189 else 190 { 191 cssClasses.Add(cssString.Replace(",", " ")); 192 } 193 } 194 css = string.Join(" ", cssClasses).Trim(); 195 196 @* Only gradient *@ 197 198 if (!string.IsNullOrEmpty(gradient) && string.IsNullOrEmpty(backgroundImagePath) && gradientOpacity != ("0.00")) 199 { 200 styleString += "style=\"background-image:" + gradientString + ";\""; 201 } 202 203 @* Only background image *@ 204 205 else if (string.IsNullOrEmpty(gradient) && !string.IsNullOrEmpty(backgroundImagePath)) 206 { 207 styleString += "style=\"background-image:" + backgroundImageString + "; " + backgroundImagePositionString + backgroundRepeatString + backgroundImageSizeString + "\""; 208 } 209 210 @* Gradient and background image *@ 211 212 else if (!string.IsNullOrEmpty(gradient) && !string.IsNullOrEmpty(backgroundImagePath)) 213 { 214 styleString += "style=\"background-image:" + gradientString + "," + backgroundImageString + ";" + backgroundImagePositionString + backgroundRepeatString + backgroundImageSizeString + "\""; 215 } 216 217 int mobileColumnSize = Dynamicweb.Core.Converter.ToInt32(Model.Item.GetRawValueString("MobileColumnBehaviour", "1")); 218 int mobileOrderFirst = Dynamicweb.Core.Converter.ToInt32(Model.Item.GetRawValueString("MobileOrderFirst", "1")); 219 220 if (Pageview.IsVisualEditorMode || !string.IsNullOrWhiteSpace(Model.Column(1).Output()) || !string.IsNullOrWhiteSpace(Model.Column(2).Output()) || !string.IsNullOrWhiteSpace(Model.Column(3).Output()) || !string.IsNullOrWhiteSpace(Model.Column(4).Output()) || !string.IsNullOrWhiteSpace(Model.Column(5).Output()) || !string.IsNullOrWhiteSpace(Model.Column(6).Output())) 221 { 222 <div class="@(sectionClass)@(theme) @(css) item_@Model.Item.SystemName.ToLower()" @styleString data-swift-gridrow> 223 <div class="@containerClass@(hideOverflow)"> 224 <div class="grid grid-@(mobileColumnSize) grid-lg-@Model.Columns.Count()@(rowClass)"> 225 <div class="g-col @(Model.Column(1).ColumnNumber == mobileOrderFirst ? "order-first order-lg-0" : string.Empty)" data-col-size="2" @animationOnScrollCol1 style="--bs-columns:12"> 226 @Model.Column(1).Output() 227 </div> 228 <div class="g-col @(Model.Column(2).ColumnNumber == mobileOrderFirst ? "order-first order-lg-0" : string.Empty)" data-col-size="2" @animationOnScrollCol2 style="--bs-columns:12"> 229 @Model.Column(2).Output() 230 </div> 231 <div class="g-col @(Model.Column(3).ColumnNumber == mobileOrderFirst ? "order-first order-lg-0" : string.Empty)" data-col-size="2" @animationOnScrollCol3 style="--bs-columns:12"> 232 @Model.Column(3).Output() 233 </div> 234 <div class="g-col @(Model.Column(4).ColumnNumber == mobileOrderFirst ? "order-first order-lg-0" : string.Empty)" data-col-size="2" @animationOnScrollCol4 style="--bs-columns:12"> 235 @Model.Column(4).Output() 236 </div> 237 <div class="g-col @(Model.Column(5).ColumnNumber == mobileOrderFirst ? "order-first order-lg-0" : string.Empty)" data-col-size="2" @animationOnScrollCol5 style="--bs-columns:12"> 238 @Model.Column(5).Output() 239 </div> 240 <div class="g-col @(Model.Column(6).ColumnNumber == mobileOrderFirst ? "order-first order-lg-0" : string.Empty)" data-col-size="2" @animationOnScrollCol6 style="--bs-columns:12"> 241 @Model.Column(6).Output() 242 </div> 243 </div> 244 </div> 245 </div> 246 } 247 } 248
Error executing template "/Designs/Swift/Grid/Page/RowTemplates/6Columns.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_fc7b3362ec6c489fbd913d0a1564fe93.Execute() in D:\dynamicweb.net\Solutions\Dynamicweb\HCTswift.staging.dynamicweb-cms.com\files\Templates\Designs\Swift\Grid\Page\RowTemplates\6Columns.cshtml:line 177
   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 string animationOnScrollCol4 = Model.Item.GetRawValueString("AnimationOnScrollCol4", "no-animation"); 136 animationOnScrollCol4 = animationOnScrollCol4 != "no-animation" ? "data-aos=" + "'" + animationOnScrollCol4 + "'" : ""; 137 string animationOnScrollCol5 = Model.Item.GetRawValueString("AnimationOnScrollCol5", "no-animation"); 138 animationOnScrollCol5 = animationOnScrollCol5 != "no-animation" ? "data-aos=" + "'" + animationOnScrollCol5 + "'" : ""; 139 string animationOnScrollCol6 = Model.Item.GetRawValueString("AnimationOnScrollCol6", "no-animation"); 140 animationOnScrollCol6 = animationOnScrollCol6 != "no-animation" ? "data-aos=" + "'" + animationOnScrollCol6 + "'" : ""; 141 142 string hideOverflow = " overflow-hidden"; 143 hideOverflow = 144 animationOnScrollCol1 != "" || 145 animationOnScrollCol2 != "" || 146 animationOnScrollCol3 != "" || 147 animationOnScrollCol4 != "" || 148 animationOnScrollCol5 != "" || 149 animationOnScrollCol6 != "" 150 ? hideOverflow : ""; 151 152 Dynamicweb.Frontend.FileViewModel backgroundImage = Model.Item.GetFile("BackgroundImage"); 153 string backgroundImagePath = backgroundImage?.Path ?? string.Empty; 154 backgroundImagePath = !string.IsNullOrEmpty(backgroundImagePath) ? $"/Admin/Public/GetImage.ashx?image={backgroundImagePath}&width=2600&format=webp&compression=75" : string.Empty; 155 backgroundImagePath = Dynamicweb.Core.Encoders.HtmlEncoder.UrlPathEncode(backgroundImagePath); 156 string backgroundRepeat = Model.Item.GetRawValueString("BackgroundImageRepeat", "no-repeat"); 157 string backgroundImageSize = Model.Item.GetRawValueString("BackgroundImageSize", "initial"); 158 int xPos = backgroundImage?.FocalPositionFromLeft ?? 50; 159 int yPos = backgroundImage?.FocalPositionFromTop ?? 50; 160 string cssPosition = $"{xPos}% {yPos}%"; 161 string gradient = Model.Item.GetRawValueString("Gradient", string.Empty); 162 string gradientOpacity = Model.Item.GetRawValueString("GradientOpacity", "0.00"); 163 string gradientString = "linear-gradient(" + gradient + "deg," + "rgba(var(--swift-foreground-color-rgb)," + gradientOpacity + "), rgba(var(--swift-background-color-rgb)," + gradientOpacity + "))"; 164 string backgroundImageString = "url(" + backgroundImagePath + ")"; 165 string backgroundImagePositionString = "background-position:" + cssPosition + ";"; 166 string backgroundRepeatString = "background-repeat:" + backgroundRepeat + ";"; 167 string backgroundImageSizeString = "background-size:" + backgroundImageSize + ";"; 168 string styleString = string.Empty; 169 170 var decorations = Model.Item?.GetList("CssDecorations")?.GetRawValue().OfType<string>() ?? Enumerable.Empty<string>(); 171 var css = string.Empty; 172 var cssClasses = new List<string> { }; 173 174 foreach (var itemId in decorations) 175 { 176 var item = Dynamicweb.Content.Services.Items.GetItem("Swift_Css", itemId); 177 item.TryGetValue("Class", out object classes); 178 if (classes is null) 179 { 180 continue; 181 } 182 183 var cssString = (string)classes; 184 if (cssString.StartsWith("[")) 185 { 186 var cssArray = Dynamicweb.Core.Converter.Deserialize<string[]>(cssString); 187 cssClasses.AddRange(cssArray); 188 } 189 else 190 { 191 cssClasses.Add(cssString.Replace(",", " ")); 192 } 193 } 194 css = string.Join(" ", cssClasses).Trim(); 195 196 @* Only gradient *@ 197 198 if (!string.IsNullOrEmpty(gradient) && string.IsNullOrEmpty(backgroundImagePath) && gradientOpacity != ("0.00")) 199 { 200 styleString += "style=\"background-image:" + gradientString + ";\""; 201 } 202 203 @* Only background image *@ 204 205 else if (string.IsNullOrEmpty(gradient) && !string.IsNullOrEmpty(backgroundImagePath)) 206 { 207 styleString += "style=\"background-image:" + backgroundImageString + "; " + backgroundImagePositionString + backgroundRepeatString + backgroundImageSizeString + "\""; 208 } 209 210 @* Gradient and background image *@ 211 212 else if (!string.IsNullOrEmpty(gradient) && !string.IsNullOrEmpty(backgroundImagePath)) 213 { 214 styleString += "style=\"background-image:" + gradientString + "," + backgroundImageString + ";" + backgroundImagePositionString + backgroundRepeatString + backgroundImageSizeString + "\""; 215 } 216 217 int mobileColumnSize = Dynamicweb.Core.Converter.ToInt32(Model.Item.GetRawValueString("MobileColumnBehaviour", "1")); 218 int mobileOrderFirst = Dynamicweb.Core.Converter.ToInt32(Model.Item.GetRawValueString("MobileOrderFirst", "1")); 219 220 if (Pageview.IsVisualEditorMode || !string.IsNullOrWhiteSpace(Model.Column(1).Output()) || !string.IsNullOrWhiteSpace(Model.Column(2).Output()) || !string.IsNullOrWhiteSpace(Model.Column(3).Output()) || !string.IsNullOrWhiteSpace(Model.Column(4).Output()) || !string.IsNullOrWhiteSpace(Model.Column(5).Output()) || !string.IsNullOrWhiteSpace(Model.Column(6).Output())) 221 { 222 <div class="@(sectionClass)@(theme) @(css) item_@Model.Item.SystemName.ToLower()" @styleString data-swift-gridrow> 223 <div class="@containerClass@(hideOverflow)"> 224 <div class="grid grid-@(mobileColumnSize) grid-lg-@Model.Columns.Count()@(rowClass)"> 225 <div class="g-col @(Model.Column(1).ColumnNumber == mobileOrderFirst ? "order-first order-lg-0" : string.Empty)" data-col-size="2" @animationOnScrollCol1 style="--bs-columns:12"> 226 @Model.Column(1).Output() 227 </div> 228 <div class="g-col @(Model.Column(2).ColumnNumber == mobileOrderFirst ? "order-first order-lg-0" : string.Empty)" data-col-size="2" @animationOnScrollCol2 style="--bs-columns:12"> 229 @Model.Column(2).Output() 230 </div> 231 <div class="g-col @(Model.Column(3).ColumnNumber == mobileOrderFirst ? "order-first order-lg-0" : string.Empty)" data-col-size="2" @animationOnScrollCol3 style="--bs-columns:12"> 232 @Model.Column(3).Output() 233 </div> 234 <div class="g-col @(Model.Column(4).ColumnNumber == mobileOrderFirst ? "order-first order-lg-0" : string.Empty)" data-col-size="2" @animationOnScrollCol4 style="--bs-columns:12"> 235 @Model.Column(4).Output() 236 </div> 237 <div class="g-col @(Model.Column(5).ColumnNumber == mobileOrderFirst ? "order-first order-lg-0" : string.Empty)" data-col-size="2" @animationOnScrollCol5 style="--bs-columns:12"> 238 @Model.Column(5).Output() 239 </div> 240 <div class="g-col @(Model.Column(6).ColumnNumber == mobileOrderFirst ? "order-first order-lg-0" : string.Empty)" data-col-size="2" @animationOnScrollCol6 style="--bs-columns:12"> 241 @Model.Column(6).Output() 242 </div> 243 </div> 244 </div> 245 </div> 246 } 247 } 248
Error executing template "/Designs/Swift/Grid/Page/RowTemplates/6Columns.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_fc7b3362ec6c489fbd913d0a1564fe93.Execute() in D:\dynamicweb.net\Solutions\Dynamicweb\HCTswift.staging.dynamicweb-cms.com\files\Templates\Designs\Swift\Grid\Page\RowTemplates\6Columns.cshtml:line 177
   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 string animationOnScrollCol4 = Model.Item.GetRawValueString("AnimationOnScrollCol4", "no-animation"); 136 animationOnScrollCol4 = animationOnScrollCol4 != "no-animation" ? "data-aos=" + "'" + animationOnScrollCol4 + "'" : ""; 137 string animationOnScrollCol5 = Model.Item.GetRawValueString("AnimationOnScrollCol5", "no-animation"); 138 animationOnScrollCol5 = animationOnScrollCol5 != "no-animation" ? "data-aos=" + "'" + animationOnScrollCol5 + "'" : ""; 139 string animationOnScrollCol6 = Model.Item.GetRawValueString("AnimationOnScrollCol6", "no-animation"); 140 animationOnScrollCol6 = animationOnScrollCol6 != "no-animation" ? "data-aos=" + "'" + animationOnScrollCol6 + "'" : ""; 141 142 string hideOverflow = " overflow-hidden"; 143 hideOverflow = 144 animationOnScrollCol1 != "" || 145 animationOnScrollCol2 != "" || 146 animationOnScrollCol3 != "" || 147 animationOnScrollCol4 != "" || 148 animationOnScrollCol5 != "" || 149 animationOnScrollCol6 != "" 150 ? hideOverflow : ""; 151 152 Dynamicweb.Frontend.FileViewModel backgroundImage = Model.Item.GetFile("BackgroundImage"); 153 string backgroundImagePath = backgroundImage?.Path ?? string.Empty; 154 backgroundImagePath = !string.IsNullOrEmpty(backgroundImagePath) ? $"/Admin/Public/GetImage.ashx?image={backgroundImagePath}&width=2600&format=webp&compression=75" : string.Empty; 155 backgroundImagePath = Dynamicweb.Core.Encoders.HtmlEncoder.UrlPathEncode(backgroundImagePath); 156 string backgroundRepeat = Model.Item.GetRawValueString("BackgroundImageRepeat", "no-repeat"); 157 string backgroundImageSize = Model.Item.GetRawValueString("BackgroundImageSize", "initial"); 158 int xPos = backgroundImage?.FocalPositionFromLeft ?? 50; 159 int yPos = backgroundImage?.FocalPositionFromTop ?? 50; 160 string cssPosition = $"{xPos}% {yPos}%"; 161 string gradient = Model.Item.GetRawValueString("Gradient", string.Empty); 162 string gradientOpacity = Model.Item.GetRawValueString("GradientOpacity", "0.00"); 163 string gradientString = "linear-gradient(" + gradient + "deg," + "rgba(var(--swift-foreground-color-rgb)," + gradientOpacity + "), rgba(var(--swift-background-color-rgb)," + gradientOpacity + "))"; 164 string backgroundImageString = "url(" + backgroundImagePath + ")"; 165 string backgroundImagePositionString = "background-position:" + cssPosition + ";"; 166 string backgroundRepeatString = "background-repeat:" + backgroundRepeat + ";"; 167 string backgroundImageSizeString = "background-size:" + backgroundImageSize + ";"; 168 string styleString = string.Empty; 169 170 var decorations = Model.Item?.GetList("CssDecorations")?.GetRawValue().OfType<string>() ?? Enumerable.Empty<string>(); 171 var css = string.Empty; 172 var cssClasses = new List<string> { }; 173 174 foreach (var itemId in decorations) 175 { 176 var item = Dynamicweb.Content.Services.Items.GetItem("Swift_Css", itemId); 177 item.TryGetValue("Class", out object classes); 178 if (classes is null) 179 { 180 continue; 181 } 182 183 var cssString = (string)classes; 184 if (cssString.StartsWith("[")) 185 { 186 var cssArray = Dynamicweb.Core.Converter.Deserialize<string[]>(cssString); 187 cssClasses.AddRange(cssArray); 188 } 189 else 190 { 191 cssClasses.Add(cssString.Replace(",", " ")); 192 } 193 } 194 css = string.Join(" ", cssClasses).Trim(); 195 196 @* Only gradient *@ 197 198 if (!string.IsNullOrEmpty(gradient) && string.IsNullOrEmpty(backgroundImagePath) && gradientOpacity != ("0.00")) 199 { 200 styleString += "style=\"background-image:" + gradientString + ";\""; 201 } 202 203 @* Only background image *@ 204 205 else if (string.IsNullOrEmpty(gradient) && !string.IsNullOrEmpty(backgroundImagePath)) 206 { 207 styleString += "style=\"background-image:" + backgroundImageString + "; " + backgroundImagePositionString + backgroundRepeatString + backgroundImageSizeString + "\""; 208 } 209 210 @* Gradient and background image *@ 211 212 else if (!string.IsNullOrEmpty(gradient) && !string.IsNullOrEmpty(backgroundImagePath)) 213 { 214 styleString += "style=\"background-image:" + gradientString + "," + backgroundImageString + ";" + backgroundImagePositionString + backgroundRepeatString + backgroundImageSizeString + "\""; 215 } 216 217 int mobileColumnSize = Dynamicweb.Core.Converter.ToInt32(Model.Item.GetRawValueString("MobileColumnBehaviour", "1")); 218 int mobileOrderFirst = Dynamicweb.Core.Converter.ToInt32(Model.Item.GetRawValueString("MobileOrderFirst", "1")); 219 220 if (Pageview.IsVisualEditorMode || !string.IsNullOrWhiteSpace(Model.Column(1).Output()) || !string.IsNullOrWhiteSpace(Model.Column(2).Output()) || !string.IsNullOrWhiteSpace(Model.Column(3).Output()) || !string.IsNullOrWhiteSpace(Model.Column(4).Output()) || !string.IsNullOrWhiteSpace(Model.Column(5).Output()) || !string.IsNullOrWhiteSpace(Model.Column(6).Output())) 221 { 222 <div class="@(sectionClass)@(theme) @(css) item_@Model.Item.SystemName.ToLower()" @styleString data-swift-gridrow> 223 <div class="@containerClass@(hideOverflow)"> 224 <div class="grid grid-@(mobileColumnSize) grid-lg-@Model.Columns.Count()@(rowClass)"> 225 <div class="g-col @(Model.Column(1).ColumnNumber == mobileOrderFirst ? "order-first order-lg-0" : string.Empty)" data-col-size="2" @animationOnScrollCol1 style="--bs-columns:12"> 226 @Model.Column(1).Output() 227 </div> 228 <div class="g-col @(Model.Column(2).ColumnNumber == mobileOrderFirst ? "order-first order-lg-0" : string.Empty)" data-col-size="2" @animationOnScrollCol2 style="--bs-columns:12"> 229 @Model.Column(2).Output() 230 </div> 231 <div class="g-col @(Model.Column(3).ColumnNumber == mobileOrderFirst ? "order-first order-lg-0" : string.Empty)" data-col-size="2" @animationOnScrollCol3 style="--bs-columns:12"> 232 @Model.Column(3).Output() 233 </div> 234 <div class="g-col @(Model.Column(4).ColumnNumber == mobileOrderFirst ? "order-first order-lg-0" : string.Empty)" data-col-size="2" @animationOnScrollCol4 style="--bs-columns:12"> 235 @Model.Column(4).Output() 236 </div> 237 <div class="g-col @(Model.Column(5).ColumnNumber == mobileOrderFirst ? "order-first order-lg-0" : string.Empty)" data-col-size="2" @animationOnScrollCol5 style="--bs-columns:12"> 238 @Model.Column(5).Output() 239 </div> 240 <div class="g-col @(Model.Column(6).ColumnNumber == mobileOrderFirst ? "order-first order-lg-0" : string.Empty)" data-col-size="2" @animationOnScrollCol6 style="--bs-columns:12"> 241 @Model.Column(6).Output() 242 </div> 243 </div> 244 </div> 245 </div> 246 } 247 } 248
Error executing template "/Designs/Swift/Grid/Page/RowTemplates/6Columns.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_fc7b3362ec6c489fbd913d0a1564fe93.Execute() in D:\dynamicweb.net\Solutions\Dynamicweb\HCTswift.staging.dynamicweb-cms.com\files\Templates\Designs\Swift\Grid\Page\RowTemplates\6Columns.cshtml:line 177
   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 string animationOnScrollCol4 = Model.Item.GetRawValueString("AnimationOnScrollCol4", "no-animation"); 136 animationOnScrollCol4 = animationOnScrollCol4 != "no-animation" ? "data-aos=" + "'" + animationOnScrollCol4 + "'" : ""; 137 string animationOnScrollCol5 = Model.Item.GetRawValueString("AnimationOnScrollCol5", "no-animation"); 138 animationOnScrollCol5 = animationOnScrollCol5 != "no-animation" ? "data-aos=" + "'" + animationOnScrollCol5 + "'" : ""; 139 string animationOnScrollCol6 = Model.Item.GetRawValueString("AnimationOnScrollCol6", "no-animation"); 140 animationOnScrollCol6 = animationOnScrollCol6 != "no-animation" ? "data-aos=" + "'" + animationOnScrollCol6 + "'" : ""; 141 142 string hideOverflow = " overflow-hidden"; 143 hideOverflow = 144 animationOnScrollCol1 != "" || 145 animationOnScrollCol2 != "" || 146 animationOnScrollCol3 != "" || 147 animationOnScrollCol4 != "" || 148 animationOnScrollCol5 != "" || 149 animationOnScrollCol6 != "" 150 ? hideOverflow : ""; 151 152 Dynamicweb.Frontend.FileViewModel backgroundImage = Model.Item.GetFile("BackgroundImage"); 153 string backgroundImagePath = backgroundImage?.Path ?? string.Empty; 154 backgroundImagePath = !string.IsNullOrEmpty(backgroundImagePath) ? $"/Admin/Public/GetImage.ashx?image={backgroundImagePath}&width=2600&format=webp&compression=75" : string.Empty; 155 backgroundImagePath = Dynamicweb.Core.Encoders.HtmlEncoder.UrlPathEncode(backgroundImagePath); 156 string backgroundRepeat = Model.Item.GetRawValueString("BackgroundImageRepeat", "no-repeat"); 157 string backgroundImageSize = Model.Item.GetRawValueString("BackgroundImageSize", "initial"); 158 int xPos = backgroundImage?.FocalPositionFromLeft ?? 50; 159 int yPos = backgroundImage?.FocalPositionFromTop ?? 50; 160 string cssPosition = $"{xPos}% {yPos}%"; 161 string gradient = Model.Item.GetRawValueString("Gradient", string.Empty); 162 string gradientOpacity = Model.Item.GetRawValueString("GradientOpacity", "0.00"); 163 string gradientString = "linear-gradient(" + gradient + "deg," + "rgba(var(--swift-foreground-color-rgb)," + gradientOpacity + "), rgba(var(--swift-background-color-rgb)," + gradientOpacity + "))"; 164 string backgroundImageString = "url(" + backgroundImagePath + ")"; 165 string backgroundImagePositionString = "background-position:" + cssPosition + ";"; 166 string backgroundRepeatString = "background-repeat:" + backgroundRepeat + ";"; 167 string backgroundImageSizeString = "background-size:" + backgroundImageSize + ";"; 168 string styleString = string.Empty; 169 170 var decorations = Model.Item?.GetList("CssDecorations")?.GetRawValue().OfType<string>() ?? Enumerable.Empty<string>(); 171 var css = string.Empty; 172 var cssClasses = new List<string> { }; 173 174 foreach (var itemId in decorations) 175 { 176 var item = Dynamicweb.Content.Services.Items.GetItem("Swift_Css", itemId); 177 item.TryGetValue("Class", out object classes); 178 if (classes is null) 179 { 180 continue; 181 } 182 183 var cssString = (string)classes; 184 if (cssString.StartsWith("[")) 185 { 186 var cssArray = Dynamicweb.Core.Converter.Deserialize<string[]>(cssString); 187 cssClasses.AddRange(cssArray); 188 } 189 else 190 { 191 cssClasses.Add(cssString.Replace(",", " ")); 192 } 193 } 194 css = string.Join(" ", cssClasses).Trim(); 195 196 @* Only gradient *@ 197 198 if (!string.IsNullOrEmpty(gradient) && string.IsNullOrEmpty(backgroundImagePath) && gradientOpacity != ("0.00")) 199 { 200 styleString += "style=\"background-image:" + gradientString + ";\""; 201 } 202 203 @* Only background image *@ 204 205 else if (string.IsNullOrEmpty(gradient) && !string.IsNullOrEmpty(backgroundImagePath)) 206 { 207 styleString += "style=\"background-image:" + backgroundImageString + "; " + backgroundImagePositionString + backgroundRepeatString + backgroundImageSizeString + "\""; 208 } 209 210 @* Gradient and background image *@ 211 212 else if (!string.IsNullOrEmpty(gradient) && !string.IsNullOrEmpty(backgroundImagePath)) 213 { 214 styleString += "style=\"background-image:" + gradientString + "," + backgroundImageString + ";" + backgroundImagePositionString + backgroundRepeatString + backgroundImageSizeString + "\""; 215 } 216 217 int mobileColumnSize = Dynamicweb.Core.Converter.ToInt32(Model.Item.GetRawValueString("MobileColumnBehaviour", "1")); 218 int mobileOrderFirst = Dynamicweb.Core.Converter.ToInt32(Model.Item.GetRawValueString("MobileOrderFirst", "1")); 219 220 if (Pageview.IsVisualEditorMode || !string.IsNullOrWhiteSpace(Model.Column(1).Output()) || !string.IsNullOrWhiteSpace(Model.Column(2).Output()) || !string.IsNullOrWhiteSpace(Model.Column(3).Output()) || !string.IsNullOrWhiteSpace(Model.Column(4).Output()) || !string.IsNullOrWhiteSpace(Model.Column(5).Output()) || !string.IsNullOrWhiteSpace(Model.Column(6).Output())) 221 { 222 <div class="@(sectionClass)@(theme) @(css) item_@Model.Item.SystemName.ToLower()" @styleString data-swift-gridrow> 223 <div class="@containerClass@(hideOverflow)"> 224 <div class="grid grid-@(mobileColumnSize) grid-lg-@Model.Columns.Count()@(rowClass)"> 225 <div class="g-col @(Model.Column(1).ColumnNumber == mobileOrderFirst ? "order-first order-lg-0" : string.Empty)" data-col-size="2" @animationOnScrollCol1 style="--bs-columns:12"> 226 @Model.Column(1).Output() 227 </div> 228 <div class="g-col @(Model.Column(2).ColumnNumber == mobileOrderFirst ? "order-first order-lg-0" : string.Empty)" data-col-size="2" @animationOnScrollCol2 style="--bs-columns:12"> 229 @Model.Column(2).Output() 230 </div> 231 <div class="g-col @(Model.Column(3).ColumnNumber == mobileOrderFirst ? "order-first order-lg-0" : string.Empty)" data-col-size="2" @animationOnScrollCol3 style="--bs-columns:12"> 232 @Model.Column(3).Output() 233 </div> 234 <div class="g-col @(Model.Column(4).ColumnNumber == mobileOrderFirst ? "order-first order-lg-0" : string.Empty)" data-col-size="2" @animationOnScrollCol4 style="--bs-columns:12"> 235 @Model.Column(4).Output() 236 </div> 237 <div class="g-col @(Model.Column(5).ColumnNumber == mobileOrderFirst ? "order-first order-lg-0" : string.Empty)" data-col-size="2" @animationOnScrollCol5 style="--bs-columns:12"> 238 @Model.Column(5).Output() 239 </div> 240 <div class="g-col @(Model.Column(6).ColumnNumber == mobileOrderFirst ? "order-first order-lg-0" : string.Empty)" data-col-size="2" @animationOnScrollCol6 style="--bs-columns:12"> 241 @Model.Column(6).Output() 242 </div> 243 </div> 244 </div> 245 </div> 246 } 247 } 248