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_7ec4d585d18c41c1b427a29cdb7973c6.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_7ec4d585d18c41c1b427a29cdb7973c6.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_7ec4d585d18c41c1b427a29cdb7973c6.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_7ec4d585d18c41c1b427a29cdb7973c6.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_7ec4d585d18c41c1b427a29cdb7973c6.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
Der Ziegelbelag ist ein äußerst widerstandsfähiges Naturmaterial, das stilreine Außenbereiche wie Terrassen, Gartenwege und Einfahrten vollendet. Der Ziegelbelag erhält mit der Zeit eine hübsche Patina und ist so gut wie wartungsfrei.
Lassen Sie den Traum von einer neuen Terrasse wahr werdenEin komplett gemauertes Haus für das dynamische Familienleben und das raue Klima, da der Ziegel gegenüber anderen Baumaterialien einzigartige Vorteile hat. Ein gesundes Raumklima ist nur einer der Vorteile eines komplett gemauerten Zuhauses. Die Ziegel sorgen zu allen Jahreszeiten für ein angenehmes Raumklima, sind energiefreundlich und sehr widerstandsfähig.
Warum ist Wohlbefinden etwas, das man baut?Error executing template "Designs/randers-tegl/Forms/Form/rt-2.0.product-samples-form.cshtml" System.NullReferenceException: Object reference not set to an instance of an object. at CompiledRazorTemplates.Dynamic.RazorEngine_762d93275ed8436d9763c12dc079056c.Execute() in D:\dynamicweb.net\Solutions\Gotcha\randerstegl.cloud.dynamicweb-cms.com\files\Templates\Designs\randers-tegl\Forms\Form\rt-2.0.product-samples-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 string trigger = "Erhverv"; 14 15 if (Pageview.Area.ID == 8) { 16 trigger = "Bedrift"; 17 } 18 } 19 20 <div class="wrap-inner"><div class="column-xxs-24"><span class="header">@Translate("RT-2.0_Bestil_en_gratis_proevekasse")</span></div></div><div class="wrap-inner" id="samplesFormWrap"><div class="centered-content"><div> 21 @GetString("Form.FormStart") 22 @GetString("Form.SystemFields") 23 @foreach (var field in GetLoop("Fields")) { 24 if (field.GetString("Field.Name").ToLower() == "formsubmitaction") { 25 <input type="hidden" name='@field.GetString("Field.Name")' value="page"> 26 } else if (field.GetString("Field.Name").ToLower() == "formsubmitpageaftersave") { 27 <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=samples-thank-you#product-actions")' /> 28 } else if (field.GetString("Field.SystemName").ToLower() == "sprog") { 29 <input type="hidden" name='@field.GetString("Field.SystemName")' id='@field.GetString("Field.SystemName")' value='@areaName' /> 30 } else if (field.GetString("Field.SystemName").ToLower() == "produktnavn") { 31 <input type="hidden" name='@field.GetString("Field.SystemName")' id='@field.GetString("Field.SystemName")' value='@productname' /> 32 } else if (field.GetString("Field.SystemName").ToLower() == "produktnr") { 33 <input type="hidden" name='@field.GetString("Field.SystemName")' id='@field.GetString("Field.SystemName")' value='@productnumber' /> 34 } else if (field.GetString("Field.SystemName").ToLower() == "produkttype") { 35 if (path.Contains("tagsten") || path.Contains("dachziegel") || path.Contains("taktegel")) { 36 <input type="hidden" name='@field.GetString("Field.SystemName")' id='@field.GetString("Field.SystemName")' value="tagsten" /> 37 } else if (path.Contains("mursten") || path.Contains("mauerziegel") || (path.Contains("tegel") && !path.Contains("taktegel"))) { 38 <input type="hidden" name='@field.GetString("Field.SystemName")' id='@field.GetString("Field.SystemName")' value="mursten" /> 39 } 40 } else if (field.GetString("Field.Type").ToLower() == "hidden") { 41 @field.GetString("Field.Control") 42 } else if (field.GetString("Field.Type").ToLower() == "select") { 43 if (areaId == 1 || areaId == 8 || areaId == 10) { 44 if (GetGlobalValue("Global:Device.IsDesktop").ToString().ToLower() == "true") { 45 if ((areaId == 10 && field.GetString("Field.SystemName").ToLower() != "jeger") || areaId == 1 || areaId == 8) { 46 <div class='input-wrap @if(field.GetString("Field.SystemName").ToLower() == "jeger") {<text>js-hide</text>}' @if(field.GetString("Field.SystemName").ToLower() == "jeger") {<text>data-trigger="@trigger"</text>}><ul class="drop-down" role="menu" data-input-container-id='input_@field.GetString("Field.SystemName")' @if(field.GetString("Field.SystemName") == "Leveringsadresse") {<text>data-trigger-fields='Navn,Firmanavn,Attnavn,Jeger'</text>}><li><a>@Translate("RT-2.0_" + @field.GetString("Field.SystemName"))</a><ul> 47 @foreach (var fieldOption in field.GetLoop("Options")) { 48 <li data-value='@fieldOption.GetString("Option.Value")'><a>@Translate("RT-2.0_" + fieldOption.GetString("Option.Text"))</a></li> 49 } 50 </ul> 51 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/files/templates/designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg"))) { 52 <span class="icon-down"> 53 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/files/templates/designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 54 </span> 55 } 56 </li></ul></div><div id='input_@field.GetString("Field.SystemName")' class="hidden"><input type="hidden" name='@field.GetString("Field.SystemName")' id='@field.GetString("Field.SystemName")' /></div> 57 } 58 } else { 59 if ((areaId == 10 && field.GetString("Field.SystemName").ToLower() != "jeger") || areaId == 1 || areaId == 8) { 60 <select name='@field.GetString("Field.SystemName")' id='@field.GetString("Field.SystemName")' @if(field.GetString("Field.SystemName") == "Leveringsadresse") {<text>data-trigger-fields='Navn,Firmanavn,Attnavn'</text>}> 61 @foreach (var fieldOption in field.GetLoop("Options")) { 62 <option value='@fieldOption.GetString("Option.Value")'>@Translate("RT-2.0_" + fieldOption.GetString("Option.Text"))</option> 63 } 64 </select> 65 } 66 } 67 } 68 } else if (field.GetString("Field.SystemName").ToLower() == "bemaerkninger") { 69 if (areaId == 8 || areaId == 9 || areaId == 10) { 70 <div class="input-wrap" data-system-name='@field.GetString("Field.SystemName")' data-pageview='@areaId'><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> 71 } 72 } else if (field.GetString("Field.SystemName").ToLower() == "samtykkeproevepakke") { 73 <div class="input-wrap"><input type="checkbox" required name='@field.GetString("Field.HtmlId")' id='@field.GetString("Field.HtmlId")' /><label class="form-consent" for='@field.GetString("Field.HtmlId")'>@Translate("RT-2.0_Samtykke_Prøvepakke") 74 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/files/templates/designs/randers-tegl/images-rt-2.0/icon-checkmark.svg"))) { 75 <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> 76 } 77 </label></div> 78 } else if (field.GetString("Field.Type").ToLower() == "submit") { 79 <div class="input-wrap"><button type="submit"><span class="arrow-link"> 80 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/files/templates/designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg"))) { 81 <span> 82 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/files/templates/designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 83 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/files/templates/designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 84 </span> 85 } 86 </span> 87 @Translate("RT-2.0_Bestil_proevekasse") 88 </button></div> 89 } else { 90 if ((field.GetString("Field.SystemName").ToLower() == "firmanavn" || field.GetString("Field.SystemName").ToLower() == "attnavn")) { 91 if (areaId == 1 || areaId == 8 || areaId == 10) { 92 <div class="input-wrap js-hide" data-trigger="@trigger"><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> 93 } 94 if (field.GetString("Field.SystemName").ToLower() == "firmanavn" && areaId == 9) { 95 <div class="input-wrap"><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> 96 } 97 } else { 98 <div class='input-wrap @if (field.GetString("Field.Name").ToLower() == "postnr") {<text>zipcode-wrap</text>}' data-trigger="Privat"><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> 99 } 100 } 101 } 102 @GetString("Form.FormEnd") 103 </div><div><img src="/files/templates/designs/randers-tegl/images-rt-2.0/product-order-samples.png" alt="" /></div></div></div> 104
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_40193b93fece4296a3c2324ebac8acda.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
Error executing template "Designs/randers-tegl/Forms/Form/rt-2.0.product-brochure-form.cshtml" System.NullReferenceException: Object reference not set to an instance of an object. at CompiledRazorTemplates.Dynamic.RazorEngine_e46c32a2352a462e80f9d42dc622ef90.Execute() in D:\dynamicweb.net\Solutions\Gotcha\randerstegl.cloud.dynamicweb-cms.com\files\Templates\Designs\randers-tegl\Forms\Form\rt-2.0.product-brochure-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"><span class="header">@Translate("RT-2.0_Bestil_eller_hent_brochurer")</span></div></div> 15 @GetString("Form.FormStart") 16 <div class="wrap-inner" id="brochureFormWrap"><div class="centered-content"><div> 17 @GetString("Form.SystemFields") 18 <input type="hidden" name="PID" value="@Dynamicweb.Frontend.PageView.Current().CurrentParagraph.ID" /> 19 @foreach (var field in GetLoop("Fields")) { 20 if (field.GetString("Field.SystemName").ToLower() == "sprog") { 21 <input type="hidden" name='@field.GetString("Field.SystemName")' id='@field.GetString("Field.SystemName")' value='@areaName' /> 22 } else if (field.GetString("Field.SystemName").ToLower() == "produktnavn") { 23 <input type="hidden" name='@field.GetString("Field.SystemName")' id='@field.GetString("Field.SystemName")' value='@productname' /> 24 } else if (field.GetString("Field.SystemName").ToLower() == "produktnr") { 25 <input type="hidden" name='@field.GetString("Field.SystemName")' id='@field.GetString("Field.SystemName")' value='@productnumber' /> 26 } 27 if (field.GetString("Field.Type").ToLower() == "checkbox") { 28 if (field.GetString("Field.SystemName").ToLower() == "fuldmuretbyggeri") { 29 if (areaId == 1 || areaId == 7 || areaId == 8) { 30 <div class="input-wrap"> 31 @field.GetString("Field.Control") 32 <label for='@field.GetString("Field.SystemName")'> 33 @Translate("RT-2.0_" + field.GetString("Field.Name")) 34 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/files/templates/designs/randers-tegl/images-rt-2.0/icon-checkmark.svg"))) { 35 <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> 36 } 37 </label><a href='@field.GetString("Field.Description")' target="_blank"> 38 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/files/templates/designs/randers-tegl/images-rt-2.0/icon-download.svg"))) { 39 <text>@System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/files/templates/designs/randers-tegl/images-rt-2.0/icon-download.svg"))</text> 40 } 41 </a></div> 42 } 43 } else if (field.GetString("Field.SystemName").ToLower() != "samtykkebrochurer") { 44 <div class="input-wrap"> 45 @field.GetString("Field.Control") 46 <label for='@field.GetString("Field.SystemName")'> 47 @Translate("RT-2.0_" + field.GetString("Field.Name")) 48 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/files/templates/designs/randers-tegl/images-rt-2.0/icon-checkmark.svg"))) { 49 <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> 50 } 51 </label><a href='@field.GetString("Field.Description")' target="_blank"> 52 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/files/templates/designs/randers-tegl/images-rt-2.0/icon-download.svg"))) { 53 <text>@System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/files/templates/designs/randers-tegl/images-rt-2.0/icon-download.svg"))</text> 54 } 55 </a></div> 56 } 57 } 58 } 59 <div class="input-wrap"><a href='/Default.aspx?Id=@Pageview.Area.Item["BrochureSide"].ToString()'>@Translate("RT-2.0_Se_flere_brochurer")</a></div></div><div> 60 @foreach (var field in GetLoop("Fields")) { 61 if (field.GetString("Field.Type") != "CheckBox" || field.GetString("Field.SystemName").ToLower() == "samtykkebrochurer") { 62 if (field.GetString("Field.Name").ToLower() == "formsubmitaction") { 63 <input type="hidden" name='@field.GetString("Field.Name")' value="page"> 64 } else if (field.GetString("Field.Name").ToLower() == "formsubmitpageaftersave") { 65 <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=brochure-thank-you#product-actions")' /> 66 } else if (field.GetString("Field.Type").ToLower() == "hidden") { 67 @field.GetString("Field.Control") 68 } else if (field.GetString("Field.SystemName").ToLower() == "samtykkebrochurer") { 69 <div class="input-wrap"><input type="checkbox" required name='@field.GetString("Field.HtmlId")' id='@field.GetString("Field.HtmlId")' /><label class="form-consent" for='@field.GetString("Field.HtmlId")'>@Translate("RT-2.0_Samtykke_brochurer") 70 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/files/templates/designs/randers-tegl/images-rt-2.0/icon-checkmark.svg"))) { 71 <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> 72 } 73 </label></div> 74 } else if (field.GetString("Field.Type").ToLower() == "submit") { 75 <div class="input-wrap"><button type="submit"><span class="arrow-link"> 76 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/files/templates/designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg"))) { 77 <span> 78 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/files/templates/designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 79 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/files/templates/designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 80 </span> 81 } 82 </span> 83 @Translate("RT-2.0_Bestil_brochurer") 84 </button></div> 85 } else { 86 <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> 87 } 88 } 89 } 90 </div></div></div> 91 @GetString("Form.FormEnd") 92
Error executing template "Designs/randers-tegl/Forms/Form/rt-2.0.product-question-form-DE.cshtml" System.NullReferenceException: Object reference not set to an instance of an object. at CompiledRazorTemplates.Dynamic.RazorEngine_52f70ee444fd40bc8a4c4b715408c0fe.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-DE.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 path = Pageview.SearchFriendlyUrl; 9 } 10 11 <div class="wrap-inner"><div class="column-xxs-24"><span class="header">@Translate("RT-2.0_Har_du_spoergsmaal_til_dette_produkt_modal_overskrift")</span> 12 @RenderParagraphContent(24296) 13 </div></div> 14 @GetString("Form.FormStart") 15 <div class="wrap-inner" id="questionFormWrap"><div class="centered-content"><div class="form-fields-container"><p><strong>Info</strong></p> 16 @GetString("Form.SystemFields") 17 @foreach (var field in GetLoop("Fields")) { 18 string fieldSystemName = field.GetString("Field.SystemName"); 19 20 if ( 21 fieldSystemName == "Anrede" || 22 fieldSystemName == "Vorname" || 23 fieldSystemName == "Name" || 24 fieldSystemName == "Firma" || 25 fieldSystemName == "Strase75" || 26 fieldSystemName == "PLZ" || 27 fieldSystemName == "Ort" || 28 fieldSystemName == "Land" || 29 fieldSystemName == "Telefon" || 30 fieldSystemName == "Mobil" || 31 fieldSystemName == "Email" || 32 field.GetString("Field.Type").ToLower() == "hidden" 33 ) { 34 if (field.GetString("Field.SystemName").ToLower() == "produktnavn") { 35 <input type="hidden" name='@field.GetString("Field.SystemName")' id='@field.GetString("Field.SystemName")' value='@productname' /> 36 } else if (field.GetString("Field.SystemName").ToLower() == "produktnr") { 37 <input type="hidden" name='@field.GetString("Field.SystemName")' id='@field.GetString("Field.SystemName")' value='@productnumber' /> 38 } else if (field.GetString("Field.Name").ToLower() == "formsubmitaction") { 39 <input type="hidden" name='@field.GetString("Field.Name")' value="page"> 40 } else if (field.GetString("Field.Name").ToLower() == "formsubmitpageaftersave") { 41 <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")' /> 42 } else if (field.GetString("Field.Type").ToLower() == "hidden") { 43 @field.GetString("Field.Control") 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 @field.GetString("Field.Name") 54 </button></div> 55 } else if (field.GetString("Field.Type").ToLower() == "textarea") { 56 <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="@field.GetString("Field.Placeholder")" @if(field.GetBoolean("Field.Required")) {<text>required</text>}></textarea></div> 57 } else if (field.GetString("Field.Type").ToLower() == "select") { 58 <div class="input-wrap"><ul class="drop-down" role="menu" data-input-container-id='input_@field.GetString("Field.SystemName")'><li><a>@field.GetString("Field.SystemName")</a><ul> 59 @foreach (var fieldOption in field.GetLoop("Options")) { 60 <li data-value='@fieldOption.GetString("Option.Value")'><a>@fieldOption.GetString("Option.Text")</a></li> 61 } 62 </ul> 63 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/files/templates/designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg"))) { 64 <span class="icon-down"> 65 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/files/templates/designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 66 </span> 67 } 68 </li></ul></div><div id='input_@field.GetString("Field.SystemName")' class="hidden"><input type="hidden" name='@field.GetString("Field.SystemName")' id='@field.GetString("Field.SystemName")' /></div> 69 } else if (field.GetString("Field.Type").ToLower() == "radio") { 70 <div class="input-wrap"> 71 @field.GetString("Field.Control") 72 </div> 73 } else { 74 <div class='input-wrap @if (field.GetString("Field.SystemName").ToLower() == "plz" || field.GetString("Field.SystemName") == "plz83") {<text>zipcode-wrap</text>}'><input type='@field.GetString("Field.Type").ToLower().Replace("input","")' id='@field.GetString("Field.SystemName")' name='@field.GetString("Field.SystemName")' placeholder="@field.GetString("Field.Placeholder")" @if(field.GetBoolean("Field.Required")) {<text>required</text>} /></div> 75 } 76 } 77 } 78 </div><div class="form-fields-container"><p><strong>Ihr bauvorhaben</strong></p> 79 @foreach (var field in GetLoop("Fields")) { 80 string fieldSystemName = field.GetString("Field.SystemName"); 81 82 if ( 83 fieldSystemName == "Strase82" || 84 fieldSystemName == "PLZ83" || 85 fieldSystemName == "Ort84" || 86 fieldSystemName == "Bauunternehmen" || 87 fieldSystemName == "Bauzeit" || 88 fieldSystemName == "Wunschformat" || 89 fieldSystemName == "Bedarf" || 90 fieldSystemName == "Stuck" || 91 fieldSystemName == "Handlerpraferenz" || 92 fieldSystemName == "Anmerkungen" || 93 fieldSystemName == "Anfrageabsenden" || 94 fieldSystemName == "SamtykkeHenvendelse" 95 ) { 96 if (field.GetString("Field.SystemName").ToLower() == "samtykkehenvendelse") { 97 <div class="input-wrap"><input type="checkbox" required name='@field.GetString("Field.HtmlId")' id='@field.GetString("Field.HtmlId")' /><label class="form-consent" for='@field.GetString("Field.HtmlId")'>@Translate("RT-2.0_Samtykke_henvendelse") 98 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/files/templates/designs/randers-tegl/images-rt-2.0/icon-checkmark.svg"))) { 99 <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> 100 } 101 </label></div> 102 } 103 if (field.GetString("Field.Type").ToLower() == "select") { 104 <div class="input-wrap"><ul class="drop-down" role="menu" data-input-container-id='input_@field.GetString("Field.SystemName")'><li><a>@field.GetString("Field.Name")</a><ul> 105 @foreach (var fieldOption in field.GetLoop("Options")) { 106 <li data-value='@fieldOption.GetString("Option.Value")'><a>@fieldOption.GetString("Option.Text")</a></li> 107 } 108 </ul> 109 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/files/templates/designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg"))) { 110 <span class="icon-down"> 111 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/files/templates/designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 112 </span> 113 } 114 </li></ul></div><div id='input_@field.GetString("Field.SystemName")' class="hidden"><input type="hidden" name='@field.GetString("Field.SystemName")' id='@field.GetString("Field.SystemName")' @if(field.GetString("Field.SystemName") == "Stuck") {<text>value='@field.GetString("Field.Name")'</text>} /></div> 115 } else if (field.GetString("Field.Type").ToLower() == "submit") { 116 <div class="input-wrap"><button type="submit"><span class="arrow-link"> 117 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/files/templates/designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg"))) { 118 <span> 119 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/files/templates/designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 120 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/files/templates/designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 121 </span> 122 } 123 </span> 124 @field.GetString("Field.Name") 125 </button></div> 126 } else if (field.GetString("Field.Type").ToLower() == "textarea") { 127 <div class="input-wrap"><textarea id='@field.GetString("Field.SystemName")' name='@field.GetString("Field.SystemName")' placeholder="@field.GetString("Field.Placeholder")" @if(field.GetBoolean("Field.Required")) {<text>required</text>}></textarea></div> 128 } else { 129 <div class='input-wrap @if (fieldSystemName.ToLower() == "plz83") {<text>zipcode-wrap</text>} else if (fieldSystemName.ToLower() == "bedarf") {<text>half-wrap</text>}'><input type='@field.GetString("Field.Type").ToLower().Replace("input","")' id='@field.GetString("Field.SystemName")' name='@field.GetString("Field.SystemName")' placeholder="@field.GetString("Field.Placeholder")" @if(field.GetBoolean("Field.Required")) {<text>required</text>} /></div> 130 } 131 } 132 } 133 </div></div></div> 134 @GetString("Form.FormEnd") 135
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.