Error executing template "/Designs/randers-tegl/Paragraph/test.rt-2.0.product-action.cshtml" System.NullReferenceException: Object reference not set to an instance of an object. at CompiledRazorTemplates.Dynamic.RazorEngine_55b95bae9ca74430bb904fa53a413c91.Execute() in D:\dynamicweb.net\Solutions\Gotcha\randerstegl.cloud.dynamicweb-cms.com\files\Templates\Designs\randers-tegl\Paragraph\test.rt-2.0.product-action.cshtml:line 6 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 @{ 2 string productid = System.Web.HttpContext.Current.Request.QueryString.Get("ProductID"); 3 4 Dynamicweb.Ecommerce.Products.Product p = Dynamicweb.Ecommerce.Services.Products.GetProductById(productid, "", true); 5 6 string productname = p.Name; 7 string productnumber = p.Number; 8 string categoryName = p.Groups[0].Name.ToLower(); 9 } 10 11 <div class="column-xxs-12 column-md-8 column-xxs-top-1 column-xxs-bottom-1 column-sm-top-0 column-sm-bottom-0" id='@GetString("Item.ActionID")@("-action")'><div class="wrap-inner"> 12 @{ 13 bool islink = false; 14 string link = ""; 15 16 if (GetString("Item.Type") == "link") { 17 islink = true; 18 link = GetString("Item.Link"); 19 bool hasparameter = false; 20 21 if (GetBoolean("Item.IncludeRTNumberInURL")) { 22 link += GetString("Item.URLParameterName") + "=" + productnumber.Replace(" ",""); 23 24 hasparameter = true; 25 } 26 27 if (GetBoolean("Item.IsVisualizationToolLink")) { 28 string brick = p.ProductFieldValues.GetProductFieldValue("VisualizationBrick").Value.ToString(); 29 string groove = p.ProductFieldValues.GetProductFieldValue("VisualizationGroove").Value.ToString(); 30 string linking = p.ProductFieldValues.GetProductFieldValue("VisualizationLinking").Value.ToString(); 31 string paving = p.ProductFieldValues.GetProductFieldValue("VisualizationPaving").Value.ToString(); 32 string roof = p.ProductFieldValues.GetProductFieldValue("VisualizationRoof").Value.ToString(); 33 string house = p.ProductFieldValues.GetProductFieldValue("VisualizationHouse").Value.ToString(); 34 string windows = p.ProductFieldValues.GetProductFieldValue("VisualizationWindows").Value.ToString(); 35 string rnd = p.ProductFieldValues.GetProductFieldValue("VisualizationRnd").Value.ToString(); 36 string viewmode = p.ProductFieldValues.GetProductFieldValue("VisualizationViewmode").Value.ToString(); 37 38 if (categoryName == "mursten") { 39 link += "#brick=" + productnumber.Replace(" ",""); 40 } else if (!string.IsNullOrWhiteSpace(brick)) { 41 link += "#brick=" + brick; 42 } else { 43 link += "#brick=RT522"; 44 } 45 46 if (!string.IsNullOrWhiteSpace(groove)) { 47 link += "&groove=" + groove; 48 } 49 50 if (!string.IsNullOrWhiteSpace(linking)) { 51 link += "&linking=" + linking; 52 } 53 54 if (!string.IsNullOrWhiteSpace(paving)) { 55 link += "&paving=" + paving; 56 } 57 58 if (categoryName == "tagsten") { 59 link += "&roof=" + productnumber.Replace(" ","_"); 60 } else if (!string.IsNullOrWhiteSpace(roof)) { 61 link += "&roof=" + roof; 62 } 63 64 if (!string.IsNullOrWhiteSpace(house)) { 65 link += "&house=" + house; 66 } else if (categoryName == "tagsten") { 67 link += "&house=05"; 68 } 69 70 if (!string.IsNullOrWhiteSpace(windows)) { 71 link += "&windows=" + windows; 72 } 73 74 if (!string.IsNullOrWhiteSpace(rnd)) { 75 link += "&rnd=" + rnd; 76 } 77 78 if (!string.IsNullOrWhiteSpace(viewmode)) { 79 link += "&viewmode=" + viewmode; 80 } else { 81 link += "&viewmode=house"; 82 } 83 } 84 } 85 86 string iconClass = GetString("Item.Icon"); 87 iconClass = iconClass.Substring(iconClass.LastIndexOf("/") + 1); 88 iconClass = iconClass.Replace(".svg",""); 89 } 90 @if (GetString("Item.Type") == "inline-form" || GetString("Item.Type") == "custom") { 91 if (GetString("Item.Type") == "inline-form") { 92 <a class="tablet-desktop-link" @if(!string.IsNullOrWhiteSpace(GetString("Item.LinkTitle"))) {<text>title='@GetString("Item.LinkTitle")'</text>} @if (GetBoolean("Item.IsReferenceForm") && p.ProductFieldValues.GetProductFieldValue("ShowNewReferenceTool").Value.ToString() == "False") {<text>href="mailto:@Translate("RT-2.0_Reference_mail_modtager")?subject=@productnumber - @Translate("RT-2.0_Forespørgsel_på_referenceadresse_mail_emne")&body=@Translate("RT-2.0_Forespørgsel_på_referenceadresse_mail_body")"</text>}><span class='icon @iconClass'> 93 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath(GetString("Item.Icon"))) 94 </span><h2> 95 @GetString("Item.Header").Replace("[RTXXX]",@productnumber) 96 <span>@GetString("Item.Subheader").Replace("[RTXXX]",@productnumber)</span></h2> 97 @if (GetBoolean("Item.IsReferenceForm")) { 98 if (p.ProductFieldValues.GetProductFieldValue("ShowNewReferenceTool").Value.ToString() == "True") { 99 <text>@RenderParagraphContent(GetInteger("Item.FormParagraph"))</text> 100 } else { 101 <span><span class="arrow-link"> 102 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/files/templates/designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg"))) { 103 <span> 104 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/files/templates/designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 105 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/files/templates/designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 106 </span> 107 } 108 </span> 109 @Translate("RT-2.0_Spørg_på_referenceadresser") 110 </span> 111 } 112 113 } else { 114 <text>@RenderParagraphContent(GetInteger("Item.FormParagraph"))</text> 115 } 116 </a><a class="mobile-link" 117 118 @if (GetBoolean("Item.IsReferenceForm") && p.ProductFieldValues.GetProductFieldValue("ShowNewReferenceTool").Value.ToString() == "True") {<text>data-target='product-modal-@GetString("Item.Id")'</text>} @if (GetBoolean("Item.IsReferenceForm") && p.ProductFieldValues.GetProductFieldValue("ShowNewReferenceTool").Value.ToString() == "False") {<text>href="mailto:@Translate("RT-2.0_Reference_mail_modtager")?subject=@productnumber - @Translate("RT-2.0_Forespørgsel_på_referenceadresse_mail_emne")&body=@Translate("RT-2.0_Forespørgsel_på_referenceadresse_mail_body")"</text>}><span class='icon @iconClass'> 119 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath(GetString("Item.Icon"))) 120 </span> 121 @if (GetBoolean("Item.IsReferenceForm")) { 122 if (p.ProductFieldValues.GetProductFieldValue("ShowNewReferenceTool").Value.ToString() == "True") { 123 <h2><span>@GetString("Item.MobileHeader").Replace("[RTXXX]",@productnumber)</span></h2> 124 } else { 125 <h2><span>@Translate("RT-2.0_Spørg_på_referenceadresser")</span></h2> 126 } 127 } else { 128 <h2><span>@GetString("Item.MobileHeader").Replace("[RTXXX]",@productnumber)</span></h2> 129 } 130 </a> 131 @SnippetStart("Modals") 132 <div id='product-modal-@GetString("Item.Id")' class="product-modal modal-light"><div class="column-xxs-22 column-lg-18 column-xl-14 column-xxs-left-1 column-lg-left-3 column-xl-left-5 column-xxs-top-6 column-xxs-bottom-2 column-md-top-2"><div class="wrap-inner"><div class="column-xxs-24"><span class="header"> 133 @GetString("Item.Header").Replace("[RTXXX]",@productnumber) 134 <span>@GetString("Item.Subheader").Replace("[RTXXX]",@productnumber)</span></span></div></div></div><div class="column-xxs-22 column-lg-18 column-xl-14 column-xxs-left-1 column-lg-left-3 column-xl-left-5"> 135 @RenderParagraphContent(GetInteger("Item.FormParagraph")) 136 </div><span class="icon-close"> 137 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/files/templates/designs/randers-tegl/images-rt-2.0/icon-close.svg"))) { 138 <text>@System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/files/templates/designs/randers-tegl/images-rt-2.0/icon-close.svg"))</text> 139 } 140 </span></div> 141 @SnippetEnd("Modals") 142 } else { 143 <a class="tablet-desktop-link" @if(!string.IsNullOrWhiteSpace(GetString("Item.LinkTitle"))) {<text>title='@GetString("Item.LinkTitle")'</text>}><span class='icon @iconClass'> 144 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath(GetString("Item.Icon"))) 145 </span><h2> 146 @GetString("Item.Header").Replace("[RTXXX]",@productnumber) 147 <span>@GetString("Item.Subheader").Replace("[RTXXX]",@productnumber)</span></h2><form action='/Default.aspx?Id=@GetString("Item.PostPage")' method="post"><div class="input-wrap"><input type="text" name='@GetString("Item.FieldName")' placeholder='@GetString("Item.FieldPlaceholder")' autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" /><span class="arrow-link"> 148 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/files/templates/designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg"))) { 149 <span> 150 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/files/templates/designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 151 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/files/templates/designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 152 </span> 153 } 154 </span></div></form></a><a class="mobile-link" data-target='product-modal-@GetString("Item.Id")'><span class='icon @iconClass'> 155 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath(GetString("Item.Icon"))) 156 </span><h2><span>@GetString("Item.MobileHeader").Replace("[RTXXX]",@productnumber)</span></h2></a> 157 @SnippetStart("Modals") 158 <div id='product-modal-@GetString("Item.Id")' class="product-modal modal-light"><div class="column-xxs-22 column-lg-18 column-xl-14 column-xxs-left-1 column-lg-left-3 column-xl-left-5 column-xxs-top-6 column-xxs-bottom-2 column-md-top-2"><div class="wrap-inner"><div class="column-xxs-24"><span class="header"> 159 @GetString("Item.Header").Replace("[RTXXX]",@productnumber) 160 <span>@GetString("Item.Subheader").Replace("[RTXXX]",@productnumber)</span></span></div></div></div><div class="column-xxs-22 column-lg-18 column-xl-14 column-xxs-left-1 column-lg-left-3 column-xl-left-5 column-xxs-top-6 column-xxs-bottom-2 column-md-top-2"><form action='/Default.aspx?Id=@GetString("Item.PostPage")' method="post"><div class="input-wrap"><input type="text" name='@GetString("Item.FieldName")' placeholder='@GetString("Item.FieldPlaceholder")' autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" /><span class="arrow-link"> 161 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/files/templates/designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg"))) { 162 <span> 163 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/files/templates/designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 164 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/files/templates/designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 165 </span> 166 } 167 </span></div></form></div><span class="icon-close"> 168 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/files/templates/designs/randers-tegl/images-rt-2.0/icon-close.svg"))) { 169 <text>@System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/files/templates/designs/randers-tegl/images-rt-2.0/icon-close.svg"))</text> 170 } 171 </span></div> 172 @SnippetEnd("Modals") 173 } 174 } else { 175 <a 176 @if(GetString("Item.Type") == "link") {<text>href=@link</text>} 177 @if(!string.IsNullOrWhiteSpace(GetString("Item.LinkTitle"))) {<text>title='@GetString("Item.LinkTitle")'</text>} 178 @if(GetString("Item.Type") == "modal-form") {<text>data-target='modal-@GetString("Item.ModalFormParagraph")'</text>} 179 @if (GetBoolean("Item.IsVisualizationToolLink")) {<text>target="_blank"</text>} 180 @if (!string.IsNullOrWhiteSpace(GetString("Item.OpenTrackingCategory"))) {<text>data-open-tracking-category='@GetString("Item.OpenTrackingCategory")'</text>} 181 @if (!string.IsNullOrWhiteSpace(GetString("Item.OpenTrackingAction"))) {<text>data-open-tracking-action='@GetString("Item.OpenTrackingAction")'</text>}><span class='icon @iconClass'> 182 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath(GetString("Item.Icon"))) 183 </span><h2> 184 @GetString("Item.Header").Replace("[RTXXX]",@productnumber) 185 <span>@GetString("Item.Subheader").Replace("[RTXXX]",@productnumber)</span></h2><h2><span>@GetString("Item.MobileHeader").Replace("[RTXXX]",@productnumber)</span></h2> 186 @if (GetString("Item.Type") == "link") { 187 <span><span class="arrow-link"> 188 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/files/templates/designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg"))) { 189 <span> 190 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/files/templates/designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 191 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/files/templates/designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 192 </span> 193 } 194 </span> 195 @GetString("Item.LinkText") 196 </span> 197 } else if (GetString("Item.Type") == "modal-form") { 198 <span><span class="arrow-link"> 199 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/files/templates/designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg"))) { 200 <span> 201 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/files/templates/designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 202 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/files/templates/designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 203 </span> 204 } 205 </span> 206 @GetString("Item.FormLinkText") 207 </span> 208 } 209 </a> 210 } 211 </div></div>
Error executing template "/Designs/randers-tegl/Paragraph/rt-2.0.product-action.cshtml" System.NullReferenceException: Object reference not set to an instance of an object. at CompiledRazorTemplates.Dynamic.RazorEngine_0a125ffb5fab4b5e9b2b21f7eda05ea9.Execute() in D:\dynamicweb.net\Solutions\Gotcha\randerstegl.cloud.dynamicweb-cms.com\files\Templates\Designs\randers-tegl\Paragraph\rt-2.0.product-action.cshtml:line 6 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 @{ 2 string productid = System.Web.HttpContext.Current.Request.QueryString.Get("ProductID"); 3 4 Dynamicweb.Ecommerce.Products.Product p = Dynamicweb.Ecommerce.Services.Products.GetProductById(productid, "", false); 5 6 string productname = p.Name; 7 string productnumber = p.Number; 8 string categoryName = p.Groups[0].Name.ToLower(); 9 } 10 11 @if (!GetString("Item.ExcludeProducts").Contains(productnumber)) { 12 <div class="column-xxs-12 column-md-8 column-xxs-top-1 column-xxs-bottom-1 column-sm-top-0 column-sm-bottom-0" id='@GetString("Item.ActionID")@("-action")'><div class="wrap-inner"> 13 @{ 14 bool islink = false; 15 string link = ""; 16 17 if (GetString("Item.Type") == "link") { 18 islink = true; 19 link = GetString("Item.Link"); 20 bool hasparameter = false; 21 22 if (GetBoolean("Item.IncludeRTNumberInURL")) { 23 link += (GetString("Item.Link").Contains("?") ? "&" : "?"); 24 25 if (!string.IsNullOrWhiteSpace(GetString("Item.URLParameterName"))) { 26 link += GetString("Item.URLParameterName") + "=" + productnumber.Replace(" ",""); 27 } else { 28 link += "ProductID=" + productid; 29 } 30 31 hasparameter = true; 32 } 33 34 if (GetBoolean("Item.IsVisualizationToolLink")) { 35 string brick = p.ProductFieldValues.GetProductFieldValue("VisualizationBrick").Value.ToString(); 36 string groove = p.ProductFieldValues.GetProductFieldValue("VisualizationGroove").Value.ToString(); 37 string linking = p.ProductFieldValues.GetProductFieldValue("VisualizationLinking").Value.ToString(); 38 string paving = p.ProductFieldValues.GetProductFieldValue("VisualizationPaving").Value.ToString(); 39 string roof = p.ProductFieldValues.GetProductFieldValue("VisualizationRoof").Value.ToString(); 40 string house = p.ProductFieldValues.GetProductFieldValue("VisualizationHouse").Value.ToString(); 41 string windows = p.ProductFieldValues.GetProductFieldValue("VisualizationWindows").Value.ToString(); 42 string rnd = p.ProductFieldValues.GetProductFieldValue("VisualizationRnd").Value.ToString(); 43 string viewmode = p.ProductFieldValues.GetProductFieldValue("VisualizationViewmode").Value.ToString(); 44 45 if (categoryName == "mursten") { 46 link += "#brick=" + productnumber.Replace(" ",""); 47 } else if (!string.IsNullOrWhiteSpace(brick)) { 48 link += "#brick=" + brick; 49 } else { 50 link += "#brick=RT522"; 51 } 52 53 if (!string.IsNullOrWhiteSpace(groove)) { 54 link += "&groove=" + groove; 55 } 56 57 if (!string.IsNullOrWhiteSpace(linking)) { 58 link += "&linking=" + linking; 59 } 60 61 if (!string.IsNullOrWhiteSpace(paving)) { 62 link += "&paving=" + paving; 63 } 64 65 if (categoryName == "tagsten") { 66 link += "&roof=" + productnumber.Replace(" ","_"); 67 } else if (!string.IsNullOrWhiteSpace(roof)) { 68 link += "&roof=" + roof; 69 } 70 71 if (!string.IsNullOrWhiteSpace(house)) { 72 link += "&house=" + house; 73 } else if (categoryName == "tagsten") { 74 link += "&house=05"; 75 } 76 77 if (!string.IsNullOrWhiteSpace(windows)) { 78 link += "&windows=" + windows; 79 } 80 81 if (!string.IsNullOrWhiteSpace(rnd)) { 82 link += "&rnd=" + rnd; 83 } 84 85 if (!string.IsNullOrWhiteSpace(viewmode)) { 86 link += "&viewmode=" + viewmode; 87 } else { 88 link += "&viewmode=house"; 89 } 90 } 91 if (GetBoolean("Item.IsTextureToolLink")) { 92 string groove = p.ProductFieldValues.GetProductFieldValue("VisualizationGroove").Value.ToString(); 93 string linking = p.ProductFieldValues.GetProductFieldValue("VisualizationLinking").Value.ToString(); 94 string viewmode = p.ProductFieldValues.GetProductFieldValue("VisualizationViewmode").Value.ToString(); 95 96 if (categoryName == "mursten") { 97 link += "#brick=" + productnumber.Replace(" ",""); 98 } else { 99 link += "#brick=RT522"; 100 } 101 102 if (!string.IsNullOrWhiteSpace(groove)) { 103 link += "&groove=" + groove; 104 } 105 106 if (!string.IsNullOrWhiteSpace(linking)) { 107 link += "&linking=" + linking; 108 } 109 110 if (!string.IsNullOrWhiteSpace(viewmode)) { 111 link += "&viewmode=" + viewmode; 112 } else { 113 link += "&viewmode=wall"; 114 } 115 } 116 } 117 118 string iconClass = GetString("Item.Icon"); 119 iconClass = iconClass.Substring(iconClass.LastIndexOf("/") + 1); 120 iconClass = iconClass.Replace(".svg",""); 121 } 122 @if (GetString("Item.Type") == "inline-form" || GetString("Item.Type") == "custom") { 123 if (GetString("Item.Type") == "inline-form") { 124 <a class="tablet-desktop-link" @if(!string.IsNullOrWhiteSpace(GetString("Item.LinkTitle"))) {<text>title='@GetString("Item.LinkTitle")'</text>} @if (GetBoolean("Item.IsReferenceForm") && p.ProductFieldValues.GetProductFieldValue("ShowNewReferenceTool").Value.ToString() == "False") {<text>href="mailto:@Translate("RT-2.0_Reference_mail_modtager")?subject=@productnumber - @Translate("RT-2.0_Forespørgsel_på_referenceadresse_mail_emne")&body=@Translate("RT-2.0_Forespørgsel_på_referenceadresse_mail_body")"</text>}><span class='icon @iconClass'> 125 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath(GetString("Item.Icon"))) 126 </span><h2> 127 @GetString("Item.Header").Replace("[RTXXX]",@productnumber) 128 <span>@GetString("Item.Subheader").Replace("[RTXXX]",@productnumber)</span></h2> 129 @if (GetBoolean("Item.IsReferenceForm")) { 130 if (p.ProductFieldValues.GetProductFieldValue("ShowNewReferenceTool").Value.ToString() == "True") { 131 <text>@RenderParagraphContent(GetInteger("Item.FormParagraph"))</text> 132 } else { 133 <span><span class="arrow-link"> 134 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg"))) { 135 <span> 136 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 137 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 138 </span> 139 } 140 </span> 141 @Translate("RT-2.0_Spørg_på_referenceadresser") 142 </span> 143 } 144 145 } else { 146 <text>@RenderParagraphContent(GetInteger("Item.FormParagraph"))</text> 147 } 148 </a><a class="mobile-link" 149 150 @if (GetBoolean("Item.IsReferenceForm") && p.ProductFieldValues.GetProductFieldValue("ShowNewReferenceTool").Value.ToString() == "True") {<text>data-target='product-modal-@GetString("Item.Id")'</text>} @if (GetBoolean("Item.IsReferenceForm") && p.ProductFieldValues.GetProductFieldValue("ShowNewReferenceTool").Value.ToString() == "False") {<text>href="mailto:@Translate("RT-2.0_Reference_mail_modtager")?subject=@productnumber - @Translate("RT-2.0_Forespørgsel_på_referenceadresse_mail_emne")&body=@Translate("RT-2.0_Forespørgsel_på_referenceadresse_mail_body")"</text>}><span class='icon @iconClass'> 151 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath(GetString("Item.Icon"))) 152 </span> 153 @if (GetBoolean("Item.IsReferenceForm")) { 154 if (p.ProductFieldValues.GetProductFieldValue("ShowNewReferenceTool").Value.ToString() == "True") { 155 <h2><span>@GetString("Item.MobileHeader").Replace("[RTXXX]",@productnumber)</span></h2> 156 } else { 157 <h2><span>@Translate("RT-2.0_Spørg_på_referenceadresser")</span></h2> 158 } 159 } else { 160 <h2><span>@GetString("Item.MobileHeader").Replace("[RTXXX]",@productnumber)</span></h2> 161 } 162 </a> 163 @SnippetStart("Modals") 164 <div id='product-modal-@GetString("Item.Id")' class="product-modal modal-light"><div class="column-xxs-22 column-lg-18 column-xl-14 column-xxs-left-1 column-lg-left-3 column-xl-left-5 column-xxs-top-6 column-xxs-bottom-2 column-md-top-2"><div class="wrap-inner"><div class="column-xxs-24"><span class="header"> 165 @GetString("Item.Header").Replace("[RTXXX]",@productnumber) 166 <span>@GetString("Item.Subheader").Replace("[RTXXX]",@productnumber)</span></span></div></div></div><div class="column-xxs-22 column-lg-18 column-xl-14 column-xxs-left-1 column-lg-left-3 column-xl-left-5"> 167 @RenderParagraphContent(GetInteger("Item.FormParagraph")) 168 </div><span class="icon-close"> 169 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-close.svg"))) { 170 <text>@System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-close.svg"))</text> 171 } 172 </span></div> 173 @SnippetEnd("Modals") 174 } else { 175 <a class="tablet-desktop-link" @if(!string.IsNullOrWhiteSpace(GetString("Item.LinkTitle"))) {<text>title='@GetString("Item.LinkTitle")'</text>}><span class='icon @iconClass'> 176 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath(GetString("Item.Icon"))) 177 </span><h2> 178 @GetString("Item.Header").Replace("[RTXXX]",@productnumber) 179 <span>@GetString("Item.Subheader").Replace("[RTXXX]",@productnumber)</span></h2><form action='/Default.aspx?Id=@GetString("Item.PostPage")' method="post" id='dw-form-@GetString("ParagraphID")'><div class="input-wrap"><input type="text" name='@GetString("Item.FieldName")' placeholder='@GetString("Item.FieldPlaceholder")' autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" /><button class="arrow-link"> 180 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg"))) { 181 <span> 182 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 183 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 184 </span> 185 } 186 </button></div></form></a><a class="mobile-link" data-target='product-modal-@GetString("Item.Id")'><span class='icon @iconClass'> 187 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath(GetString("Item.Icon"))) 188 </span><h2><span>@GetString("Item.MobileHeader").Replace("[RTXXX]",@productnumber)</span></h2></a> 189 @SnippetStart("Modals") 190 <div id='product-modal-@GetString("Item.Id")' class="product-modal modal-light"><div class="column-xxs-22 column-lg-18 column-xl-14 column-xxs-left-1 column-lg-left-3 column-xl-left-5 column-xxs-top-6 column-xxs-bottom-2 column-md-top-2"><div class="wrap-inner"><div class="column-xxs-24"><span class="header"> 191 @GetString("Item.Header").Replace("[RTXXX]",@productnumber) 192 <span>@GetString("Item.Subheader").Replace("[RTXXX]",@productnumber)</span></span></div></div></div><div class="column-xxs-22 column-lg-18 column-xl-14 column-xxs-left-1 column-lg-left-3 column-xl-left-5 column-xxs-top-6 column-xxs-bottom-2 column-md-top-2"><form action='/Default.aspx?Id=@GetString("Item.PostPage")' method="post" id='dw-form-@GetString("ParagraphID")'><div class="input-wrap"><input type="text" name='@GetString("Item.FieldName")' placeholder='@GetString("Item.FieldPlaceholder")' autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" /><button class="arrow-link"> 193 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg"))) { 194 <span> 195 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 196 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 197 </span> 198 } 199 </button></div></form></div><span class="icon-close"> 200 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-close.svg"))) { 201 <text>@System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-close.svg"))</text> 202 } 203 </span></div> 204 @SnippetEnd("Modals") 205 } 206 } else { 207 <a @if(GetString("Item.Type") == "link") {<text>href=@link</text>} 208 @if(!string.IsNullOrWhiteSpace(GetString("Item.LinkTitle"))) {<text>title='@GetString("Item.LinkTitle")'</text>} 209 @if(GetString("Item.Type") == "modal-form") {<text>data-target='modal-@GetString("Item.ModalFormParagraph")'</text>} 210 @(GetString("Item.ActionID") == "samples" ? "data-callback='hubspotLoad'" : null) 211 @if (GetBoolean("Item.IsVisualizationToolLink")) {<text>target="_blank"</text>} 212 @if (!string.IsNullOrWhiteSpace(GetString("Item.OpenTrackingCategory"))) {<text>data-open-tracking-category='@GetString("Item.OpenTrackingCategory")'</text>} 213 @if (!string.IsNullOrWhiteSpace(GetString("Item.OpenTrackingAction"))) {<text>data-open-tracking-action='@GetString("Item.OpenTrackingAction")'</text>}><span class='icon @iconClass'> 214 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath(GetString("Item.Icon"))) 215 </span><h2> 216 @GetString("Item.Header").Replace("[RTXXX]",@productnumber) 217 <span>@GetString("Item.Subheader").Replace("[RTXXX]",@productnumber)</span></h2><h2><span>@GetString("Item.MobileHeader").Replace("[RTXXX]",@productnumber)</span></h2> 218 @if (GetString("Item.Type") == "link") { 219 <span><span class="arrow-link"> 220 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg"))) { 221 <span> 222 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 223 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 224 </span> 225 } 226 </span> 227 @GetString("Item.LinkText") 228 </span> 229 } else if (GetString("Item.Type") == "modal-form") { 230 <span><span class="arrow-link"> 231 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg"))) { 232 <span> 233 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 234 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 235 </span> 236 } 237 </span> 238 @GetString("Item.FormLinkText") 239 </span> 240 } 241 </a> 242 } 243 </div></div> 244 } 245
Error executing template "/Designs/randers-tegl/Paragraph/rt-2.0.product-action.cshtml" System.NullReferenceException: Object reference not set to an instance of an object. at CompiledRazorTemplates.Dynamic.RazorEngine_0a125ffb5fab4b5e9b2b21f7eda05ea9.Execute() in D:\dynamicweb.net\Solutions\Gotcha\randerstegl.cloud.dynamicweb-cms.com\files\Templates\Designs\randers-tegl\Paragraph\rt-2.0.product-action.cshtml:line 6 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 @{ 2 string productid = System.Web.HttpContext.Current.Request.QueryString.Get("ProductID"); 3 4 Dynamicweb.Ecommerce.Products.Product p = Dynamicweb.Ecommerce.Services.Products.GetProductById(productid, "", false); 5 6 string productname = p.Name; 7 string productnumber = p.Number; 8 string categoryName = p.Groups[0].Name.ToLower(); 9 } 10 11 @if (!GetString("Item.ExcludeProducts").Contains(productnumber)) { 12 <div class="column-xxs-12 column-md-8 column-xxs-top-1 column-xxs-bottom-1 column-sm-top-0 column-sm-bottom-0" id='@GetString("Item.ActionID")@("-action")'><div class="wrap-inner"> 13 @{ 14 bool islink = false; 15 string link = ""; 16 17 if (GetString("Item.Type") == "link") { 18 islink = true; 19 link = GetString("Item.Link"); 20 bool hasparameter = false; 21 22 if (GetBoolean("Item.IncludeRTNumberInURL")) { 23 link += (GetString("Item.Link").Contains("?") ? "&" : "?"); 24 25 if (!string.IsNullOrWhiteSpace(GetString("Item.URLParameterName"))) { 26 link += GetString("Item.URLParameterName") + "=" + productnumber.Replace(" ",""); 27 } else { 28 link += "ProductID=" + productid; 29 } 30 31 hasparameter = true; 32 } 33 34 if (GetBoolean("Item.IsVisualizationToolLink")) { 35 string brick = p.ProductFieldValues.GetProductFieldValue("VisualizationBrick").Value.ToString(); 36 string groove = p.ProductFieldValues.GetProductFieldValue("VisualizationGroove").Value.ToString(); 37 string linking = p.ProductFieldValues.GetProductFieldValue("VisualizationLinking").Value.ToString(); 38 string paving = p.ProductFieldValues.GetProductFieldValue("VisualizationPaving").Value.ToString(); 39 string roof = p.ProductFieldValues.GetProductFieldValue("VisualizationRoof").Value.ToString(); 40 string house = p.ProductFieldValues.GetProductFieldValue("VisualizationHouse").Value.ToString(); 41 string windows = p.ProductFieldValues.GetProductFieldValue("VisualizationWindows").Value.ToString(); 42 string rnd = p.ProductFieldValues.GetProductFieldValue("VisualizationRnd").Value.ToString(); 43 string viewmode = p.ProductFieldValues.GetProductFieldValue("VisualizationViewmode").Value.ToString(); 44 45 if (categoryName == "mursten") { 46 link += "#brick=" + productnumber.Replace(" ",""); 47 } else if (!string.IsNullOrWhiteSpace(brick)) { 48 link += "#brick=" + brick; 49 } else { 50 link += "#brick=RT522"; 51 } 52 53 if (!string.IsNullOrWhiteSpace(groove)) { 54 link += "&groove=" + groove; 55 } 56 57 if (!string.IsNullOrWhiteSpace(linking)) { 58 link += "&linking=" + linking; 59 } 60 61 if (!string.IsNullOrWhiteSpace(paving)) { 62 link += "&paving=" + paving; 63 } 64 65 if (categoryName == "tagsten") { 66 link += "&roof=" + productnumber.Replace(" ","_"); 67 } else if (!string.IsNullOrWhiteSpace(roof)) { 68 link += "&roof=" + roof; 69 } 70 71 if (!string.IsNullOrWhiteSpace(house)) { 72 link += "&house=" + house; 73 } else if (categoryName == "tagsten") { 74 link += "&house=05"; 75 } 76 77 if (!string.IsNullOrWhiteSpace(windows)) { 78 link += "&windows=" + windows; 79 } 80 81 if (!string.IsNullOrWhiteSpace(rnd)) { 82 link += "&rnd=" + rnd; 83 } 84 85 if (!string.IsNullOrWhiteSpace(viewmode)) { 86 link += "&viewmode=" + viewmode; 87 } else { 88 link += "&viewmode=house"; 89 } 90 } 91 if (GetBoolean("Item.IsTextureToolLink")) { 92 string groove = p.ProductFieldValues.GetProductFieldValue("VisualizationGroove").Value.ToString(); 93 string linking = p.ProductFieldValues.GetProductFieldValue("VisualizationLinking").Value.ToString(); 94 string viewmode = p.ProductFieldValues.GetProductFieldValue("VisualizationViewmode").Value.ToString(); 95 96 if (categoryName == "mursten") { 97 link += "#brick=" + productnumber.Replace(" ",""); 98 } else { 99 link += "#brick=RT522"; 100 } 101 102 if (!string.IsNullOrWhiteSpace(groove)) { 103 link += "&groove=" + groove; 104 } 105 106 if (!string.IsNullOrWhiteSpace(linking)) { 107 link += "&linking=" + linking; 108 } 109 110 if (!string.IsNullOrWhiteSpace(viewmode)) { 111 link += "&viewmode=" + viewmode; 112 } else { 113 link += "&viewmode=wall"; 114 } 115 } 116 } 117 118 string iconClass = GetString("Item.Icon"); 119 iconClass = iconClass.Substring(iconClass.LastIndexOf("/") + 1); 120 iconClass = iconClass.Replace(".svg",""); 121 } 122 @if (GetString("Item.Type") == "inline-form" || GetString("Item.Type") == "custom") { 123 if (GetString("Item.Type") == "inline-form") { 124 <a class="tablet-desktop-link" @if(!string.IsNullOrWhiteSpace(GetString("Item.LinkTitle"))) {<text>title='@GetString("Item.LinkTitle")'</text>} @if (GetBoolean("Item.IsReferenceForm") && p.ProductFieldValues.GetProductFieldValue("ShowNewReferenceTool").Value.ToString() == "False") {<text>href="mailto:@Translate("RT-2.0_Reference_mail_modtager")?subject=@productnumber - @Translate("RT-2.0_Forespørgsel_på_referenceadresse_mail_emne")&body=@Translate("RT-2.0_Forespørgsel_på_referenceadresse_mail_body")"</text>}><span class='icon @iconClass'> 125 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath(GetString("Item.Icon"))) 126 </span><h2> 127 @GetString("Item.Header").Replace("[RTXXX]",@productnumber) 128 <span>@GetString("Item.Subheader").Replace("[RTXXX]",@productnumber)</span></h2> 129 @if (GetBoolean("Item.IsReferenceForm")) { 130 if (p.ProductFieldValues.GetProductFieldValue("ShowNewReferenceTool").Value.ToString() == "True") { 131 <text>@RenderParagraphContent(GetInteger("Item.FormParagraph"))</text> 132 } else { 133 <span><span class="arrow-link"> 134 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg"))) { 135 <span> 136 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 137 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 138 </span> 139 } 140 </span> 141 @Translate("RT-2.0_Spørg_på_referenceadresser") 142 </span> 143 } 144 145 } else { 146 <text>@RenderParagraphContent(GetInteger("Item.FormParagraph"))</text> 147 } 148 </a><a class="mobile-link" 149 150 @if (GetBoolean("Item.IsReferenceForm") && p.ProductFieldValues.GetProductFieldValue("ShowNewReferenceTool").Value.ToString() == "True") {<text>data-target='product-modal-@GetString("Item.Id")'</text>} @if (GetBoolean("Item.IsReferenceForm") && p.ProductFieldValues.GetProductFieldValue("ShowNewReferenceTool").Value.ToString() == "False") {<text>href="mailto:@Translate("RT-2.0_Reference_mail_modtager")?subject=@productnumber - @Translate("RT-2.0_Forespørgsel_på_referenceadresse_mail_emne")&body=@Translate("RT-2.0_Forespørgsel_på_referenceadresse_mail_body")"</text>}><span class='icon @iconClass'> 151 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath(GetString("Item.Icon"))) 152 </span> 153 @if (GetBoolean("Item.IsReferenceForm")) { 154 if (p.ProductFieldValues.GetProductFieldValue("ShowNewReferenceTool").Value.ToString() == "True") { 155 <h2><span>@GetString("Item.MobileHeader").Replace("[RTXXX]",@productnumber)</span></h2> 156 } else { 157 <h2><span>@Translate("RT-2.0_Spørg_på_referenceadresser")</span></h2> 158 } 159 } else { 160 <h2><span>@GetString("Item.MobileHeader").Replace("[RTXXX]",@productnumber)</span></h2> 161 } 162 </a> 163 @SnippetStart("Modals") 164 <div id='product-modal-@GetString("Item.Id")' class="product-modal modal-light"><div class="column-xxs-22 column-lg-18 column-xl-14 column-xxs-left-1 column-lg-left-3 column-xl-left-5 column-xxs-top-6 column-xxs-bottom-2 column-md-top-2"><div class="wrap-inner"><div class="column-xxs-24"><span class="header"> 165 @GetString("Item.Header").Replace("[RTXXX]",@productnumber) 166 <span>@GetString("Item.Subheader").Replace("[RTXXX]",@productnumber)</span></span></div></div></div><div class="column-xxs-22 column-lg-18 column-xl-14 column-xxs-left-1 column-lg-left-3 column-xl-left-5"> 167 @RenderParagraphContent(GetInteger("Item.FormParagraph")) 168 </div><span class="icon-close"> 169 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-close.svg"))) { 170 <text>@System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-close.svg"))</text> 171 } 172 </span></div> 173 @SnippetEnd("Modals") 174 } else { 175 <a class="tablet-desktop-link" @if(!string.IsNullOrWhiteSpace(GetString("Item.LinkTitle"))) {<text>title='@GetString("Item.LinkTitle")'</text>}><span class='icon @iconClass'> 176 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath(GetString("Item.Icon"))) 177 </span><h2> 178 @GetString("Item.Header").Replace("[RTXXX]",@productnumber) 179 <span>@GetString("Item.Subheader").Replace("[RTXXX]",@productnumber)</span></h2><form action='/Default.aspx?Id=@GetString("Item.PostPage")' method="post" id='dw-form-@GetString("ParagraphID")'><div class="input-wrap"><input type="text" name='@GetString("Item.FieldName")' placeholder='@GetString("Item.FieldPlaceholder")' autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" /><button class="arrow-link"> 180 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg"))) { 181 <span> 182 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 183 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 184 </span> 185 } 186 </button></div></form></a><a class="mobile-link" data-target='product-modal-@GetString("Item.Id")'><span class='icon @iconClass'> 187 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath(GetString("Item.Icon"))) 188 </span><h2><span>@GetString("Item.MobileHeader").Replace("[RTXXX]",@productnumber)</span></h2></a> 189 @SnippetStart("Modals") 190 <div id='product-modal-@GetString("Item.Id")' class="product-modal modal-light"><div class="column-xxs-22 column-lg-18 column-xl-14 column-xxs-left-1 column-lg-left-3 column-xl-left-5 column-xxs-top-6 column-xxs-bottom-2 column-md-top-2"><div class="wrap-inner"><div class="column-xxs-24"><span class="header"> 191 @GetString("Item.Header").Replace("[RTXXX]",@productnumber) 192 <span>@GetString("Item.Subheader").Replace("[RTXXX]",@productnumber)</span></span></div></div></div><div class="column-xxs-22 column-lg-18 column-xl-14 column-xxs-left-1 column-lg-left-3 column-xl-left-5 column-xxs-top-6 column-xxs-bottom-2 column-md-top-2"><form action='/Default.aspx?Id=@GetString("Item.PostPage")' method="post" id='dw-form-@GetString("ParagraphID")'><div class="input-wrap"><input type="text" name='@GetString("Item.FieldName")' placeholder='@GetString("Item.FieldPlaceholder")' autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" /><button class="arrow-link"> 193 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg"))) { 194 <span> 195 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 196 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 197 </span> 198 } 199 </button></div></form></div><span class="icon-close"> 200 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-close.svg"))) { 201 <text>@System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-close.svg"))</text> 202 } 203 </span></div> 204 @SnippetEnd("Modals") 205 } 206 } else { 207 <a @if(GetString("Item.Type") == "link") {<text>href=@link</text>} 208 @if(!string.IsNullOrWhiteSpace(GetString("Item.LinkTitle"))) {<text>title='@GetString("Item.LinkTitle")'</text>} 209 @if(GetString("Item.Type") == "modal-form") {<text>data-target='modal-@GetString("Item.ModalFormParagraph")'</text>} 210 @(GetString("Item.ActionID") == "samples" ? "data-callback='hubspotLoad'" : null) 211 @if (GetBoolean("Item.IsVisualizationToolLink")) {<text>target="_blank"</text>} 212 @if (!string.IsNullOrWhiteSpace(GetString("Item.OpenTrackingCategory"))) {<text>data-open-tracking-category='@GetString("Item.OpenTrackingCategory")'</text>} 213 @if (!string.IsNullOrWhiteSpace(GetString("Item.OpenTrackingAction"))) {<text>data-open-tracking-action='@GetString("Item.OpenTrackingAction")'</text>}><span class='icon @iconClass'> 214 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath(GetString("Item.Icon"))) 215 </span><h2> 216 @GetString("Item.Header").Replace("[RTXXX]",@productnumber) 217 <span>@GetString("Item.Subheader").Replace("[RTXXX]",@productnumber)</span></h2><h2><span>@GetString("Item.MobileHeader").Replace("[RTXXX]",@productnumber)</span></h2> 218 @if (GetString("Item.Type") == "link") { 219 <span><span class="arrow-link"> 220 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg"))) { 221 <span> 222 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 223 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 224 </span> 225 } 226 </span> 227 @GetString("Item.LinkText") 228 </span> 229 } else if (GetString("Item.Type") == "modal-form") { 230 <span><span class="arrow-link"> 231 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg"))) { 232 <span> 233 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 234 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 235 </span> 236 } 237 </span> 238 @GetString("Item.FormLinkText") 239 </span> 240 } 241 </a> 242 } 243 </div></div> 244 } 245
Error executing template "/Designs/randers-tegl/Paragraph/rt-2.0.product-action.cshtml" System.NullReferenceException: Object reference not set to an instance of an object. at CompiledRazorTemplates.Dynamic.RazorEngine_0a125ffb5fab4b5e9b2b21f7eda05ea9.Execute() in D:\dynamicweb.net\Solutions\Gotcha\randerstegl.cloud.dynamicweb-cms.com\files\Templates\Designs\randers-tegl\Paragraph\rt-2.0.product-action.cshtml:line 6 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 @{ 2 string productid = System.Web.HttpContext.Current.Request.QueryString.Get("ProductID"); 3 4 Dynamicweb.Ecommerce.Products.Product p = Dynamicweb.Ecommerce.Services.Products.GetProductById(productid, "", false); 5 6 string productname = p.Name; 7 string productnumber = p.Number; 8 string categoryName = p.Groups[0].Name.ToLower(); 9 } 10 11 @if (!GetString("Item.ExcludeProducts").Contains(productnumber)) { 12 <div class="column-xxs-12 column-md-8 column-xxs-top-1 column-xxs-bottom-1 column-sm-top-0 column-sm-bottom-0" id='@GetString("Item.ActionID")@("-action")'><div class="wrap-inner"> 13 @{ 14 bool islink = false; 15 string link = ""; 16 17 if (GetString("Item.Type") == "link") { 18 islink = true; 19 link = GetString("Item.Link"); 20 bool hasparameter = false; 21 22 if (GetBoolean("Item.IncludeRTNumberInURL")) { 23 link += (GetString("Item.Link").Contains("?") ? "&" : "?"); 24 25 if (!string.IsNullOrWhiteSpace(GetString("Item.URLParameterName"))) { 26 link += GetString("Item.URLParameterName") + "=" + productnumber.Replace(" ",""); 27 } else { 28 link += "ProductID=" + productid; 29 } 30 31 hasparameter = true; 32 } 33 34 if (GetBoolean("Item.IsVisualizationToolLink")) { 35 string brick = p.ProductFieldValues.GetProductFieldValue("VisualizationBrick").Value.ToString(); 36 string groove = p.ProductFieldValues.GetProductFieldValue("VisualizationGroove").Value.ToString(); 37 string linking = p.ProductFieldValues.GetProductFieldValue("VisualizationLinking").Value.ToString(); 38 string paving = p.ProductFieldValues.GetProductFieldValue("VisualizationPaving").Value.ToString(); 39 string roof = p.ProductFieldValues.GetProductFieldValue("VisualizationRoof").Value.ToString(); 40 string house = p.ProductFieldValues.GetProductFieldValue("VisualizationHouse").Value.ToString(); 41 string windows = p.ProductFieldValues.GetProductFieldValue("VisualizationWindows").Value.ToString(); 42 string rnd = p.ProductFieldValues.GetProductFieldValue("VisualizationRnd").Value.ToString(); 43 string viewmode = p.ProductFieldValues.GetProductFieldValue("VisualizationViewmode").Value.ToString(); 44 45 if (categoryName == "mursten") { 46 link += "#brick=" + productnumber.Replace(" ",""); 47 } else if (!string.IsNullOrWhiteSpace(brick)) { 48 link += "#brick=" + brick; 49 } else { 50 link += "#brick=RT522"; 51 } 52 53 if (!string.IsNullOrWhiteSpace(groove)) { 54 link += "&groove=" + groove; 55 } 56 57 if (!string.IsNullOrWhiteSpace(linking)) { 58 link += "&linking=" + linking; 59 } 60 61 if (!string.IsNullOrWhiteSpace(paving)) { 62 link += "&paving=" + paving; 63 } 64 65 if (categoryName == "tagsten") { 66 link += "&roof=" + productnumber.Replace(" ","_"); 67 } else if (!string.IsNullOrWhiteSpace(roof)) { 68 link += "&roof=" + roof; 69 } 70 71 if (!string.IsNullOrWhiteSpace(house)) { 72 link += "&house=" + house; 73 } else if (categoryName == "tagsten") { 74 link += "&house=05"; 75 } 76 77 if (!string.IsNullOrWhiteSpace(windows)) { 78 link += "&windows=" + windows; 79 } 80 81 if (!string.IsNullOrWhiteSpace(rnd)) { 82 link += "&rnd=" + rnd; 83 } 84 85 if (!string.IsNullOrWhiteSpace(viewmode)) { 86 link += "&viewmode=" + viewmode; 87 } else { 88 link += "&viewmode=house"; 89 } 90 } 91 if (GetBoolean("Item.IsTextureToolLink")) { 92 string groove = p.ProductFieldValues.GetProductFieldValue("VisualizationGroove").Value.ToString(); 93 string linking = p.ProductFieldValues.GetProductFieldValue("VisualizationLinking").Value.ToString(); 94 string viewmode = p.ProductFieldValues.GetProductFieldValue("VisualizationViewmode").Value.ToString(); 95 96 if (categoryName == "mursten") { 97 link += "#brick=" + productnumber.Replace(" ",""); 98 } else { 99 link += "#brick=RT522"; 100 } 101 102 if (!string.IsNullOrWhiteSpace(groove)) { 103 link += "&groove=" + groove; 104 } 105 106 if (!string.IsNullOrWhiteSpace(linking)) { 107 link += "&linking=" + linking; 108 } 109 110 if (!string.IsNullOrWhiteSpace(viewmode)) { 111 link += "&viewmode=" + viewmode; 112 } else { 113 link += "&viewmode=wall"; 114 } 115 } 116 } 117 118 string iconClass = GetString("Item.Icon"); 119 iconClass = iconClass.Substring(iconClass.LastIndexOf("/") + 1); 120 iconClass = iconClass.Replace(".svg",""); 121 } 122 @if (GetString("Item.Type") == "inline-form" || GetString("Item.Type") == "custom") { 123 if (GetString("Item.Type") == "inline-form") { 124 <a class="tablet-desktop-link" @if(!string.IsNullOrWhiteSpace(GetString("Item.LinkTitle"))) {<text>title='@GetString("Item.LinkTitle")'</text>} @if (GetBoolean("Item.IsReferenceForm") && p.ProductFieldValues.GetProductFieldValue("ShowNewReferenceTool").Value.ToString() == "False") {<text>href="mailto:@Translate("RT-2.0_Reference_mail_modtager")?subject=@productnumber - @Translate("RT-2.0_Forespørgsel_på_referenceadresse_mail_emne")&body=@Translate("RT-2.0_Forespørgsel_på_referenceadresse_mail_body")"</text>}><span class='icon @iconClass'> 125 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath(GetString("Item.Icon"))) 126 </span><h2> 127 @GetString("Item.Header").Replace("[RTXXX]",@productnumber) 128 <span>@GetString("Item.Subheader").Replace("[RTXXX]",@productnumber)</span></h2> 129 @if (GetBoolean("Item.IsReferenceForm")) { 130 if (p.ProductFieldValues.GetProductFieldValue("ShowNewReferenceTool").Value.ToString() == "True") { 131 <text>@RenderParagraphContent(GetInteger("Item.FormParagraph"))</text> 132 } else { 133 <span><span class="arrow-link"> 134 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg"))) { 135 <span> 136 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 137 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 138 </span> 139 } 140 </span> 141 @Translate("RT-2.0_Spørg_på_referenceadresser") 142 </span> 143 } 144 145 } else { 146 <text>@RenderParagraphContent(GetInteger("Item.FormParagraph"))</text> 147 } 148 </a><a class="mobile-link" 149 150 @if (GetBoolean("Item.IsReferenceForm") && p.ProductFieldValues.GetProductFieldValue("ShowNewReferenceTool").Value.ToString() == "True") {<text>data-target='product-modal-@GetString("Item.Id")'</text>} @if (GetBoolean("Item.IsReferenceForm") && p.ProductFieldValues.GetProductFieldValue("ShowNewReferenceTool").Value.ToString() == "False") {<text>href="mailto:@Translate("RT-2.0_Reference_mail_modtager")?subject=@productnumber - @Translate("RT-2.0_Forespørgsel_på_referenceadresse_mail_emne")&body=@Translate("RT-2.0_Forespørgsel_på_referenceadresse_mail_body")"</text>}><span class='icon @iconClass'> 151 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath(GetString("Item.Icon"))) 152 </span> 153 @if (GetBoolean("Item.IsReferenceForm")) { 154 if (p.ProductFieldValues.GetProductFieldValue("ShowNewReferenceTool").Value.ToString() == "True") { 155 <h2><span>@GetString("Item.MobileHeader").Replace("[RTXXX]",@productnumber)</span></h2> 156 } else { 157 <h2><span>@Translate("RT-2.0_Spørg_på_referenceadresser")</span></h2> 158 } 159 } else { 160 <h2><span>@GetString("Item.MobileHeader").Replace("[RTXXX]",@productnumber)</span></h2> 161 } 162 </a> 163 @SnippetStart("Modals") 164 <div id='product-modal-@GetString("Item.Id")' class="product-modal modal-light"><div class="column-xxs-22 column-lg-18 column-xl-14 column-xxs-left-1 column-lg-left-3 column-xl-left-5 column-xxs-top-6 column-xxs-bottom-2 column-md-top-2"><div class="wrap-inner"><div class="column-xxs-24"><span class="header"> 165 @GetString("Item.Header").Replace("[RTXXX]",@productnumber) 166 <span>@GetString("Item.Subheader").Replace("[RTXXX]",@productnumber)</span></span></div></div></div><div class="column-xxs-22 column-lg-18 column-xl-14 column-xxs-left-1 column-lg-left-3 column-xl-left-5"> 167 @RenderParagraphContent(GetInteger("Item.FormParagraph")) 168 </div><span class="icon-close"> 169 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-close.svg"))) { 170 <text>@System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-close.svg"))</text> 171 } 172 </span></div> 173 @SnippetEnd("Modals") 174 } else { 175 <a class="tablet-desktop-link" @if(!string.IsNullOrWhiteSpace(GetString("Item.LinkTitle"))) {<text>title='@GetString("Item.LinkTitle")'</text>}><span class='icon @iconClass'> 176 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath(GetString("Item.Icon"))) 177 </span><h2> 178 @GetString("Item.Header").Replace("[RTXXX]",@productnumber) 179 <span>@GetString("Item.Subheader").Replace("[RTXXX]",@productnumber)</span></h2><form action='/Default.aspx?Id=@GetString("Item.PostPage")' method="post" id='dw-form-@GetString("ParagraphID")'><div class="input-wrap"><input type="text" name='@GetString("Item.FieldName")' placeholder='@GetString("Item.FieldPlaceholder")' autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" /><button class="arrow-link"> 180 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg"))) { 181 <span> 182 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 183 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 184 </span> 185 } 186 </button></div></form></a><a class="mobile-link" data-target='product-modal-@GetString("Item.Id")'><span class='icon @iconClass'> 187 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath(GetString("Item.Icon"))) 188 </span><h2><span>@GetString("Item.MobileHeader").Replace("[RTXXX]",@productnumber)</span></h2></a> 189 @SnippetStart("Modals") 190 <div id='product-modal-@GetString("Item.Id")' class="product-modal modal-light"><div class="column-xxs-22 column-lg-18 column-xl-14 column-xxs-left-1 column-lg-left-3 column-xl-left-5 column-xxs-top-6 column-xxs-bottom-2 column-md-top-2"><div class="wrap-inner"><div class="column-xxs-24"><span class="header"> 191 @GetString("Item.Header").Replace("[RTXXX]",@productnumber) 192 <span>@GetString("Item.Subheader").Replace("[RTXXX]",@productnumber)</span></span></div></div></div><div class="column-xxs-22 column-lg-18 column-xl-14 column-xxs-left-1 column-lg-left-3 column-xl-left-5 column-xxs-top-6 column-xxs-bottom-2 column-md-top-2"><form action='/Default.aspx?Id=@GetString("Item.PostPage")' method="post" id='dw-form-@GetString("ParagraphID")'><div class="input-wrap"><input type="text" name='@GetString("Item.FieldName")' placeholder='@GetString("Item.FieldPlaceholder")' autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" /><button class="arrow-link"> 193 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg"))) { 194 <span> 195 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 196 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 197 </span> 198 } 199 </button></div></form></div><span class="icon-close"> 200 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-close.svg"))) { 201 <text>@System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-close.svg"))</text> 202 } 203 </span></div> 204 @SnippetEnd("Modals") 205 } 206 } else { 207 <a @if(GetString("Item.Type") == "link") {<text>href=@link</text>} 208 @if(!string.IsNullOrWhiteSpace(GetString("Item.LinkTitle"))) {<text>title='@GetString("Item.LinkTitle")'</text>} 209 @if(GetString("Item.Type") == "modal-form") {<text>data-target='modal-@GetString("Item.ModalFormParagraph")'</text>} 210 @(GetString("Item.ActionID") == "samples" ? "data-callback='hubspotLoad'" : null) 211 @if (GetBoolean("Item.IsVisualizationToolLink")) {<text>target="_blank"</text>} 212 @if (!string.IsNullOrWhiteSpace(GetString("Item.OpenTrackingCategory"))) {<text>data-open-tracking-category='@GetString("Item.OpenTrackingCategory")'</text>} 213 @if (!string.IsNullOrWhiteSpace(GetString("Item.OpenTrackingAction"))) {<text>data-open-tracking-action='@GetString("Item.OpenTrackingAction")'</text>}><span class='icon @iconClass'> 214 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath(GetString("Item.Icon"))) 215 </span><h2> 216 @GetString("Item.Header").Replace("[RTXXX]",@productnumber) 217 <span>@GetString("Item.Subheader").Replace("[RTXXX]",@productnumber)</span></h2><h2><span>@GetString("Item.MobileHeader").Replace("[RTXXX]",@productnumber)</span></h2> 218 @if (GetString("Item.Type") == "link") { 219 <span><span class="arrow-link"> 220 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg"))) { 221 <span> 222 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 223 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 224 </span> 225 } 226 </span> 227 @GetString("Item.LinkText") 228 </span> 229 } else if (GetString("Item.Type") == "modal-form") { 230 <span><span class="arrow-link"> 231 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg"))) { 232 <span> 233 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 234 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 235 </span> 236 } 237 </span> 238 @GetString("Item.FormLinkText") 239 </span> 240 } 241 </a> 242 } 243 </div></div> 244 } 245
Error executing template "/Designs/randers-tegl/Paragraph/rt-2.0.product-action.cshtml" System.NullReferenceException: Object reference not set to an instance of an object. at CompiledRazorTemplates.Dynamic.RazorEngine_0a125ffb5fab4b5e9b2b21f7eda05ea9.Execute() in D:\dynamicweb.net\Solutions\Gotcha\randerstegl.cloud.dynamicweb-cms.com\files\Templates\Designs\randers-tegl\Paragraph\rt-2.0.product-action.cshtml:line 6 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 @{ 2 string productid = System.Web.HttpContext.Current.Request.QueryString.Get("ProductID"); 3 4 Dynamicweb.Ecommerce.Products.Product p = Dynamicweb.Ecommerce.Services.Products.GetProductById(productid, "", false); 5 6 string productname = p.Name; 7 string productnumber = p.Number; 8 string categoryName = p.Groups[0].Name.ToLower(); 9 } 10 11 @if (!GetString("Item.ExcludeProducts").Contains(productnumber)) { 12 <div class="column-xxs-12 column-md-8 column-xxs-top-1 column-xxs-bottom-1 column-sm-top-0 column-sm-bottom-0" id='@GetString("Item.ActionID")@("-action")'><div class="wrap-inner"> 13 @{ 14 bool islink = false; 15 string link = ""; 16 17 if (GetString("Item.Type") == "link") { 18 islink = true; 19 link = GetString("Item.Link"); 20 bool hasparameter = false; 21 22 if (GetBoolean("Item.IncludeRTNumberInURL")) { 23 link += (GetString("Item.Link").Contains("?") ? "&" : "?"); 24 25 if (!string.IsNullOrWhiteSpace(GetString("Item.URLParameterName"))) { 26 link += GetString("Item.URLParameterName") + "=" + productnumber.Replace(" ",""); 27 } else { 28 link += "ProductID=" + productid; 29 } 30 31 hasparameter = true; 32 } 33 34 if (GetBoolean("Item.IsVisualizationToolLink")) { 35 string brick = p.ProductFieldValues.GetProductFieldValue("VisualizationBrick").Value.ToString(); 36 string groove = p.ProductFieldValues.GetProductFieldValue("VisualizationGroove").Value.ToString(); 37 string linking = p.ProductFieldValues.GetProductFieldValue("VisualizationLinking").Value.ToString(); 38 string paving = p.ProductFieldValues.GetProductFieldValue("VisualizationPaving").Value.ToString(); 39 string roof = p.ProductFieldValues.GetProductFieldValue("VisualizationRoof").Value.ToString(); 40 string house = p.ProductFieldValues.GetProductFieldValue("VisualizationHouse").Value.ToString(); 41 string windows = p.ProductFieldValues.GetProductFieldValue("VisualizationWindows").Value.ToString(); 42 string rnd = p.ProductFieldValues.GetProductFieldValue("VisualizationRnd").Value.ToString(); 43 string viewmode = p.ProductFieldValues.GetProductFieldValue("VisualizationViewmode").Value.ToString(); 44 45 if (categoryName == "mursten") { 46 link += "#brick=" + productnumber.Replace(" ",""); 47 } else if (!string.IsNullOrWhiteSpace(brick)) { 48 link += "#brick=" + brick; 49 } else { 50 link += "#brick=RT522"; 51 } 52 53 if (!string.IsNullOrWhiteSpace(groove)) { 54 link += "&groove=" + groove; 55 } 56 57 if (!string.IsNullOrWhiteSpace(linking)) { 58 link += "&linking=" + linking; 59 } 60 61 if (!string.IsNullOrWhiteSpace(paving)) { 62 link += "&paving=" + paving; 63 } 64 65 if (categoryName == "tagsten") { 66 link += "&roof=" + productnumber.Replace(" ","_"); 67 } else if (!string.IsNullOrWhiteSpace(roof)) { 68 link += "&roof=" + roof; 69 } 70 71 if (!string.IsNullOrWhiteSpace(house)) { 72 link += "&house=" + house; 73 } else if (categoryName == "tagsten") { 74 link += "&house=05"; 75 } 76 77 if (!string.IsNullOrWhiteSpace(windows)) { 78 link += "&windows=" + windows; 79 } 80 81 if (!string.IsNullOrWhiteSpace(rnd)) { 82 link += "&rnd=" + rnd; 83 } 84 85 if (!string.IsNullOrWhiteSpace(viewmode)) { 86 link += "&viewmode=" + viewmode; 87 } else { 88 link += "&viewmode=house"; 89 } 90 } 91 if (GetBoolean("Item.IsTextureToolLink")) { 92 string groove = p.ProductFieldValues.GetProductFieldValue("VisualizationGroove").Value.ToString(); 93 string linking = p.ProductFieldValues.GetProductFieldValue("VisualizationLinking").Value.ToString(); 94 string viewmode = p.ProductFieldValues.GetProductFieldValue("VisualizationViewmode").Value.ToString(); 95 96 if (categoryName == "mursten") { 97 link += "#brick=" + productnumber.Replace(" ",""); 98 } else { 99 link += "#brick=RT522"; 100 } 101 102 if (!string.IsNullOrWhiteSpace(groove)) { 103 link += "&groove=" + groove; 104 } 105 106 if (!string.IsNullOrWhiteSpace(linking)) { 107 link += "&linking=" + linking; 108 } 109 110 if (!string.IsNullOrWhiteSpace(viewmode)) { 111 link += "&viewmode=" + viewmode; 112 } else { 113 link += "&viewmode=wall"; 114 } 115 } 116 } 117 118 string iconClass = GetString("Item.Icon"); 119 iconClass = iconClass.Substring(iconClass.LastIndexOf("/") + 1); 120 iconClass = iconClass.Replace(".svg",""); 121 } 122 @if (GetString("Item.Type") == "inline-form" || GetString("Item.Type") == "custom") { 123 if (GetString("Item.Type") == "inline-form") { 124 <a class="tablet-desktop-link" @if(!string.IsNullOrWhiteSpace(GetString("Item.LinkTitle"))) {<text>title='@GetString("Item.LinkTitle")'</text>} @if (GetBoolean("Item.IsReferenceForm") && p.ProductFieldValues.GetProductFieldValue("ShowNewReferenceTool").Value.ToString() == "False") {<text>href="mailto:@Translate("RT-2.0_Reference_mail_modtager")?subject=@productnumber - @Translate("RT-2.0_Forespørgsel_på_referenceadresse_mail_emne")&body=@Translate("RT-2.0_Forespørgsel_på_referenceadresse_mail_body")"</text>}><span class='icon @iconClass'> 125 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath(GetString("Item.Icon"))) 126 </span><h2> 127 @GetString("Item.Header").Replace("[RTXXX]",@productnumber) 128 <span>@GetString("Item.Subheader").Replace("[RTXXX]",@productnumber)</span></h2> 129 @if (GetBoolean("Item.IsReferenceForm")) { 130 if (p.ProductFieldValues.GetProductFieldValue("ShowNewReferenceTool").Value.ToString() == "True") { 131 <text>@RenderParagraphContent(GetInteger("Item.FormParagraph"))</text> 132 } else { 133 <span><span class="arrow-link"> 134 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg"))) { 135 <span> 136 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 137 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 138 </span> 139 } 140 </span> 141 @Translate("RT-2.0_Spørg_på_referenceadresser") 142 </span> 143 } 144 145 } else { 146 <text>@RenderParagraphContent(GetInteger("Item.FormParagraph"))</text> 147 } 148 </a><a class="mobile-link" 149 150 @if (GetBoolean("Item.IsReferenceForm") && p.ProductFieldValues.GetProductFieldValue("ShowNewReferenceTool").Value.ToString() == "True") {<text>data-target='product-modal-@GetString("Item.Id")'</text>} @if (GetBoolean("Item.IsReferenceForm") && p.ProductFieldValues.GetProductFieldValue("ShowNewReferenceTool").Value.ToString() == "False") {<text>href="mailto:@Translate("RT-2.0_Reference_mail_modtager")?subject=@productnumber - @Translate("RT-2.0_Forespørgsel_på_referenceadresse_mail_emne")&body=@Translate("RT-2.0_Forespørgsel_på_referenceadresse_mail_body")"</text>}><span class='icon @iconClass'> 151 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath(GetString("Item.Icon"))) 152 </span> 153 @if (GetBoolean("Item.IsReferenceForm")) { 154 if (p.ProductFieldValues.GetProductFieldValue("ShowNewReferenceTool").Value.ToString() == "True") { 155 <h2><span>@GetString("Item.MobileHeader").Replace("[RTXXX]",@productnumber)</span></h2> 156 } else { 157 <h2><span>@Translate("RT-2.0_Spørg_på_referenceadresser")</span></h2> 158 } 159 } else { 160 <h2><span>@GetString("Item.MobileHeader").Replace("[RTXXX]",@productnumber)</span></h2> 161 } 162 </a> 163 @SnippetStart("Modals") 164 <div id='product-modal-@GetString("Item.Id")' class="product-modal modal-light"><div class="column-xxs-22 column-lg-18 column-xl-14 column-xxs-left-1 column-lg-left-3 column-xl-left-5 column-xxs-top-6 column-xxs-bottom-2 column-md-top-2"><div class="wrap-inner"><div class="column-xxs-24"><span class="header"> 165 @GetString("Item.Header").Replace("[RTXXX]",@productnumber) 166 <span>@GetString("Item.Subheader").Replace("[RTXXX]",@productnumber)</span></span></div></div></div><div class="column-xxs-22 column-lg-18 column-xl-14 column-xxs-left-1 column-lg-left-3 column-xl-left-5"> 167 @RenderParagraphContent(GetInteger("Item.FormParagraph")) 168 </div><span class="icon-close"> 169 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-close.svg"))) { 170 <text>@System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-close.svg"))</text> 171 } 172 </span></div> 173 @SnippetEnd("Modals") 174 } else { 175 <a class="tablet-desktop-link" @if(!string.IsNullOrWhiteSpace(GetString("Item.LinkTitle"))) {<text>title='@GetString("Item.LinkTitle")'</text>}><span class='icon @iconClass'> 176 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath(GetString("Item.Icon"))) 177 </span><h2> 178 @GetString("Item.Header").Replace("[RTXXX]",@productnumber) 179 <span>@GetString("Item.Subheader").Replace("[RTXXX]",@productnumber)</span></h2><form action='/Default.aspx?Id=@GetString("Item.PostPage")' method="post" id='dw-form-@GetString("ParagraphID")'><div class="input-wrap"><input type="text" name='@GetString("Item.FieldName")' placeholder='@GetString("Item.FieldPlaceholder")' autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" /><button class="arrow-link"> 180 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg"))) { 181 <span> 182 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 183 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 184 </span> 185 } 186 </button></div></form></a><a class="mobile-link" data-target='product-modal-@GetString("Item.Id")'><span class='icon @iconClass'> 187 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath(GetString("Item.Icon"))) 188 </span><h2><span>@GetString("Item.MobileHeader").Replace("[RTXXX]",@productnumber)</span></h2></a> 189 @SnippetStart("Modals") 190 <div id='product-modal-@GetString("Item.Id")' class="product-modal modal-light"><div class="column-xxs-22 column-lg-18 column-xl-14 column-xxs-left-1 column-lg-left-3 column-xl-left-5 column-xxs-top-6 column-xxs-bottom-2 column-md-top-2"><div class="wrap-inner"><div class="column-xxs-24"><span class="header"> 191 @GetString("Item.Header").Replace("[RTXXX]",@productnumber) 192 <span>@GetString("Item.Subheader").Replace("[RTXXX]",@productnumber)</span></span></div></div></div><div class="column-xxs-22 column-lg-18 column-xl-14 column-xxs-left-1 column-lg-left-3 column-xl-left-5 column-xxs-top-6 column-xxs-bottom-2 column-md-top-2"><form action='/Default.aspx?Id=@GetString("Item.PostPage")' method="post" id='dw-form-@GetString("ParagraphID")'><div class="input-wrap"><input type="text" name='@GetString("Item.FieldName")' placeholder='@GetString("Item.FieldPlaceholder")' autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" /><button class="arrow-link"> 193 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg"))) { 194 <span> 195 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 196 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 197 </span> 198 } 199 </button></div></form></div><span class="icon-close"> 200 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-close.svg"))) { 201 <text>@System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-close.svg"))</text> 202 } 203 </span></div> 204 @SnippetEnd("Modals") 205 } 206 } else { 207 <a @if(GetString("Item.Type") == "link") {<text>href=@link</text>} 208 @if(!string.IsNullOrWhiteSpace(GetString("Item.LinkTitle"))) {<text>title='@GetString("Item.LinkTitle")'</text>} 209 @if(GetString("Item.Type") == "modal-form") {<text>data-target='modal-@GetString("Item.ModalFormParagraph")'</text>} 210 @(GetString("Item.ActionID") == "samples" ? "data-callback='hubspotLoad'" : null) 211 @if (GetBoolean("Item.IsVisualizationToolLink")) {<text>target="_blank"</text>} 212 @if (!string.IsNullOrWhiteSpace(GetString("Item.OpenTrackingCategory"))) {<text>data-open-tracking-category='@GetString("Item.OpenTrackingCategory")'</text>} 213 @if (!string.IsNullOrWhiteSpace(GetString("Item.OpenTrackingAction"))) {<text>data-open-tracking-action='@GetString("Item.OpenTrackingAction")'</text>}><span class='icon @iconClass'> 214 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath(GetString("Item.Icon"))) 215 </span><h2> 216 @GetString("Item.Header").Replace("[RTXXX]",@productnumber) 217 <span>@GetString("Item.Subheader").Replace("[RTXXX]",@productnumber)</span></h2><h2><span>@GetString("Item.MobileHeader").Replace("[RTXXX]",@productnumber)</span></h2> 218 @if (GetString("Item.Type") == "link") { 219 <span><span class="arrow-link"> 220 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg"))) { 221 <span> 222 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 223 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 224 </span> 225 } 226 </span> 227 @GetString("Item.LinkText") 228 </span> 229 } else if (GetString("Item.Type") == "modal-form") { 230 <span><span class="arrow-link"> 231 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg"))) { 232 <span> 233 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 234 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 235 </span> 236 } 237 </span> 238 @GetString("Item.FormLinkText") 239 </span> 240 } 241 </a> 242 } 243 </div></div> 244 } 245
Error executing template "/Designs/randers-tegl/Paragraph/rt-2.0.product-action.cshtml" System.NullReferenceException: Object reference not set to an instance of an object. at CompiledRazorTemplates.Dynamic.RazorEngine_0a125ffb5fab4b5e9b2b21f7eda05ea9.Execute() in D:\dynamicweb.net\Solutions\Gotcha\randerstegl.cloud.dynamicweb-cms.com\files\Templates\Designs\randers-tegl\Paragraph\rt-2.0.product-action.cshtml:line 6 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 @{ 2 string productid = System.Web.HttpContext.Current.Request.QueryString.Get("ProductID"); 3 4 Dynamicweb.Ecommerce.Products.Product p = Dynamicweb.Ecommerce.Services.Products.GetProductById(productid, "", false); 5 6 string productname = p.Name; 7 string productnumber = p.Number; 8 string categoryName = p.Groups[0].Name.ToLower(); 9 } 10 11 @if (!GetString("Item.ExcludeProducts").Contains(productnumber)) { 12 <div class="column-xxs-12 column-md-8 column-xxs-top-1 column-xxs-bottom-1 column-sm-top-0 column-sm-bottom-0" id='@GetString("Item.ActionID")@("-action")'><div class="wrap-inner"> 13 @{ 14 bool islink = false; 15 string link = ""; 16 17 if (GetString("Item.Type") == "link") { 18 islink = true; 19 link = GetString("Item.Link"); 20 bool hasparameter = false; 21 22 if (GetBoolean("Item.IncludeRTNumberInURL")) { 23 link += (GetString("Item.Link").Contains("?") ? "&" : "?"); 24 25 if (!string.IsNullOrWhiteSpace(GetString("Item.URLParameterName"))) { 26 link += GetString("Item.URLParameterName") + "=" + productnumber.Replace(" ",""); 27 } else { 28 link += "ProductID=" + productid; 29 } 30 31 hasparameter = true; 32 } 33 34 if (GetBoolean("Item.IsVisualizationToolLink")) { 35 string brick = p.ProductFieldValues.GetProductFieldValue("VisualizationBrick").Value.ToString(); 36 string groove = p.ProductFieldValues.GetProductFieldValue("VisualizationGroove").Value.ToString(); 37 string linking = p.ProductFieldValues.GetProductFieldValue("VisualizationLinking").Value.ToString(); 38 string paving = p.ProductFieldValues.GetProductFieldValue("VisualizationPaving").Value.ToString(); 39 string roof = p.ProductFieldValues.GetProductFieldValue("VisualizationRoof").Value.ToString(); 40 string house = p.ProductFieldValues.GetProductFieldValue("VisualizationHouse").Value.ToString(); 41 string windows = p.ProductFieldValues.GetProductFieldValue("VisualizationWindows").Value.ToString(); 42 string rnd = p.ProductFieldValues.GetProductFieldValue("VisualizationRnd").Value.ToString(); 43 string viewmode = p.ProductFieldValues.GetProductFieldValue("VisualizationViewmode").Value.ToString(); 44 45 if (categoryName == "mursten") { 46 link += "#brick=" + productnumber.Replace(" ",""); 47 } else if (!string.IsNullOrWhiteSpace(brick)) { 48 link += "#brick=" + brick; 49 } else { 50 link += "#brick=RT522"; 51 } 52 53 if (!string.IsNullOrWhiteSpace(groove)) { 54 link += "&groove=" + groove; 55 } 56 57 if (!string.IsNullOrWhiteSpace(linking)) { 58 link += "&linking=" + linking; 59 } 60 61 if (!string.IsNullOrWhiteSpace(paving)) { 62 link += "&paving=" + paving; 63 } 64 65 if (categoryName == "tagsten") { 66 link += "&roof=" + productnumber.Replace(" ","_"); 67 } else if (!string.IsNullOrWhiteSpace(roof)) { 68 link += "&roof=" + roof; 69 } 70 71 if (!string.IsNullOrWhiteSpace(house)) { 72 link += "&house=" + house; 73 } else if (categoryName == "tagsten") { 74 link += "&house=05"; 75 } 76 77 if (!string.IsNullOrWhiteSpace(windows)) { 78 link += "&windows=" + windows; 79 } 80 81 if (!string.IsNullOrWhiteSpace(rnd)) { 82 link += "&rnd=" + rnd; 83 } 84 85 if (!string.IsNullOrWhiteSpace(viewmode)) { 86 link += "&viewmode=" + viewmode; 87 } else { 88 link += "&viewmode=house"; 89 } 90 } 91 if (GetBoolean("Item.IsTextureToolLink")) { 92 string groove = p.ProductFieldValues.GetProductFieldValue("VisualizationGroove").Value.ToString(); 93 string linking = p.ProductFieldValues.GetProductFieldValue("VisualizationLinking").Value.ToString(); 94 string viewmode = p.ProductFieldValues.GetProductFieldValue("VisualizationViewmode").Value.ToString(); 95 96 if (categoryName == "mursten") { 97 link += "#brick=" + productnumber.Replace(" ",""); 98 } else { 99 link += "#brick=RT522"; 100 } 101 102 if (!string.IsNullOrWhiteSpace(groove)) { 103 link += "&groove=" + groove; 104 } 105 106 if (!string.IsNullOrWhiteSpace(linking)) { 107 link += "&linking=" + linking; 108 } 109 110 if (!string.IsNullOrWhiteSpace(viewmode)) { 111 link += "&viewmode=" + viewmode; 112 } else { 113 link += "&viewmode=wall"; 114 } 115 } 116 } 117 118 string iconClass = GetString("Item.Icon"); 119 iconClass = iconClass.Substring(iconClass.LastIndexOf("/") + 1); 120 iconClass = iconClass.Replace(".svg",""); 121 } 122 @if (GetString("Item.Type") == "inline-form" || GetString("Item.Type") == "custom") { 123 if (GetString("Item.Type") == "inline-form") { 124 <a class="tablet-desktop-link" @if(!string.IsNullOrWhiteSpace(GetString("Item.LinkTitle"))) {<text>title='@GetString("Item.LinkTitle")'</text>} @if (GetBoolean("Item.IsReferenceForm") && p.ProductFieldValues.GetProductFieldValue("ShowNewReferenceTool").Value.ToString() == "False") {<text>href="mailto:@Translate("RT-2.0_Reference_mail_modtager")?subject=@productnumber - @Translate("RT-2.0_Forespørgsel_på_referenceadresse_mail_emne")&body=@Translate("RT-2.0_Forespørgsel_på_referenceadresse_mail_body")"</text>}><span class='icon @iconClass'> 125 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath(GetString("Item.Icon"))) 126 </span><h2> 127 @GetString("Item.Header").Replace("[RTXXX]",@productnumber) 128 <span>@GetString("Item.Subheader").Replace("[RTXXX]",@productnumber)</span></h2> 129 @if (GetBoolean("Item.IsReferenceForm")) { 130 if (p.ProductFieldValues.GetProductFieldValue("ShowNewReferenceTool").Value.ToString() == "True") { 131 <text>@RenderParagraphContent(GetInteger("Item.FormParagraph"))</text> 132 } else { 133 <span><span class="arrow-link"> 134 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg"))) { 135 <span> 136 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 137 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 138 </span> 139 } 140 </span> 141 @Translate("RT-2.0_Spørg_på_referenceadresser") 142 </span> 143 } 144 145 } else { 146 <text>@RenderParagraphContent(GetInteger("Item.FormParagraph"))</text> 147 } 148 </a><a class="mobile-link" 149 150 @if (GetBoolean("Item.IsReferenceForm") && p.ProductFieldValues.GetProductFieldValue("ShowNewReferenceTool").Value.ToString() == "True") {<text>data-target='product-modal-@GetString("Item.Id")'</text>} @if (GetBoolean("Item.IsReferenceForm") && p.ProductFieldValues.GetProductFieldValue("ShowNewReferenceTool").Value.ToString() == "False") {<text>href="mailto:@Translate("RT-2.0_Reference_mail_modtager")?subject=@productnumber - @Translate("RT-2.0_Forespørgsel_på_referenceadresse_mail_emne")&body=@Translate("RT-2.0_Forespørgsel_på_referenceadresse_mail_body")"</text>}><span class='icon @iconClass'> 151 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath(GetString("Item.Icon"))) 152 </span> 153 @if (GetBoolean("Item.IsReferenceForm")) { 154 if (p.ProductFieldValues.GetProductFieldValue("ShowNewReferenceTool").Value.ToString() == "True") { 155 <h2><span>@GetString("Item.MobileHeader").Replace("[RTXXX]",@productnumber)</span></h2> 156 } else { 157 <h2><span>@Translate("RT-2.0_Spørg_på_referenceadresser")</span></h2> 158 } 159 } else { 160 <h2><span>@GetString("Item.MobileHeader").Replace("[RTXXX]",@productnumber)</span></h2> 161 } 162 </a> 163 @SnippetStart("Modals") 164 <div id='product-modal-@GetString("Item.Id")' class="product-modal modal-light"><div class="column-xxs-22 column-lg-18 column-xl-14 column-xxs-left-1 column-lg-left-3 column-xl-left-5 column-xxs-top-6 column-xxs-bottom-2 column-md-top-2"><div class="wrap-inner"><div class="column-xxs-24"><span class="header"> 165 @GetString("Item.Header").Replace("[RTXXX]",@productnumber) 166 <span>@GetString("Item.Subheader").Replace("[RTXXX]",@productnumber)</span></span></div></div></div><div class="column-xxs-22 column-lg-18 column-xl-14 column-xxs-left-1 column-lg-left-3 column-xl-left-5"> 167 @RenderParagraphContent(GetInteger("Item.FormParagraph")) 168 </div><span class="icon-close"> 169 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-close.svg"))) { 170 <text>@System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-close.svg"))</text> 171 } 172 </span></div> 173 @SnippetEnd("Modals") 174 } else { 175 <a class="tablet-desktop-link" @if(!string.IsNullOrWhiteSpace(GetString("Item.LinkTitle"))) {<text>title='@GetString("Item.LinkTitle")'</text>}><span class='icon @iconClass'> 176 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath(GetString("Item.Icon"))) 177 </span><h2> 178 @GetString("Item.Header").Replace("[RTXXX]",@productnumber) 179 <span>@GetString("Item.Subheader").Replace("[RTXXX]",@productnumber)</span></h2><form action='/Default.aspx?Id=@GetString("Item.PostPage")' method="post" id='dw-form-@GetString("ParagraphID")'><div class="input-wrap"><input type="text" name='@GetString("Item.FieldName")' placeholder='@GetString("Item.FieldPlaceholder")' autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" /><button class="arrow-link"> 180 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg"))) { 181 <span> 182 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 183 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 184 </span> 185 } 186 </button></div></form></a><a class="mobile-link" data-target='product-modal-@GetString("Item.Id")'><span class='icon @iconClass'> 187 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath(GetString("Item.Icon"))) 188 </span><h2><span>@GetString("Item.MobileHeader").Replace("[RTXXX]",@productnumber)</span></h2></a> 189 @SnippetStart("Modals") 190 <div id='product-modal-@GetString("Item.Id")' class="product-modal modal-light"><div class="column-xxs-22 column-lg-18 column-xl-14 column-xxs-left-1 column-lg-left-3 column-xl-left-5 column-xxs-top-6 column-xxs-bottom-2 column-md-top-2"><div class="wrap-inner"><div class="column-xxs-24"><span class="header"> 191 @GetString("Item.Header").Replace("[RTXXX]",@productnumber) 192 <span>@GetString("Item.Subheader").Replace("[RTXXX]",@productnumber)</span></span></div></div></div><div class="column-xxs-22 column-lg-18 column-xl-14 column-xxs-left-1 column-lg-left-3 column-xl-left-5 column-xxs-top-6 column-xxs-bottom-2 column-md-top-2"><form action='/Default.aspx?Id=@GetString("Item.PostPage")' method="post" id='dw-form-@GetString("ParagraphID")'><div class="input-wrap"><input type="text" name='@GetString("Item.FieldName")' placeholder='@GetString("Item.FieldPlaceholder")' autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" /><button class="arrow-link"> 193 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg"))) { 194 <span> 195 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 196 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 197 </span> 198 } 199 </button></div></form></div><span class="icon-close"> 200 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-close.svg"))) { 201 <text>@System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-close.svg"))</text> 202 } 203 </span></div> 204 @SnippetEnd("Modals") 205 } 206 } else { 207 <a @if(GetString("Item.Type") == "link") {<text>href=@link</text>} 208 @if(!string.IsNullOrWhiteSpace(GetString("Item.LinkTitle"))) {<text>title='@GetString("Item.LinkTitle")'</text>} 209 @if(GetString("Item.Type") == "modal-form") {<text>data-target='modal-@GetString("Item.ModalFormParagraph")'</text>} 210 @(GetString("Item.ActionID") == "samples" ? "data-callback='hubspotLoad'" : null) 211 @if (GetBoolean("Item.IsVisualizationToolLink")) {<text>target="_blank"</text>} 212 @if (!string.IsNullOrWhiteSpace(GetString("Item.OpenTrackingCategory"))) {<text>data-open-tracking-category='@GetString("Item.OpenTrackingCategory")'</text>} 213 @if (!string.IsNullOrWhiteSpace(GetString("Item.OpenTrackingAction"))) {<text>data-open-tracking-action='@GetString("Item.OpenTrackingAction")'</text>}><span class='icon @iconClass'> 214 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath(GetString("Item.Icon"))) 215 </span><h2> 216 @GetString("Item.Header").Replace("[RTXXX]",@productnumber) 217 <span>@GetString("Item.Subheader").Replace("[RTXXX]",@productnumber)</span></h2><h2><span>@GetString("Item.MobileHeader").Replace("[RTXXX]",@productnumber)</span></h2> 218 @if (GetString("Item.Type") == "link") { 219 <span><span class="arrow-link"> 220 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg"))) { 221 <span> 222 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 223 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 224 </span> 225 } 226 </span> 227 @GetString("Item.LinkText") 228 </span> 229 } else if (GetString("Item.Type") == "modal-form") { 230 <span><span class="arrow-link"> 231 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg"))) { 232 <span> 233 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 234 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 235 </span> 236 } 237 </span> 238 @GetString("Item.FormLinkText") 239 </span> 240 } 241 </a> 242 } 243 </div></div> 244 } 245
Dieses moderne Einfamilienhaus ist komplett gemauert. Komplett gemauerte Gebäude sind robust und halten auch raueren Klimabedingungen stand, da der Ziegel gegenüber anderen Baumaterialien einzigartige Vorteile hat. Komplett gemauerte Wände tragen zu einem gesunden Raumklima, zu Energiefreundlichkeit und zu Haltbarkeit über mehrere Generationen hinweg bei.
Warum ist Wohlbefinden etwas, das man baut?Träumen Sie von einer gemütlichen Ecke für die lauen Sommernächte? Stilvolle, mit Ziegeln gepflasterte Außenbereiche schaffen kleine Oasen zur Erholung, die generationenlang Freude bereiten. Die Pflasterung mit echten Ziegeln ist nämlich ein extrem robustes Naturmaterial, das so gut wie nicht gewartet werden muss und mit der Zeit eine hübsche Patina bekommt.
Lassen Sie den Traum von einer neuen Terrasse wahr werdenError executing template "/Designs/randers-tegl/Paragraph/rt-2.0.bricktiler.cshtml" System.NullReferenceException: Object reference not set to an instance of an object. at CompiledRazorTemplates.Dynamic.RazorEngine_1b5394a99f3c42cbb80e370d5b5b85a3.Execute() in D:\dynamicweb.net\Solutions\Gotcha\randerstegl.cloud.dynamicweb-cms.com\files\Templates\Designs\randers-tegl\Paragraph\rt-2.0.bricktiler.cshtml:line 13 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 @SnippetStart("Modals") 2 <script> 3 var brickimages = []; 4 </script><div id='modal-@GetString("ParagraphID")' class="product-modal modal-light-grey"> 5 @{ 6 bool showBrickTiler = true; 7 string[] brickimages; 8 9 string productid = System.Web.HttpContext.Current.Request.QueryString.Get("ProductID"); 10 11 Dynamicweb.Ecommerce.Products.Product p = Dynamicweb.Ecommerce.Services.Products.GetProductById(productid, "", true); 12 13 string productnumber = p.Number.Replace(" ",""); 14 string productName = p.Name; 15 string isWild = p.ProductFieldValues.GetProductFieldValue("BrickTilerVildtForbandt").Value.ToString(); 16 17 try { 18 brickimages = System.IO.Directory.GetFiles(System.Web.HttpContext.Current.Server.MapPath("~\\files\\images\\bricktiler\\" + productnumber)); 19 20 foreach (string brickImage in brickimages) { 21 string filepath = brickImage.Substring(brickImage.IndexOf("\\files"), brickImage.Length - brickImage.IndexOf("\\files")).Replace("\\","/"); 22 23 if (filepath.Contains(".png")) { 24 <script> 25 brickimages.push('@filepath'); 26 </script> 27 } 28 } 29 } catch { 30 showBrickTiler = false; 31 } 32 33 if (showBrickTiler) { 34 <div class="wrap-fluid" id="bricktiler"><div class="wrap-inner"><div class="column-xxs-22 column-xxs-left-1 column-xxs-top-6 column-xxs-bottom-2 column-md-top-2"><div id="brickTilerWrap"> 35 @if (GetGlobalValue("Global:Device.IsDesktop").ToString().ToLower() == "true") { 36 <div class="dropdowns"> 37 @if (isWild.ToLower() == "false") { 38 <ul class="drop-down" role="menu"><li class="bonds"><a>@Translate("RT-2.0_vaelgforbandt")</a><ul> 39 @RenderItemList(new { 40 ItemType = "ForbandtTyper", 41 ListSourceType = "Area", 42 ListSourceArea = Pageview.Area.ID, 43 IncludeParagraphItems = false, 44 ItemFieldsList = "*", 45 ListOrderBy = "Created", 46 ListTemplate = "ItemPublisher/List/Bonds.cshtml", 47 ListPageSize = 100 48 }) 49 </ul> 50 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg"))) { 51 <span class="icon-down"> 52 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 53 </span> 54 } 55 </li></ul> 56 } 57 <ul class="drop-down" role="menu"><li class="grooves"><a>@Translate("RT-2.0_vaelgfugefarve")</a><ul> 58 @RenderItemList(new { 59 ItemType = "Fugefaver", 60 ListSourceType = "Area", 61 ListSourceArea = Pageview.Area.ID, 62 IncludeParagraphItems = false, 63 ItemFieldsList = "*", 64 ListOrderBy = "Created", 65 ListTemplate = "ItemPublisher/List/Grooves.cshtml", 66 ListPageSize = 100 67 }) 68 </ul> 69 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg"))) { 70 <span class="icon-down"> 71 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 72 </span> 73 } 74 </li></ul></div> 75 } else { 76 if (isWild.ToLower() == "false") { 77 <select id="bond-select"> 78 @RenderItemList(new { 79 ItemType = "ForbandtTyper", 80 ListSourceType = "Area", 81 ListSourceArea = Pageview.Area.ID, 82 IncludeParagraphItems = false, 83 ItemFieldsList = "*", 84 ListOrderBy = "Created", 85 ListTemplate = "ItemPublisher/List/Bonds-native.cshtml", 86 ListPageSize = 100 87 }) 88 </select> 89 } 90 <select id="groove-select"> 91 @RenderItemList(new { 92 ItemType = "Fugefaver", 93 ListSourceType = "Area", 94 ListSourceArea = Pageview.Area.ID, 95 IncludeParagraphItems = false, 96 ItemFieldsList = "*", 97 ListOrderBy = "Created", 98 ListTemplate = "ItemPublisher/List/Grooves-native.cshtml", 99 ListPageSize = 100 100 }) 101 </select> 102 } 103 @if (GetGlobalValue("Global:Device.IsDesktop").ToString().ToLower() == "true") { 104 <div class="save"><a id="bricktiler_savepackage"><span class="arrow-link"><span> 105 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg"))) { 106 <span> 107 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 108 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 109 </span> 110 } 111 </span></span> 112 @Translate("RT-2.0_SavePackage") 113 </a></div> 114 } 115 <div id="canvasImg"><canvas id="myCanvas" width="1200px" height="630px" style="background-color:#fdfdfd"></canvas><!--canvas id="myCanvas" width="1900px" height="997px" style="background-color:#fdfdfd"></canvas--></div></div></div></div></div> 116 } 117 } 118 <span class="icon-close"> 119 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/files/Templates/Designs/randers-tegl/images-rt-2.0/icon-close.svg"))) { 120 <text>@System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/files/Templates/Designs/randers-tegl/images-rt-2.0/icon-close.svg"))</text> 121 } 122 </span></div><script src="/files/Templates/Designs/randers-tegl/js/bricktiler.min.js" async defer"></script><!--script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script><script src="/files/Templates/Designs/randers-tegl/js/jspdf/libs/filesaver.js/FileSaver.js"></script><script src="//cdnjs.cloudflare.com/ajax/libs/jszip/2.5.0/jszip.min.js"></script><script src="/files/Templates/Designs/randers-tegl/js/bricktiler6.js"></script--><script> 123 var track = false; 124 </script> 125 @if (Pageview.Area.ID != 8) { 126 <script> 127 track = true; 128 </script> 129 } 130 <script> 131 var checkjquery = setInterval(function() { 132 if (window.jQuery) { 133 clearInterval(checkjquery); 134 initBrickTiler(); 135 } 136 },10); 137 138 function initBrickTiler() { 139 /*if ($('html').hasClass('canvas')) {*/ 140 var timerStart = -1; 141 var timerEnd = -1; 142 143 /* ---------- Start timer when clicking save package button */ 144 if ($('#bricktiler').length > 0) { 145 $('#bricktiler_savepackage').click(function() { 146 // TODO: Start timer 147 var tmpStart = new Date(); 148 timerStart = tmpStart.getTime(); 149 150 if (track) { 151 ga('send', 'event', { 152 eventCategory: 'Murstenskonfigurator', 153 eventAction: 'Start download texture' 154 }); 155 } 156 }); 157 } 158 159 var selectedbond = ""; 160 var selectedbondname = ""; 161 var selectedgrooveimage = "" 162 var selectedgroovename = ""; 163 var usenative = false; 164 var vildtforbandt = '@isWild'; 165 166 if ($('#groove-select').length > 0) { 167 usenative = true; 168 } 169 170 if (vildtforbandt.toLowerCase() == 'true') { 171 if (usenative) { 172 selectedbond = []; 173 selectedbondname = 'Vildtforbandt'; 174 selectedgrooveimage = [$($('#groove-select option')[0]).attr('data-image-src')]; 175 selectedgroovename = $($('#groove-select option')[0]).attr('data-color-name'); 176 } else { 177 selectedbond = []; 178 selectedbondname = 'Vildtforbandt'; 179 selectedgrooveimage = [$($('#bricktiler .grooves ul li a')[0]).attr('data-image-src')]; 180 selectedgroovename = $($('#bricktiler .grooves ul li a')[0]).attr('data-color-name'); 181 } 182 } else { 183 if (usenative) { 184 selectedbond = JSON.parse($($('#bond-select option')[0]).attr('data-bond')); 185 selectedbondname = $($('#bond-select option')[0]).attr('data-bond-name'); 186 selectedgrooveimage = [$($('#groove-select option')[0]).attr('data-image-src')]; 187 selectedgroovename = $($('#groove-select option')[0]).attr('data-color-name'); 188 } else { 189 selectedbond = JSON.parse($($('#bricktiler .bonds ul li a')[0]).attr('data-bond')); 190 selectedbondname = $($('#bricktiler .bonds ul li a')[0]).attr('data-bond-name'); 191 selectedgrooveimage = [$($('#bricktiler .grooves ul li a')[0]).attr('data-image-src')]; 192 selectedgroovename = $($('#bricktiler .grooves ul li a')[0]).attr('data-color-name'); 193 } 194 } 195 196 $('#bricktiler .bonds ul li a').click(function() { 197 var selectedbondname = $(this).attr('data-bond-name'); 198 var selectedbond = JSON.parse($(this).attr('data-bond')); 199 200 brickTiler.switchBond(selectedbond, selectedbondname); 201 }); 202 203 $('#bricktiler .grooves ul li a').click(function() { 204 var selectedgroovename = $(this).attr('data-color-name'); 205 var selectedgrooveimage = [$(this).attr('data-image-src')]; 206 207 brickTiler.switchGroove(selectedgrooveimage, selectedgroovename); 208 }); 209 210 $('#bond-select').change(function(e) { 211 var selectedbondname = $(this).find('option:selected').attr('data-bond-name'); 212 var selectedbond = JSON.parse($(this).find('option:selected').attr('data-bond')); 213 214 brickTiler.switchBond(selectedbond, selectedbondname); 215 }); 216 217 $('#groove-select').change(function(e) { 218 var selectedgroovename = $(this).find('option:selected').attr('data-color-name'); 219 var selectedgrooveimage = [$(this).find('option:selected').attr('data-image-src')]; 220 221 brickTiler.switchGroove(selectedgrooveimage, selectedgroovename); 222 }); 223 224 $('#bricktiler_saveaspdf').click(function() { 225 showloader(); 226 227 setTimeout(function() { 228 brickTiler.savePdf('text here...').done(function() { 229 hideloader(); 230 }); 231 },300); 232 }); 233 234 $('#bricktiler_savepackage').click(function() { 235 showloader(); 236 237 $('body').append('<div id="downloadmessage" style="z-index: 999999; color: #fff; position: fixed; max-width: 960px; line-height: 40px; top: 50%; left: 0; right: 0; text-align: center; margin: auto;">Vent venligst. Du vil om kort tid modtage en zip-fil med den valgte tekstur. Det kan tage op til 30 sekunder afhængig af din internetforbindelse.</div>'); 238 239 setTimeout(function() { 240 brickTiler.saveZip().done(function() { 241 hideloader(); 242 $('#downloadmessage').remove(); 243 244 var tmpEnd = new Date(); 245 timerEnd = tmpEnd.getTime(); 246 247 var seconds = (timerEnd - timerStart) / 1000; 248 249 if (track) { 250 ga('send', 'event', { 251 eventCategory: 'Murstenskonfigurator', 252 eventAction: 'Slut download texture', 253 eventLabel: 'download tid = ' + seconds 254 }); 255 } 256 }); 257 },300); 258 }); 259 260 function showloader() { 261 $('body').addClass('js-bricktiler-loading'); 262 } 263 264 function hideloader() { 265 $('body').removeClass('js-bricktiler-loading'); 266 } 267 268 function init() { 269 if (document.getElementById("myCanvas")){ 270 setTimeout(function() { 271 brickTiler.init( 272 document.getElementById('myCanvas'), 273 brickimages, 274 '@productnumber @productName', 275 selectedgrooveimage, 276 selectedgroovename, 277 selectedbond, 278 selectedbondname 279 ).done(function(){ 280 //console.log("Init done!"); 281 }); 282 }, 10); 283 } else{ 284 document.getElementById("bricktiler").setAttribute("style","display:none"); 285 } 286 } 287 288 init(); 289 290 /*$('.dropdowns ul li ul a').click(function() { 291 $('.dropdowns ul li ul a.js-selected').removeClass('js-selected'); 292 $(this).addClass('js-selected'); 293 var text = $(this).html(); 294 $(this).parent().parent().parent().find('> a').html(text); 295 });*/ 296 /*}*/ 297 } 298 </script> 299 @SnippetEnd("Modals") 300
Error executing template "Designs/randers-tegl/Forms/Form/rt-2.0.product-question-form.cshtml" System.NullReferenceException: Object reference not set to an instance of an object. at CompiledRazorTemplates.Dynamic.RazorEngine_e1ddc611bc8b4713b0224d4931315221.Execute() in D:\dynamicweb.net\Solutions\Gotcha\randerstegl.cloud.dynamicweb-cms.com\files\Templates\Designs\randers-tegl\Forms\Form\rt-2.0.product-question-form.cshtml:line 9 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 @{ 2 int areaId = Dynamicweb.Frontend.PageView.Current().Area.ID; 3 string areaName = Dynamicweb.Frontend.PageView.Current().Area.Name; 4 5 string productid = System.Web.HttpContext.Current.Request.QueryString.Get("ProductID"); 6 7 Dynamicweb.Ecommerce.Products.Product p = Dynamicweb.Ecommerce.Services.Products.GetProductById(productid, "", true); 8 9 string productname = p.Name; 10 string productnumber = p.Number; 11 string path = Pageview.SearchFriendlyUrl; 12 } 13 14 <div class="wrap-inner"><div class="column-xxs-24"> 15 @if (areaId != 9) { 16 <span class="header">@Translate("RT-2.0_Har_du_spoergsmaal_til_dette_produkt_modal_overskrift")</span> 17 } else { 18 <span class="header">@Translate("RT-2.0_Har_du_spoergsmaal_til_dette_produkt_modal_overskrift_DE_simple")</span> 19 } 20 </div></div> 21 @GetString("Form.FormStart") 22 <div class="wrap-inner" id="questionFormWrap"><div class="centered-content"> 23 @GetString("Form.SystemFields") 24 <div> 25 @foreach (var field in GetLoop("Fields")) { 26 if (field.GetString("Field.SystemName").ToLower() == "sprog") { 27 <input type="hidden" name='@field.GetString("Field.SystemName")' id='@field.GetString("Field.SystemName")' value='@areaName' /> 28 } else if (field.GetString("Field.SystemName").ToLower() == "produktnavn") { 29 <input type="hidden" name='@field.GetString("Field.SystemName")' id='@field.GetString("Field.SystemName")' value='@productname' /> 30 } else if (field.GetString("Field.SystemName").ToLower() == "produktnr") { 31 <input type="hidden" name='@field.GetString("Field.SystemName")' id='@field.GetString("Field.SystemName")' value='@productnumber' /> 32 } else if (field.GetString("Field.Name").ToLower() == "formsubmitaction") { 33 <input type="hidden" name='@field.GetString("Field.Name")' value="page"> 34 } else if (field.GetString("Field.Name").ToLower() == "formsubmitpageaftersave") { 35 <input type="hidden" name='@field.GetString("Field.Name")' value='@("/Default.aspx?Id=")@Pageview.Page.ID@("&ProductId=")@System.Web.HttpContext.Current.Request.QueryString.Get("ProductID")@("&modal=question-thank-you#product-actions")' /> 36 } else if (field.GetString("Field.Type").ToLower() == "hidden") { 37 @field.GetString("Field.Control") 38 } else if (field.GetString("Field.SystemName").ToLower() == "samtykkehenvendelse") { 39 <div class="input-wrap"><input type="checkbox" required name='@field.GetString("Field.HtmlId")' id='@("p-")@Pageview.CurrentParagraph.ID@("-")@field.GetString("Field.HtmlId")' /><label class="form-consent" for='@("p-")@Pageview.CurrentParagraph.ID@("-")@field.GetString("Field.HtmlId")'>@Translate("RT-2.0_Samtykke_henvendelse") 40 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-checkmark.svg"))) { 41 <span class="icon-checkmark">@System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-checkmark.svg"))</span> 42 } 43 </label></div> 44 } else if (field.GetString("Field.Type").ToLower() == "submit") { 45 <div class="input-wrap"><button type="submit"><span class="arrow-link"> 46 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg"))) { 47 <span> 48 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 49 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 50 </span> 51 } 52 </span> 53 @Translate("RT-2.0_Send_spoergsmaal_til_ekspert") 54 </button></div> 55 } else if (field.GetString("Field.Type").ToLower() == "textarea") { 56 <div class="input-wrap"><p>@Translate("RT-2.0_Produkt_spoergsmaal_tekst")</p></div><div class='input-wrap @if (field.GetString("Field.Name").ToLower() == "postnr") {<text>zipcode-wrap</text>}'><textarea id='@field.GetString("Field.SystemName")' name='@field.GetString("Field.SystemName")' placeholder='@Translate("RT-2.0_" + field.GetString("Field.Placeholder"))' @if(field.GetBoolean("Field.Required")) {<text>required</text>}></textarea></div> 57 } else { 58 if (field.GetString("Field.SystemName").ToLower() == "firma") { 59 if (areaId != 1) { 60 <div class='input-wrap @if (field.GetString("Field.Name").ToLower() == "postnr") {<text>zipcode-wrap</text>}'><input type='@field.GetString("Field.Type").ToLower().Replace("input","")' id='@field.GetString("Field.SystemName")' name='@field.GetString("Field.SystemName")' placeholder='@Translate("RT-2.0_" + field.GetString("Field.Placeholder"))' @if(field.GetBoolean("Field.Required")) {<text>required</text>} /></div> 61 } 62 } else { 63 <div class='input-wrap @if (field.GetString("Field.Name").ToLower() == "postnr") {<text>zipcode-wrap</text>}'><input type='@field.GetString("Field.Type").ToLower().Replace("input","")' id='@field.GetString("Field.SystemName")' name='@field.GetString("Field.SystemName")' placeholder='@Translate("RT-2.0_" + field.GetString("Field.Placeholder"))' @if(field.GetBoolean("Field.Required")) {<text>required</text>} /></div> 64 } 65 } 66 } 67 </div></div></div> 68 @GetString("Form.FormEnd") 69 70 71
Vielen Dank für Ihr Interesse an unseren Produkten. Ihre Musterbestellung wird schnellstmöglich abgeschickt. Für Fragen stehen wir Ihnen gerne zur Verfügung
RT-2.0_Tak_for_din_interesse_reference_modal_tekst
Wir melden uns bei Ihnen
Ihre Bestellung wird schnellstmöglich abgeschickt.
Wir werden Ihnen die Adressen so schnell wie möglich zusenden. Während Sie warten, können Sie gerne einen Rundgang in unserem Inspirationsuniversum machen.