Error executing template "/Designs/randers-tegl/Paragraph/rt-2.0.product-action.cshtml" System.NullReferenceException: Object reference not set to an instance of an object. at CompiledRazorTemplates.Dynamic.RazorEngine_0a125ffb5fab4b5e9b2b21f7eda05ea9.Execute() in D:\dynamicweb.net\Solutions\Gotcha\randerstegl.cloud.dynamicweb-cms.com\files\Templates\Designs\randers-tegl\Paragraph\rt-2.0.product-action.cshtml:line 6 at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context, TextWriter reader) at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag) at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass16_0.<RunCompile>b__0(TextWriter writer) at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter) at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template) at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template) at Dynamicweb.Rendering.Template.RenderRazorTemplate()
1 @{ 2 string productid = System.Web.HttpContext.Current.Request.QueryString.Get("ProductID"); 3 4 Dynamicweb.Ecommerce.Products.Product p = Dynamicweb.Ecommerce.Services.Products.GetProductById(productid, "", false); 5 6 string productname = p.Name; 7 string productnumber = p.Number; 8 string categoryName = p.Groups[0].Name.ToLower(); 9 } 10 11 @if (!GetString("Item.ExcludeProducts").Contains(productnumber)) { 12 <div class="column-xxs-12 column-md-8 column-xxs-top-1 column-xxs-bottom-1 column-sm-top-0 column-sm-bottom-0" id='@GetString("Item.ActionID")@("-action")'><div class="wrap-inner"> 13 @{ 14 bool islink = false; 15 string link = ""; 16 17 if (GetString("Item.Type") == "link") { 18 islink = true; 19 link = GetString("Item.Link"); 20 bool hasparameter = false; 21 22 if (GetBoolean("Item.IncludeRTNumberInURL")) { 23 link += (GetString("Item.Link").Contains("?") ? "&" : "?"); 24 25 if (!string.IsNullOrWhiteSpace(GetString("Item.URLParameterName"))) { 26 link += GetString("Item.URLParameterName") + "=" + productnumber.Replace(" ",""); 27 } else { 28 link += "ProductID=" + productid; 29 } 30 31 hasparameter = true; 32 } 33 34 if (GetBoolean("Item.IsVisualizationToolLink")) { 35 string brick = p.ProductFieldValues.GetProductFieldValue("VisualizationBrick").Value.ToString(); 36 string groove = p.ProductFieldValues.GetProductFieldValue("VisualizationGroove").Value.ToString(); 37 string linking = p.ProductFieldValues.GetProductFieldValue("VisualizationLinking").Value.ToString(); 38 string paving = p.ProductFieldValues.GetProductFieldValue("VisualizationPaving").Value.ToString(); 39 string roof = p.ProductFieldValues.GetProductFieldValue("VisualizationRoof").Value.ToString(); 40 string house = p.ProductFieldValues.GetProductFieldValue("VisualizationHouse").Value.ToString(); 41 string windows = p.ProductFieldValues.GetProductFieldValue("VisualizationWindows").Value.ToString(); 42 string rnd = p.ProductFieldValues.GetProductFieldValue("VisualizationRnd").Value.ToString(); 43 string viewmode = p.ProductFieldValues.GetProductFieldValue("VisualizationViewmode").Value.ToString(); 44 45 if (categoryName == "mursten") { 46 link += "#brick=" + productnumber.Replace(" ",""); 47 } else if (!string.IsNullOrWhiteSpace(brick)) { 48 link += "#brick=" + brick; 49 } else { 50 link += "#brick=RT522"; 51 } 52 53 if (!string.IsNullOrWhiteSpace(groove)) { 54 link += "&groove=" + groove; 55 } 56 57 if (!string.IsNullOrWhiteSpace(linking)) { 58 link += "&linking=" + linking; 59 } 60 61 if (!string.IsNullOrWhiteSpace(paving)) { 62 link += "&paving=" + paving; 63 } 64 65 if (categoryName == "tagsten") { 66 link += "&roof=" + productnumber.Replace(" ","_"); 67 } else if (!string.IsNullOrWhiteSpace(roof)) { 68 link += "&roof=" + roof; 69 } 70 71 if (!string.IsNullOrWhiteSpace(house)) { 72 link += "&house=" + house; 73 } else if (categoryName == "tagsten") { 74 link += "&house=05"; 75 } 76 77 if (!string.IsNullOrWhiteSpace(windows)) { 78 link += "&windows=" + windows; 79 } 80 81 if (!string.IsNullOrWhiteSpace(rnd)) { 82 link += "&rnd=" + rnd; 83 } 84 85 if (!string.IsNullOrWhiteSpace(viewmode)) { 86 link += "&viewmode=" + viewmode; 87 } else { 88 link += "&viewmode=house"; 89 } 90 } 91 if (GetBoolean("Item.IsTextureToolLink")) { 92 string groove = p.ProductFieldValues.GetProductFieldValue("VisualizationGroove").Value.ToString(); 93 string linking = p.ProductFieldValues.GetProductFieldValue("VisualizationLinking").Value.ToString(); 94 string viewmode = p.ProductFieldValues.GetProductFieldValue("VisualizationViewmode").Value.ToString(); 95 96 if (categoryName == "mursten") { 97 link += "#brick=" + productnumber.Replace(" ",""); 98 } else { 99 link += "#brick=RT522"; 100 } 101 102 if (!string.IsNullOrWhiteSpace(groove)) { 103 link += "&groove=" + groove; 104 } 105 106 if (!string.IsNullOrWhiteSpace(linking)) { 107 link += "&linking=" + linking; 108 } 109 110 if (!string.IsNullOrWhiteSpace(viewmode)) { 111 link += "&viewmode=" + viewmode; 112 } else { 113 link += "&viewmode=wall"; 114 } 115 } 116 } 117 118 string iconClass = GetString("Item.Icon"); 119 iconClass = iconClass.Substring(iconClass.LastIndexOf("/") + 1); 120 iconClass = iconClass.Replace(".svg",""); 121 } 122 @if (GetString("Item.Type") == "inline-form" || GetString("Item.Type") == "custom") { 123 if (GetString("Item.Type") == "inline-form") { 124 <a class="tablet-desktop-link" @if(!string.IsNullOrWhiteSpace(GetString("Item.LinkTitle"))) {<text>title='@GetString("Item.LinkTitle")'</text>} @if (GetBoolean("Item.IsReferenceForm") && p.ProductFieldValues.GetProductFieldValue("ShowNewReferenceTool").Value.ToString() == "False") {<text>href="mailto:@Translate("RT-2.0_Reference_mail_modtager")?subject=@productnumber - @Translate("RT-2.0_Forespørgsel_på_referenceadresse_mail_emne")&body=@Translate("RT-2.0_Forespørgsel_på_referenceadresse_mail_body")"</text>}><span class='icon @iconClass'> 125 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath(GetString("Item.Icon"))) 126 </span><h2> 127 @GetString("Item.Header").Replace("[RTXXX]",@productnumber) 128 <span>@GetString("Item.Subheader").Replace("[RTXXX]",@productnumber)</span></h2> 129 @if (GetBoolean("Item.IsReferenceForm")) { 130 if (p.ProductFieldValues.GetProductFieldValue("ShowNewReferenceTool").Value.ToString() == "True") { 131 <text>@RenderParagraphContent(GetInteger("Item.FormParagraph"))</text> 132 } else { 133 <span><span class="arrow-link"> 134 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg"))) { 135 <span> 136 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 137 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 138 </span> 139 } 140 </span> 141 @Translate("RT-2.0_Spørg_på_referenceadresser") 142 </span> 143 } 144 145 } else { 146 <text>@RenderParagraphContent(GetInteger("Item.FormParagraph"))</text> 147 } 148 </a><a class="mobile-link" 149 150 @if (GetBoolean("Item.IsReferenceForm") && p.ProductFieldValues.GetProductFieldValue("ShowNewReferenceTool").Value.ToString() == "True") {<text>data-target='product-modal-@GetString("Item.Id")'</text>} @if (GetBoolean("Item.IsReferenceForm") && p.ProductFieldValues.GetProductFieldValue("ShowNewReferenceTool").Value.ToString() == "False") {<text>href="mailto:@Translate("RT-2.0_Reference_mail_modtager")?subject=@productnumber - @Translate("RT-2.0_Forespørgsel_på_referenceadresse_mail_emne")&body=@Translate("RT-2.0_Forespørgsel_på_referenceadresse_mail_body")"</text>}><span class='icon @iconClass'> 151 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath(GetString("Item.Icon"))) 152 </span> 153 @if (GetBoolean("Item.IsReferenceForm")) { 154 if (p.ProductFieldValues.GetProductFieldValue("ShowNewReferenceTool").Value.ToString() == "True") { 155 <h2><span>@GetString("Item.MobileHeader").Replace("[RTXXX]",@productnumber)</span></h2> 156 } else { 157 <h2><span>@Translate("RT-2.0_Spørg_på_referenceadresser")</span></h2> 158 } 159 } else { 160 <h2><span>@GetString("Item.MobileHeader").Replace("[RTXXX]",@productnumber)</span></h2> 161 } 162 </a> 163 @SnippetStart("Modals") 164 <div id='product-modal-@GetString("Item.Id")' class="product-modal modal-light"><div class="column-xxs-22 column-lg-18 column-xl-14 column-xxs-left-1 column-lg-left-3 column-xl-left-5 column-xxs-top-6 column-xxs-bottom-2 column-md-top-2"><div class="wrap-inner"><div class="column-xxs-24"><span class="header"> 165 @GetString("Item.Header").Replace("[RTXXX]",@productnumber) 166 <span>@GetString("Item.Subheader").Replace("[RTXXX]",@productnumber)</span></span></div></div></div><div class="column-xxs-22 column-lg-18 column-xl-14 column-xxs-left-1 column-lg-left-3 column-xl-left-5"> 167 @RenderParagraphContent(GetInteger("Item.FormParagraph")) 168 </div><span class="icon-close"> 169 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-close.svg"))) { 170 <text>@System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-close.svg"))</text> 171 } 172 </span></div> 173 @SnippetEnd("Modals") 174 } else { 175 <a class="tablet-desktop-link" @if(!string.IsNullOrWhiteSpace(GetString("Item.LinkTitle"))) {<text>title='@GetString("Item.LinkTitle")'</text>}><span class='icon @iconClass'> 176 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath(GetString("Item.Icon"))) 177 </span><h2> 178 @GetString("Item.Header").Replace("[RTXXX]",@productnumber) 179 <span>@GetString("Item.Subheader").Replace("[RTXXX]",@productnumber)</span></h2><form action='/Default.aspx?Id=@GetString("Item.PostPage")' method="post" id='dw-form-@GetString("ParagraphID")'><div class="input-wrap"><input type="text" name='@GetString("Item.FieldName")' placeholder='@GetString("Item.FieldPlaceholder")' autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" /><button class="arrow-link"> 180 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg"))) { 181 <span> 182 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 183 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 184 </span> 185 } 186 </button></div></form></a><a class="mobile-link" data-target='product-modal-@GetString("Item.Id")'><span class='icon @iconClass'> 187 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath(GetString("Item.Icon"))) 188 </span><h2><span>@GetString("Item.MobileHeader").Replace("[RTXXX]",@productnumber)</span></h2></a> 189 @SnippetStart("Modals") 190 <div id='product-modal-@GetString("Item.Id")' class="product-modal modal-light"><div class="column-xxs-22 column-lg-18 column-xl-14 column-xxs-left-1 column-lg-left-3 column-xl-left-5 column-xxs-top-6 column-xxs-bottom-2 column-md-top-2"><div class="wrap-inner"><div class="column-xxs-24"><span class="header"> 191 @GetString("Item.Header").Replace("[RTXXX]",@productnumber) 192 <span>@GetString("Item.Subheader").Replace("[RTXXX]",@productnumber)</span></span></div></div></div><div class="column-xxs-22 column-lg-18 column-xl-14 column-xxs-left-1 column-lg-left-3 column-xl-left-5 column-xxs-top-6 column-xxs-bottom-2 column-md-top-2"><form action='/Default.aspx?Id=@GetString("Item.PostPage")' method="post" id='dw-form-@GetString("ParagraphID")'><div class="input-wrap"><input type="text" name='@GetString("Item.FieldName")' placeholder='@GetString("Item.FieldPlaceholder")' autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" /><button class="arrow-link"> 193 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg"))) { 194 <span> 195 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 196 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 197 </span> 198 } 199 </button></div></form></div><span class="icon-close"> 200 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-close.svg"))) { 201 <text>@System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-close.svg"))</text> 202 } 203 </span></div> 204 @SnippetEnd("Modals") 205 } 206 } else { 207 <a @if(GetString("Item.Type") == "link") {<text>href=@link</text>} 208 @if(!string.IsNullOrWhiteSpace(GetString("Item.LinkTitle"))) {<text>title='@GetString("Item.LinkTitle")'</text>} 209 @if(GetString("Item.Type") == "modal-form") {<text>data-target='modal-@GetString("Item.ModalFormParagraph")'</text>} 210 @(GetString("Item.ActionID") == "samples" ? "data-callback='hubspotLoad'" : null) 211 @if (GetBoolean("Item.IsVisualizationToolLink")) {<text>target="_blank"</text>} 212 @if (!string.IsNullOrWhiteSpace(GetString("Item.OpenTrackingCategory"))) {<text>data-open-tracking-category='@GetString("Item.OpenTrackingCategory")'</text>} 213 @if (!string.IsNullOrWhiteSpace(GetString("Item.OpenTrackingAction"))) {<text>data-open-tracking-action='@GetString("Item.OpenTrackingAction")'</text>}><span class='icon @iconClass'> 214 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath(GetString("Item.Icon"))) 215 </span><h2> 216 @GetString("Item.Header").Replace("[RTXXX]",@productnumber) 217 <span>@GetString("Item.Subheader").Replace("[RTXXX]",@productnumber)</span></h2><h2><span>@GetString("Item.MobileHeader").Replace("[RTXXX]",@productnumber)</span></h2> 218 @if (GetString("Item.Type") == "link") { 219 <span><span class="arrow-link"> 220 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg"))) { 221 <span> 222 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 223 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 224 </span> 225 } 226 </span> 227 @GetString("Item.LinkText") 228 </span> 229 } else if (GetString("Item.Type") == "modal-form") { 230 <span><span class="arrow-link"> 231 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg"))) { 232 <span> 233 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 234 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 235 </span> 236 } 237 </span> 238 @GetString("Item.FormLinkText") 239 </span> 240 } 241 </a> 242 } 243 </div></div> 244 } 245
Error executing template "/Designs/randers-tegl/Paragraph/rt-2.0.product-action.cshtml" System.NullReferenceException: Object reference not set to an instance of an object. at CompiledRazorTemplates.Dynamic.RazorEngine_0a125ffb5fab4b5e9b2b21f7eda05ea9.Execute() in D:\dynamicweb.net\Solutions\Gotcha\randerstegl.cloud.dynamicweb-cms.com\files\Templates\Designs\randers-tegl\Paragraph\rt-2.0.product-action.cshtml:line 6 at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context, TextWriter reader) at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag) at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass16_0.<RunCompile>b__0(TextWriter writer) at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter) at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template) at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template) at Dynamicweb.Rendering.Template.RenderRazorTemplate()
1 @{ 2 string productid = System.Web.HttpContext.Current.Request.QueryString.Get("ProductID"); 3 4 Dynamicweb.Ecommerce.Products.Product p = Dynamicweb.Ecommerce.Services.Products.GetProductById(productid, "", false); 5 6 string productname = p.Name; 7 string productnumber = p.Number; 8 string categoryName = p.Groups[0].Name.ToLower(); 9 } 10 11 @if (!GetString("Item.ExcludeProducts").Contains(productnumber)) { 12 <div class="column-xxs-12 column-md-8 column-xxs-top-1 column-xxs-bottom-1 column-sm-top-0 column-sm-bottom-0" id='@GetString("Item.ActionID")@("-action")'><div class="wrap-inner"> 13 @{ 14 bool islink = false; 15 string link = ""; 16 17 if (GetString("Item.Type") == "link") { 18 islink = true; 19 link = GetString("Item.Link"); 20 bool hasparameter = false; 21 22 if (GetBoolean("Item.IncludeRTNumberInURL")) { 23 link += (GetString("Item.Link").Contains("?") ? "&" : "?"); 24 25 if (!string.IsNullOrWhiteSpace(GetString("Item.URLParameterName"))) { 26 link += GetString("Item.URLParameterName") + "=" + productnumber.Replace(" ",""); 27 } else { 28 link += "ProductID=" + productid; 29 } 30 31 hasparameter = true; 32 } 33 34 if (GetBoolean("Item.IsVisualizationToolLink")) { 35 string brick = p.ProductFieldValues.GetProductFieldValue("VisualizationBrick").Value.ToString(); 36 string groove = p.ProductFieldValues.GetProductFieldValue("VisualizationGroove").Value.ToString(); 37 string linking = p.ProductFieldValues.GetProductFieldValue("VisualizationLinking").Value.ToString(); 38 string paving = p.ProductFieldValues.GetProductFieldValue("VisualizationPaving").Value.ToString(); 39 string roof = p.ProductFieldValues.GetProductFieldValue("VisualizationRoof").Value.ToString(); 40 string house = p.ProductFieldValues.GetProductFieldValue("VisualizationHouse").Value.ToString(); 41 string windows = p.ProductFieldValues.GetProductFieldValue("VisualizationWindows").Value.ToString(); 42 string rnd = p.ProductFieldValues.GetProductFieldValue("VisualizationRnd").Value.ToString(); 43 string viewmode = p.ProductFieldValues.GetProductFieldValue("VisualizationViewmode").Value.ToString(); 44 45 if (categoryName == "mursten") { 46 link += "#brick=" + productnumber.Replace(" ",""); 47 } else if (!string.IsNullOrWhiteSpace(brick)) { 48 link += "#brick=" + brick; 49 } else { 50 link += "#brick=RT522"; 51 } 52 53 if (!string.IsNullOrWhiteSpace(groove)) { 54 link += "&groove=" + groove; 55 } 56 57 if (!string.IsNullOrWhiteSpace(linking)) { 58 link += "&linking=" + linking; 59 } 60 61 if (!string.IsNullOrWhiteSpace(paving)) { 62 link += "&paving=" + paving; 63 } 64 65 if (categoryName == "tagsten") { 66 link += "&roof=" + productnumber.Replace(" ","_"); 67 } else if (!string.IsNullOrWhiteSpace(roof)) { 68 link += "&roof=" + roof; 69 } 70 71 if (!string.IsNullOrWhiteSpace(house)) { 72 link += "&house=" + house; 73 } else if (categoryName == "tagsten") { 74 link += "&house=05"; 75 } 76 77 if (!string.IsNullOrWhiteSpace(windows)) { 78 link += "&windows=" + windows; 79 } 80 81 if (!string.IsNullOrWhiteSpace(rnd)) { 82 link += "&rnd=" + rnd; 83 } 84 85 if (!string.IsNullOrWhiteSpace(viewmode)) { 86 link += "&viewmode=" + viewmode; 87 } else { 88 link += "&viewmode=house"; 89 } 90 } 91 if (GetBoolean("Item.IsTextureToolLink")) { 92 string groove = p.ProductFieldValues.GetProductFieldValue("VisualizationGroove").Value.ToString(); 93 string linking = p.ProductFieldValues.GetProductFieldValue("VisualizationLinking").Value.ToString(); 94 string viewmode = p.ProductFieldValues.GetProductFieldValue("VisualizationViewmode").Value.ToString(); 95 96 if (categoryName == "mursten") { 97 link += "#brick=" + productnumber.Replace(" ",""); 98 } else { 99 link += "#brick=RT522"; 100 } 101 102 if (!string.IsNullOrWhiteSpace(groove)) { 103 link += "&groove=" + groove; 104 } 105 106 if (!string.IsNullOrWhiteSpace(linking)) { 107 link += "&linking=" + linking; 108 } 109 110 if (!string.IsNullOrWhiteSpace(viewmode)) { 111 link += "&viewmode=" + viewmode; 112 } else { 113 link += "&viewmode=wall"; 114 } 115 } 116 } 117 118 string iconClass = GetString("Item.Icon"); 119 iconClass = iconClass.Substring(iconClass.LastIndexOf("/") + 1); 120 iconClass = iconClass.Replace(".svg",""); 121 } 122 @if (GetString("Item.Type") == "inline-form" || GetString("Item.Type") == "custom") { 123 if (GetString("Item.Type") == "inline-form") { 124 <a class="tablet-desktop-link" @if(!string.IsNullOrWhiteSpace(GetString("Item.LinkTitle"))) {<text>title='@GetString("Item.LinkTitle")'</text>} @if (GetBoolean("Item.IsReferenceForm") && p.ProductFieldValues.GetProductFieldValue("ShowNewReferenceTool").Value.ToString() == "False") {<text>href="mailto:@Translate("RT-2.0_Reference_mail_modtager")?subject=@productnumber - @Translate("RT-2.0_Forespørgsel_på_referenceadresse_mail_emne")&body=@Translate("RT-2.0_Forespørgsel_på_referenceadresse_mail_body")"</text>}><span class='icon @iconClass'> 125 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath(GetString("Item.Icon"))) 126 </span><h2> 127 @GetString("Item.Header").Replace("[RTXXX]",@productnumber) 128 <span>@GetString("Item.Subheader").Replace("[RTXXX]",@productnumber)</span></h2> 129 @if (GetBoolean("Item.IsReferenceForm")) { 130 if (p.ProductFieldValues.GetProductFieldValue("ShowNewReferenceTool").Value.ToString() == "True") { 131 <text>@RenderParagraphContent(GetInteger("Item.FormParagraph"))</text> 132 } else { 133 <span><span class="arrow-link"> 134 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg"))) { 135 <span> 136 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 137 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 138 </span> 139 } 140 </span> 141 @Translate("RT-2.0_Spørg_på_referenceadresser") 142 </span> 143 } 144 145 } else { 146 <text>@RenderParagraphContent(GetInteger("Item.FormParagraph"))</text> 147 } 148 </a><a class="mobile-link" 149 150 @if (GetBoolean("Item.IsReferenceForm") && p.ProductFieldValues.GetProductFieldValue("ShowNewReferenceTool").Value.ToString() == "True") {<text>data-target='product-modal-@GetString("Item.Id")'</text>} @if (GetBoolean("Item.IsReferenceForm") && p.ProductFieldValues.GetProductFieldValue("ShowNewReferenceTool").Value.ToString() == "False") {<text>href="mailto:@Translate("RT-2.0_Reference_mail_modtager")?subject=@productnumber - @Translate("RT-2.0_Forespørgsel_på_referenceadresse_mail_emne")&body=@Translate("RT-2.0_Forespørgsel_på_referenceadresse_mail_body")"</text>}><span class='icon @iconClass'> 151 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath(GetString("Item.Icon"))) 152 </span> 153 @if (GetBoolean("Item.IsReferenceForm")) { 154 if (p.ProductFieldValues.GetProductFieldValue("ShowNewReferenceTool").Value.ToString() == "True") { 155 <h2><span>@GetString("Item.MobileHeader").Replace("[RTXXX]",@productnumber)</span></h2> 156 } else { 157 <h2><span>@Translate("RT-2.0_Spørg_på_referenceadresser")</span></h2> 158 } 159 } else { 160 <h2><span>@GetString("Item.MobileHeader").Replace("[RTXXX]",@productnumber)</span></h2> 161 } 162 </a> 163 @SnippetStart("Modals") 164 <div id='product-modal-@GetString("Item.Id")' class="product-modal modal-light"><div class="column-xxs-22 column-lg-18 column-xl-14 column-xxs-left-1 column-lg-left-3 column-xl-left-5 column-xxs-top-6 column-xxs-bottom-2 column-md-top-2"><div class="wrap-inner"><div class="column-xxs-24"><span class="header"> 165 @GetString("Item.Header").Replace("[RTXXX]",@productnumber) 166 <span>@GetString("Item.Subheader").Replace("[RTXXX]",@productnumber)</span></span></div></div></div><div class="column-xxs-22 column-lg-18 column-xl-14 column-xxs-left-1 column-lg-left-3 column-xl-left-5"> 167 @RenderParagraphContent(GetInteger("Item.FormParagraph")) 168 </div><span class="icon-close"> 169 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-close.svg"))) { 170 <text>@System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-close.svg"))</text> 171 } 172 </span></div> 173 @SnippetEnd("Modals") 174 } else { 175 <a class="tablet-desktop-link" @if(!string.IsNullOrWhiteSpace(GetString("Item.LinkTitle"))) {<text>title='@GetString("Item.LinkTitle")'</text>}><span class='icon @iconClass'> 176 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath(GetString("Item.Icon"))) 177 </span><h2> 178 @GetString("Item.Header").Replace("[RTXXX]",@productnumber) 179 <span>@GetString("Item.Subheader").Replace("[RTXXX]",@productnumber)</span></h2><form action='/Default.aspx?Id=@GetString("Item.PostPage")' method="post" id='dw-form-@GetString("ParagraphID")'><div class="input-wrap"><input type="text" name='@GetString("Item.FieldName")' placeholder='@GetString("Item.FieldPlaceholder")' autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" /><button class="arrow-link"> 180 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg"))) { 181 <span> 182 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 183 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 184 </span> 185 } 186 </button></div></form></a><a class="mobile-link" data-target='product-modal-@GetString("Item.Id")'><span class='icon @iconClass'> 187 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath(GetString("Item.Icon"))) 188 </span><h2><span>@GetString("Item.MobileHeader").Replace("[RTXXX]",@productnumber)</span></h2></a> 189 @SnippetStart("Modals") 190 <div id='product-modal-@GetString("Item.Id")' class="product-modal modal-light"><div class="column-xxs-22 column-lg-18 column-xl-14 column-xxs-left-1 column-lg-left-3 column-xl-left-5 column-xxs-top-6 column-xxs-bottom-2 column-md-top-2"><div class="wrap-inner"><div class="column-xxs-24"><span class="header"> 191 @GetString("Item.Header").Replace("[RTXXX]",@productnumber) 192 <span>@GetString("Item.Subheader").Replace("[RTXXX]",@productnumber)</span></span></div></div></div><div class="column-xxs-22 column-lg-18 column-xl-14 column-xxs-left-1 column-lg-left-3 column-xl-left-5 column-xxs-top-6 column-xxs-bottom-2 column-md-top-2"><form action='/Default.aspx?Id=@GetString("Item.PostPage")' method="post" id='dw-form-@GetString("ParagraphID")'><div class="input-wrap"><input type="text" name='@GetString("Item.FieldName")' placeholder='@GetString("Item.FieldPlaceholder")' autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" /><button class="arrow-link"> 193 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg"))) { 194 <span> 195 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 196 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 197 </span> 198 } 199 </button></div></form></div><span class="icon-close"> 200 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-close.svg"))) { 201 <text>@System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-close.svg"))</text> 202 } 203 </span></div> 204 @SnippetEnd("Modals") 205 } 206 } else { 207 <a @if(GetString("Item.Type") == "link") {<text>href=@link</text>} 208 @if(!string.IsNullOrWhiteSpace(GetString("Item.LinkTitle"))) {<text>title='@GetString("Item.LinkTitle")'</text>} 209 @if(GetString("Item.Type") == "modal-form") {<text>data-target='modal-@GetString("Item.ModalFormParagraph")'</text>} 210 @(GetString("Item.ActionID") == "samples" ? "data-callback='hubspotLoad'" : null) 211 @if (GetBoolean("Item.IsVisualizationToolLink")) {<text>target="_blank"</text>} 212 @if (!string.IsNullOrWhiteSpace(GetString("Item.OpenTrackingCategory"))) {<text>data-open-tracking-category='@GetString("Item.OpenTrackingCategory")'</text>} 213 @if (!string.IsNullOrWhiteSpace(GetString("Item.OpenTrackingAction"))) {<text>data-open-tracking-action='@GetString("Item.OpenTrackingAction")'</text>}><span class='icon @iconClass'> 214 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath(GetString("Item.Icon"))) 215 </span><h2> 216 @GetString("Item.Header").Replace("[RTXXX]",@productnumber) 217 <span>@GetString("Item.Subheader").Replace("[RTXXX]",@productnumber)</span></h2><h2><span>@GetString("Item.MobileHeader").Replace("[RTXXX]",@productnumber)</span></h2> 218 @if (GetString("Item.Type") == "link") { 219 <span><span class="arrow-link"> 220 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg"))) { 221 <span> 222 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 223 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 224 </span> 225 } 226 </span> 227 @GetString("Item.LinkText") 228 </span> 229 } else if (GetString("Item.Type") == "modal-form") { 230 <span><span class="arrow-link"> 231 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg"))) { 232 <span> 233 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 234 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 235 </span> 236 } 237 </span> 238 @GetString("Item.FormLinkText") 239 </span> 240 } 241 </a> 242 } 243 </div></div> 244 } 245
Error executing template "/Designs/randers-tegl/Paragraph/rt-2.0.product-action.cshtml" System.NullReferenceException: Object reference not set to an instance of an object. at CompiledRazorTemplates.Dynamic.RazorEngine_0a125ffb5fab4b5e9b2b21f7eda05ea9.Execute() in D:\dynamicweb.net\Solutions\Gotcha\randerstegl.cloud.dynamicweb-cms.com\files\Templates\Designs\randers-tegl\Paragraph\rt-2.0.product-action.cshtml:line 6 at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context, TextWriter reader) at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag) at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass16_0.<RunCompile>b__0(TextWriter writer) at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter) at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template) at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template) at Dynamicweb.Rendering.Template.RenderRazorTemplate()
1 @{ 2 string productid = System.Web.HttpContext.Current.Request.QueryString.Get("ProductID"); 3 4 Dynamicweb.Ecommerce.Products.Product p = Dynamicweb.Ecommerce.Services.Products.GetProductById(productid, "", false); 5 6 string productname = p.Name; 7 string productnumber = p.Number; 8 string categoryName = p.Groups[0].Name.ToLower(); 9 } 10 11 @if (!GetString("Item.ExcludeProducts").Contains(productnumber)) { 12 <div class="column-xxs-12 column-md-8 column-xxs-top-1 column-xxs-bottom-1 column-sm-top-0 column-sm-bottom-0" id='@GetString("Item.ActionID")@("-action")'><div class="wrap-inner"> 13 @{ 14 bool islink = false; 15 string link = ""; 16 17 if (GetString("Item.Type") == "link") { 18 islink = true; 19 link = GetString("Item.Link"); 20 bool hasparameter = false; 21 22 if (GetBoolean("Item.IncludeRTNumberInURL")) { 23 link += (GetString("Item.Link").Contains("?") ? "&" : "?"); 24 25 if (!string.IsNullOrWhiteSpace(GetString("Item.URLParameterName"))) { 26 link += GetString("Item.URLParameterName") + "=" + productnumber.Replace(" ",""); 27 } else { 28 link += "ProductID=" + productid; 29 } 30 31 hasparameter = true; 32 } 33 34 if (GetBoolean("Item.IsVisualizationToolLink")) { 35 string brick = p.ProductFieldValues.GetProductFieldValue("VisualizationBrick").Value.ToString(); 36 string groove = p.ProductFieldValues.GetProductFieldValue("VisualizationGroove").Value.ToString(); 37 string linking = p.ProductFieldValues.GetProductFieldValue("VisualizationLinking").Value.ToString(); 38 string paving = p.ProductFieldValues.GetProductFieldValue("VisualizationPaving").Value.ToString(); 39 string roof = p.ProductFieldValues.GetProductFieldValue("VisualizationRoof").Value.ToString(); 40 string house = p.ProductFieldValues.GetProductFieldValue("VisualizationHouse").Value.ToString(); 41 string windows = p.ProductFieldValues.GetProductFieldValue("VisualizationWindows").Value.ToString(); 42 string rnd = p.ProductFieldValues.GetProductFieldValue("VisualizationRnd").Value.ToString(); 43 string viewmode = p.ProductFieldValues.GetProductFieldValue("VisualizationViewmode").Value.ToString(); 44 45 if (categoryName == "mursten") { 46 link += "#brick=" + productnumber.Replace(" ",""); 47 } else if (!string.IsNullOrWhiteSpace(brick)) { 48 link += "#brick=" + brick; 49 } else { 50 link += "#brick=RT522"; 51 } 52 53 if (!string.IsNullOrWhiteSpace(groove)) { 54 link += "&groove=" + groove; 55 } 56 57 if (!string.IsNullOrWhiteSpace(linking)) { 58 link += "&linking=" + linking; 59 } 60 61 if (!string.IsNullOrWhiteSpace(paving)) { 62 link += "&paving=" + paving; 63 } 64 65 if (categoryName == "tagsten") { 66 link += "&roof=" + productnumber.Replace(" ","_"); 67 } else if (!string.IsNullOrWhiteSpace(roof)) { 68 link += "&roof=" + roof; 69 } 70 71 if (!string.IsNullOrWhiteSpace(house)) { 72 link += "&house=" + house; 73 } else if (categoryName == "tagsten") { 74 link += "&house=05"; 75 } 76 77 if (!string.IsNullOrWhiteSpace(windows)) { 78 link += "&windows=" + windows; 79 } 80 81 if (!string.IsNullOrWhiteSpace(rnd)) { 82 link += "&rnd=" + rnd; 83 } 84 85 if (!string.IsNullOrWhiteSpace(viewmode)) { 86 link += "&viewmode=" + viewmode; 87 } else { 88 link += "&viewmode=house"; 89 } 90 } 91 if (GetBoolean("Item.IsTextureToolLink")) { 92 string groove = p.ProductFieldValues.GetProductFieldValue("VisualizationGroove").Value.ToString(); 93 string linking = p.ProductFieldValues.GetProductFieldValue("VisualizationLinking").Value.ToString(); 94 string viewmode = p.ProductFieldValues.GetProductFieldValue("VisualizationViewmode").Value.ToString(); 95 96 if (categoryName == "mursten") { 97 link += "#brick=" + productnumber.Replace(" ",""); 98 } else { 99 link += "#brick=RT522"; 100 } 101 102 if (!string.IsNullOrWhiteSpace(groove)) { 103 link += "&groove=" + groove; 104 } 105 106 if (!string.IsNullOrWhiteSpace(linking)) { 107 link += "&linking=" + linking; 108 } 109 110 if (!string.IsNullOrWhiteSpace(viewmode)) { 111 link += "&viewmode=" + viewmode; 112 } else { 113 link += "&viewmode=wall"; 114 } 115 } 116 } 117 118 string iconClass = GetString("Item.Icon"); 119 iconClass = iconClass.Substring(iconClass.LastIndexOf("/") + 1); 120 iconClass = iconClass.Replace(".svg",""); 121 } 122 @if (GetString("Item.Type") == "inline-form" || GetString("Item.Type") == "custom") { 123 if (GetString("Item.Type") == "inline-form") { 124 <a class="tablet-desktop-link" @if(!string.IsNullOrWhiteSpace(GetString("Item.LinkTitle"))) {<text>title='@GetString("Item.LinkTitle")'</text>} @if (GetBoolean("Item.IsReferenceForm") && p.ProductFieldValues.GetProductFieldValue("ShowNewReferenceTool").Value.ToString() == "False") {<text>href="mailto:@Translate("RT-2.0_Reference_mail_modtager")?subject=@productnumber - @Translate("RT-2.0_Forespørgsel_på_referenceadresse_mail_emne")&body=@Translate("RT-2.0_Forespørgsel_på_referenceadresse_mail_body")"</text>}><span class='icon @iconClass'> 125 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath(GetString("Item.Icon"))) 126 </span><h2> 127 @GetString("Item.Header").Replace("[RTXXX]",@productnumber) 128 <span>@GetString("Item.Subheader").Replace("[RTXXX]",@productnumber)</span></h2> 129 @if (GetBoolean("Item.IsReferenceForm")) { 130 if (p.ProductFieldValues.GetProductFieldValue("ShowNewReferenceTool").Value.ToString() == "True") { 131 <text>@RenderParagraphContent(GetInteger("Item.FormParagraph"))</text> 132 } else { 133 <span><span class="arrow-link"> 134 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg"))) { 135 <span> 136 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 137 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 138 </span> 139 } 140 </span> 141 @Translate("RT-2.0_Spørg_på_referenceadresser") 142 </span> 143 } 144 145 } else { 146 <text>@RenderParagraphContent(GetInteger("Item.FormParagraph"))</text> 147 } 148 </a><a class="mobile-link" 149 150 @if (GetBoolean("Item.IsReferenceForm") && p.ProductFieldValues.GetProductFieldValue("ShowNewReferenceTool").Value.ToString() == "True") {<text>data-target='product-modal-@GetString("Item.Id")'</text>} @if (GetBoolean("Item.IsReferenceForm") && p.ProductFieldValues.GetProductFieldValue("ShowNewReferenceTool").Value.ToString() == "False") {<text>href="mailto:@Translate("RT-2.0_Reference_mail_modtager")?subject=@productnumber - @Translate("RT-2.0_Forespørgsel_på_referenceadresse_mail_emne")&body=@Translate("RT-2.0_Forespørgsel_på_referenceadresse_mail_body")"</text>}><span class='icon @iconClass'> 151 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath(GetString("Item.Icon"))) 152 </span> 153 @if (GetBoolean("Item.IsReferenceForm")) { 154 if (p.ProductFieldValues.GetProductFieldValue("ShowNewReferenceTool").Value.ToString() == "True") { 155 <h2><span>@GetString("Item.MobileHeader").Replace("[RTXXX]",@productnumber)</span></h2> 156 } else { 157 <h2><span>@Translate("RT-2.0_Spørg_på_referenceadresser")</span></h2> 158 } 159 } else { 160 <h2><span>@GetString("Item.MobileHeader").Replace("[RTXXX]",@productnumber)</span></h2> 161 } 162 </a> 163 @SnippetStart("Modals") 164 <div id='product-modal-@GetString("Item.Id")' class="product-modal modal-light"><div class="column-xxs-22 column-lg-18 column-xl-14 column-xxs-left-1 column-lg-left-3 column-xl-left-5 column-xxs-top-6 column-xxs-bottom-2 column-md-top-2"><div class="wrap-inner"><div class="column-xxs-24"><span class="header"> 165 @GetString("Item.Header").Replace("[RTXXX]",@productnumber) 166 <span>@GetString("Item.Subheader").Replace("[RTXXX]",@productnumber)</span></span></div></div></div><div class="column-xxs-22 column-lg-18 column-xl-14 column-xxs-left-1 column-lg-left-3 column-xl-left-5"> 167 @RenderParagraphContent(GetInteger("Item.FormParagraph")) 168 </div><span class="icon-close"> 169 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-close.svg"))) { 170 <text>@System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-close.svg"))</text> 171 } 172 </span></div> 173 @SnippetEnd("Modals") 174 } else { 175 <a class="tablet-desktop-link" @if(!string.IsNullOrWhiteSpace(GetString("Item.LinkTitle"))) {<text>title='@GetString("Item.LinkTitle")'</text>}><span class='icon @iconClass'> 176 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath(GetString("Item.Icon"))) 177 </span><h2> 178 @GetString("Item.Header").Replace("[RTXXX]",@productnumber) 179 <span>@GetString("Item.Subheader").Replace("[RTXXX]",@productnumber)</span></h2><form action='/Default.aspx?Id=@GetString("Item.PostPage")' method="post" id='dw-form-@GetString("ParagraphID")'><div class="input-wrap"><input type="text" name='@GetString("Item.FieldName")' placeholder='@GetString("Item.FieldPlaceholder")' autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" /><button class="arrow-link"> 180 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg"))) { 181 <span> 182 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 183 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 184 </span> 185 } 186 </button></div></form></a><a class="mobile-link" data-target='product-modal-@GetString("Item.Id")'><span class='icon @iconClass'> 187 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath(GetString("Item.Icon"))) 188 </span><h2><span>@GetString("Item.MobileHeader").Replace("[RTXXX]",@productnumber)</span></h2></a> 189 @SnippetStart("Modals") 190 <div id='product-modal-@GetString("Item.Id")' class="product-modal modal-light"><div class="column-xxs-22 column-lg-18 column-xl-14 column-xxs-left-1 column-lg-left-3 column-xl-left-5 column-xxs-top-6 column-xxs-bottom-2 column-md-top-2"><div class="wrap-inner"><div class="column-xxs-24"><span class="header"> 191 @GetString("Item.Header").Replace("[RTXXX]",@productnumber) 192 <span>@GetString("Item.Subheader").Replace("[RTXXX]",@productnumber)</span></span></div></div></div><div class="column-xxs-22 column-lg-18 column-xl-14 column-xxs-left-1 column-lg-left-3 column-xl-left-5 column-xxs-top-6 column-xxs-bottom-2 column-md-top-2"><form action='/Default.aspx?Id=@GetString("Item.PostPage")' method="post" id='dw-form-@GetString("ParagraphID")'><div class="input-wrap"><input type="text" name='@GetString("Item.FieldName")' placeholder='@GetString("Item.FieldPlaceholder")' autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" /><button class="arrow-link"> 193 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg"))) { 194 <span> 195 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 196 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 197 </span> 198 } 199 </button></div></form></div><span class="icon-close"> 200 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-close.svg"))) { 201 <text>@System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-close.svg"))</text> 202 } 203 </span></div> 204 @SnippetEnd("Modals") 205 } 206 } else { 207 <a @if(GetString("Item.Type") == "link") {<text>href=@link</text>} 208 @if(!string.IsNullOrWhiteSpace(GetString("Item.LinkTitle"))) {<text>title='@GetString("Item.LinkTitle")'</text>} 209 @if(GetString("Item.Type") == "modal-form") {<text>data-target='modal-@GetString("Item.ModalFormParagraph")'</text>} 210 @(GetString("Item.ActionID") == "samples" ? "data-callback='hubspotLoad'" : null) 211 @if (GetBoolean("Item.IsVisualizationToolLink")) {<text>target="_blank"</text>} 212 @if (!string.IsNullOrWhiteSpace(GetString("Item.OpenTrackingCategory"))) {<text>data-open-tracking-category='@GetString("Item.OpenTrackingCategory")'</text>} 213 @if (!string.IsNullOrWhiteSpace(GetString("Item.OpenTrackingAction"))) {<text>data-open-tracking-action='@GetString("Item.OpenTrackingAction")'</text>}><span class='icon @iconClass'> 214 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath(GetString("Item.Icon"))) 215 </span><h2> 216 @GetString("Item.Header").Replace("[RTXXX]",@productnumber) 217 <span>@GetString("Item.Subheader").Replace("[RTXXX]",@productnumber)</span></h2><h2><span>@GetString("Item.MobileHeader").Replace("[RTXXX]",@productnumber)</span></h2> 218 @if (GetString("Item.Type") == "link") { 219 <span><span class="arrow-link"> 220 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg"))) { 221 <span> 222 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 223 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 224 </span> 225 } 226 </span> 227 @GetString("Item.LinkText") 228 </span> 229 } else if (GetString("Item.Type") == "modal-form") { 230 <span><span class="arrow-link"> 231 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg"))) { 232 <span> 233 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 234 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 235 </span> 236 } 237 </span> 238 @GetString("Item.FormLinkText") 239 </span> 240 } 241 </a> 242 } 243 </div></div> 244 } 245
Error executing template "/Designs/randers-tegl/Paragraph/rt-2.0.product-action.cshtml" System.NullReferenceException: Object reference not set to an instance of an object. at CompiledRazorTemplates.Dynamic.RazorEngine_0a125ffb5fab4b5e9b2b21f7eda05ea9.Execute() in D:\dynamicweb.net\Solutions\Gotcha\randerstegl.cloud.dynamicweb-cms.com\files\Templates\Designs\randers-tegl\Paragraph\rt-2.0.product-action.cshtml:line 6 at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context, TextWriter reader) at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag) at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass16_0.<RunCompile>b__0(TextWriter writer) at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter) at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template) at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template) at Dynamicweb.Rendering.Template.RenderRazorTemplate()
1 @{ 2 string productid = System.Web.HttpContext.Current.Request.QueryString.Get("ProductID"); 3 4 Dynamicweb.Ecommerce.Products.Product p = Dynamicweb.Ecommerce.Services.Products.GetProductById(productid, "", false); 5 6 string productname = p.Name; 7 string productnumber = p.Number; 8 string categoryName = p.Groups[0].Name.ToLower(); 9 } 10 11 @if (!GetString("Item.ExcludeProducts").Contains(productnumber)) { 12 <div class="column-xxs-12 column-md-8 column-xxs-top-1 column-xxs-bottom-1 column-sm-top-0 column-sm-bottom-0" id='@GetString("Item.ActionID")@("-action")'><div class="wrap-inner"> 13 @{ 14 bool islink = false; 15 string link = ""; 16 17 if (GetString("Item.Type") == "link") { 18 islink = true; 19 link = GetString("Item.Link"); 20 bool hasparameter = false; 21 22 if (GetBoolean("Item.IncludeRTNumberInURL")) { 23 link += (GetString("Item.Link").Contains("?") ? "&" : "?"); 24 25 if (!string.IsNullOrWhiteSpace(GetString("Item.URLParameterName"))) { 26 link += GetString("Item.URLParameterName") + "=" + productnumber.Replace(" ",""); 27 } else { 28 link += "ProductID=" + productid; 29 } 30 31 hasparameter = true; 32 } 33 34 if (GetBoolean("Item.IsVisualizationToolLink")) { 35 string brick = p.ProductFieldValues.GetProductFieldValue("VisualizationBrick").Value.ToString(); 36 string groove = p.ProductFieldValues.GetProductFieldValue("VisualizationGroove").Value.ToString(); 37 string linking = p.ProductFieldValues.GetProductFieldValue("VisualizationLinking").Value.ToString(); 38 string paving = p.ProductFieldValues.GetProductFieldValue("VisualizationPaving").Value.ToString(); 39 string roof = p.ProductFieldValues.GetProductFieldValue("VisualizationRoof").Value.ToString(); 40 string house = p.ProductFieldValues.GetProductFieldValue("VisualizationHouse").Value.ToString(); 41 string windows = p.ProductFieldValues.GetProductFieldValue("VisualizationWindows").Value.ToString(); 42 string rnd = p.ProductFieldValues.GetProductFieldValue("VisualizationRnd").Value.ToString(); 43 string viewmode = p.ProductFieldValues.GetProductFieldValue("VisualizationViewmode").Value.ToString(); 44 45 if (categoryName == "mursten") { 46 link += "#brick=" + productnumber.Replace(" ",""); 47 } else if (!string.IsNullOrWhiteSpace(brick)) { 48 link += "#brick=" + brick; 49 } else { 50 link += "#brick=RT522"; 51 } 52 53 if (!string.IsNullOrWhiteSpace(groove)) { 54 link += "&groove=" + groove; 55 } 56 57 if (!string.IsNullOrWhiteSpace(linking)) { 58 link += "&linking=" + linking; 59 } 60 61 if (!string.IsNullOrWhiteSpace(paving)) { 62 link += "&paving=" + paving; 63 } 64 65 if (categoryName == "tagsten") { 66 link += "&roof=" + productnumber.Replace(" ","_"); 67 } else if (!string.IsNullOrWhiteSpace(roof)) { 68 link += "&roof=" + roof; 69 } 70 71 if (!string.IsNullOrWhiteSpace(house)) { 72 link += "&house=" + house; 73 } else if (categoryName == "tagsten") { 74 link += "&house=05"; 75 } 76 77 if (!string.IsNullOrWhiteSpace(windows)) { 78 link += "&windows=" + windows; 79 } 80 81 if (!string.IsNullOrWhiteSpace(rnd)) { 82 link += "&rnd=" + rnd; 83 } 84 85 if (!string.IsNullOrWhiteSpace(viewmode)) { 86 link += "&viewmode=" + viewmode; 87 } else { 88 link += "&viewmode=house"; 89 } 90 } 91 if (GetBoolean("Item.IsTextureToolLink")) { 92 string groove = p.ProductFieldValues.GetProductFieldValue("VisualizationGroove").Value.ToString(); 93 string linking = p.ProductFieldValues.GetProductFieldValue("VisualizationLinking").Value.ToString(); 94 string viewmode = p.ProductFieldValues.GetProductFieldValue("VisualizationViewmode").Value.ToString(); 95 96 if (categoryName == "mursten") { 97 link += "#brick=" + productnumber.Replace(" ",""); 98 } else { 99 link += "#brick=RT522"; 100 } 101 102 if (!string.IsNullOrWhiteSpace(groove)) { 103 link += "&groove=" + groove; 104 } 105 106 if (!string.IsNullOrWhiteSpace(linking)) { 107 link += "&linking=" + linking; 108 } 109 110 if (!string.IsNullOrWhiteSpace(viewmode)) { 111 link += "&viewmode=" + viewmode; 112 } else { 113 link += "&viewmode=wall"; 114 } 115 } 116 } 117 118 string iconClass = GetString("Item.Icon"); 119 iconClass = iconClass.Substring(iconClass.LastIndexOf("/") + 1); 120 iconClass = iconClass.Replace(".svg",""); 121 } 122 @if (GetString("Item.Type") == "inline-form" || GetString("Item.Type") == "custom") { 123 if (GetString("Item.Type") == "inline-form") { 124 <a class="tablet-desktop-link" @if(!string.IsNullOrWhiteSpace(GetString("Item.LinkTitle"))) {<text>title='@GetString("Item.LinkTitle")'</text>} @if (GetBoolean("Item.IsReferenceForm") && p.ProductFieldValues.GetProductFieldValue("ShowNewReferenceTool").Value.ToString() == "False") {<text>href="mailto:@Translate("RT-2.0_Reference_mail_modtager")?subject=@productnumber - @Translate("RT-2.0_Forespørgsel_på_referenceadresse_mail_emne")&body=@Translate("RT-2.0_Forespørgsel_på_referenceadresse_mail_body")"</text>}><span class='icon @iconClass'> 125 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath(GetString("Item.Icon"))) 126 </span><h2> 127 @GetString("Item.Header").Replace("[RTXXX]",@productnumber) 128 <span>@GetString("Item.Subheader").Replace("[RTXXX]",@productnumber)</span></h2> 129 @if (GetBoolean("Item.IsReferenceForm")) { 130 if (p.ProductFieldValues.GetProductFieldValue("ShowNewReferenceTool").Value.ToString() == "True") { 131 <text>@RenderParagraphContent(GetInteger("Item.FormParagraph"))</text> 132 } else { 133 <span><span class="arrow-link"> 134 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg"))) { 135 <span> 136 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 137 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 138 </span> 139 } 140 </span> 141 @Translate("RT-2.0_Spørg_på_referenceadresser") 142 </span> 143 } 144 145 } else { 146 <text>@RenderParagraphContent(GetInteger("Item.FormParagraph"))</text> 147 } 148 </a><a class="mobile-link" 149 150 @if (GetBoolean("Item.IsReferenceForm") && p.ProductFieldValues.GetProductFieldValue("ShowNewReferenceTool").Value.ToString() == "True") {<text>data-target='product-modal-@GetString("Item.Id")'</text>} @if (GetBoolean("Item.IsReferenceForm") && p.ProductFieldValues.GetProductFieldValue("ShowNewReferenceTool").Value.ToString() == "False") {<text>href="mailto:@Translate("RT-2.0_Reference_mail_modtager")?subject=@productnumber - @Translate("RT-2.0_Forespørgsel_på_referenceadresse_mail_emne")&body=@Translate("RT-2.0_Forespørgsel_på_referenceadresse_mail_body")"</text>}><span class='icon @iconClass'> 151 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath(GetString("Item.Icon"))) 152 </span> 153 @if (GetBoolean("Item.IsReferenceForm")) { 154 if (p.ProductFieldValues.GetProductFieldValue("ShowNewReferenceTool").Value.ToString() == "True") { 155 <h2><span>@GetString("Item.MobileHeader").Replace("[RTXXX]",@productnumber)</span></h2> 156 } else { 157 <h2><span>@Translate("RT-2.0_Spørg_på_referenceadresser")</span></h2> 158 } 159 } else { 160 <h2><span>@GetString("Item.MobileHeader").Replace("[RTXXX]",@productnumber)</span></h2> 161 } 162 </a> 163 @SnippetStart("Modals") 164 <div id='product-modal-@GetString("Item.Id")' class="product-modal modal-light"><div class="column-xxs-22 column-lg-18 column-xl-14 column-xxs-left-1 column-lg-left-3 column-xl-left-5 column-xxs-top-6 column-xxs-bottom-2 column-md-top-2"><div class="wrap-inner"><div class="column-xxs-24"><span class="header"> 165 @GetString("Item.Header").Replace("[RTXXX]",@productnumber) 166 <span>@GetString("Item.Subheader").Replace("[RTXXX]",@productnumber)</span></span></div></div></div><div class="column-xxs-22 column-lg-18 column-xl-14 column-xxs-left-1 column-lg-left-3 column-xl-left-5"> 167 @RenderParagraphContent(GetInteger("Item.FormParagraph")) 168 </div><span class="icon-close"> 169 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-close.svg"))) { 170 <text>@System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-close.svg"))</text> 171 } 172 </span></div> 173 @SnippetEnd("Modals") 174 } else { 175 <a class="tablet-desktop-link" @if(!string.IsNullOrWhiteSpace(GetString("Item.LinkTitle"))) {<text>title='@GetString("Item.LinkTitle")'</text>}><span class='icon @iconClass'> 176 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath(GetString("Item.Icon"))) 177 </span><h2> 178 @GetString("Item.Header").Replace("[RTXXX]",@productnumber) 179 <span>@GetString("Item.Subheader").Replace("[RTXXX]",@productnumber)</span></h2><form action='/Default.aspx?Id=@GetString("Item.PostPage")' method="post" id='dw-form-@GetString("ParagraphID")'><div class="input-wrap"><input type="text" name='@GetString("Item.FieldName")' placeholder='@GetString("Item.FieldPlaceholder")' autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" /><button class="arrow-link"> 180 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg"))) { 181 <span> 182 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 183 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 184 </span> 185 } 186 </button></div></form></a><a class="mobile-link" data-target='product-modal-@GetString("Item.Id")'><span class='icon @iconClass'> 187 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath(GetString("Item.Icon"))) 188 </span><h2><span>@GetString("Item.MobileHeader").Replace("[RTXXX]",@productnumber)</span></h2></a> 189 @SnippetStart("Modals") 190 <div id='product-modal-@GetString("Item.Id")' class="product-modal modal-light"><div class="column-xxs-22 column-lg-18 column-xl-14 column-xxs-left-1 column-lg-left-3 column-xl-left-5 column-xxs-top-6 column-xxs-bottom-2 column-md-top-2"><div class="wrap-inner"><div class="column-xxs-24"><span class="header"> 191 @GetString("Item.Header").Replace("[RTXXX]",@productnumber) 192 <span>@GetString("Item.Subheader").Replace("[RTXXX]",@productnumber)</span></span></div></div></div><div class="column-xxs-22 column-lg-18 column-xl-14 column-xxs-left-1 column-lg-left-3 column-xl-left-5 column-xxs-top-6 column-xxs-bottom-2 column-md-top-2"><form action='/Default.aspx?Id=@GetString("Item.PostPage")' method="post" id='dw-form-@GetString("ParagraphID")'><div class="input-wrap"><input type="text" name='@GetString("Item.FieldName")' placeholder='@GetString("Item.FieldPlaceholder")' autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" /><button class="arrow-link"> 193 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg"))) { 194 <span> 195 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 196 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 197 </span> 198 } 199 </button></div></form></div><span class="icon-close"> 200 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-close.svg"))) { 201 <text>@System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-close.svg"))</text> 202 } 203 </span></div> 204 @SnippetEnd("Modals") 205 } 206 } else { 207 <a @if(GetString("Item.Type") == "link") {<text>href=@link</text>} 208 @if(!string.IsNullOrWhiteSpace(GetString("Item.LinkTitle"))) {<text>title='@GetString("Item.LinkTitle")'</text>} 209 @if(GetString("Item.Type") == "modal-form") {<text>data-target='modal-@GetString("Item.ModalFormParagraph")'</text>} 210 @(GetString("Item.ActionID") == "samples" ? "data-callback='hubspotLoad'" : null) 211 @if (GetBoolean("Item.IsVisualizationToolLink")) {<text>target="_blank"</text>} 212 @if (!string.IsNullOrWhiteSpace(GetString("Item.OpenTrackingCategory"))) {<text>data-open-tracking-category='@GetString("Item.OpenTrackingCategory")'</text>} 213 @if (!string.IsNullOrWhiteSpace(GetString("Item.OpenTrackingAction"))) {<text>data-open-tracking-action='@GetString("Item.OpenTrackingAction")'</text>}><span class='icon @iconClass'> 214 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath(GetString("Item.Icon"))) 215 </span><h2> 216 @GetString("Item.Header").Replace("[RTXXX]",@productnumber) 217 <span>@GetString("Item.Subheader").Replace("[RTXXX]",@productnumber)</span></h2><h2><span>@GetString("Item.MobileHeader").Replace("[RTXXX]",@productnumber)</span></h2> 218 @if (GetString("Item.Type") == "link") { 219 <span><span class="arrow-link"> 220 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg"))) { 221 <span> 222 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 223 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 224 </span> 225 } 226 </span> 227 @GetString("Item.LinkText") 228 </span> 229 } else if (GetString("Item.Type") == "modal-form") { 230 <span><span class="arrow-link"> 231 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg"))) { 232 <span> 233 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 234 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 235 </span> 236 } 237 </span> 238 @GetString("Item.FormLinkText") 239 </span> 240 } 241 </a> 242 } 243 </div></div> 244 } 245
Error executing template "/Designs/randers-tegl/Paragraph/rt-2.0.product-action.cshtml" System.NullReferenceException: Object reference not set to an instance of an object. at CompiledRazorTemplates.Dynamic.RazorEngine_0a125ffb5fab4b5e9b2b21f7eda05ea9.Execute() in D:\dynamicweb.net\Solutions\Gotcha\randerstegl.cloud.dynamicweb-cms.com\files\Templates\Designs\randers-tegl\Paragraph\rt-2.0.product-action.cshtml:line 6 at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context, TextWriter reader) at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag) at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass16_0.<RunCompile>b__0(TextWriter writer) at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter) at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template) at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template) at Dynamicweb.Rendering.Template.RenderRazorTemplate()
1 @{ 2 string productid = System.Web.HttpContext.Current.Request.QueryString.Get("ProductID"); 3 4 Dynamicweb.Ecommerce.Products.Product p = Dynamicweb.Ecommerce.Services.Products.GetProductById(productid, "", false); 5 6 string productname = p.Name; 7 string productnumber = p.Number; 8 string categoryName = p.Groups[0].Name.ToLower(); 9 } 10 11 @if (!GetString("Item.ExcludeProducts").Contains(productnumber)) { 12 <div class="column-xxs-12 column-md-8 column-xxs-top-1 column-xxs-bottom-1 column-sm-top-0 column-sm-bottom-0" id='@GetString("Item.ActionID")@("-action")'><div class="wrap-inner"> 13 @{ 14 bool islink = false; 15 string link = ""; 16 17 if (GetString("Item.Type") == "link") { 18 islink = true; 19 link = GetString("Item.Link"); 20 bool hasparameter = false; 21 22 if (GetBoolean("Item.IncludeRTNumberInURL")) { 23 link += (GetString("Item.Link").Contains("?") ? "&" : "?"); 24 25 if (!string.IsNullOrWhiteSpace(GetString("Item.URLParameterName"))) { 26 link += GetString("Item.URLParameterName") + "=" + productnumber.Replace(" ",""); 27 } else { 28 link += "ProductID=" + productid; 29 } 30 31 hasparameter = true; 32 } 33 34 if (GetBoolean("Item.IsVisualizationToolLink")) { 35 string brick = p.ProductFieldValues.GetProductFieldValue("VisualizationBrick").Value.ToString(); 36 string groove = p.ProductFieldValues.GetProductFieldValue("VisualizationGroove").Value.ToString(); 37 string linking = p.ProductFieldValues.GetProductFieldValue("VisualizationLinking").Value.ToString(); 38 string paving = p.ProductFieldValues.GetProductFieldValue("VisualizationPaving").Value.ToString(); 39 string roof = p.ProductFieldValues.GetProductFieldValue("VisualizationRoof").Value.ToString(); 40 string house = p.ProductFieldValues.GetProductFieldValue("VisualizationHouse").Value.ToString(); 41 string windows = p.ProductFieldValues.GetProductFieldValue("VisualizationWindows").Value.ToString(); 42 string rnd = p.ProductFieldValues.GetProductFieldValue("VisualizationRnd").Value.ToString(); 43 string viewmode = p.ProductFieldValues.GetProductFieldValue("VisualizationViewmode").Value.ToString(); 44 45 if (categoryName == "mursten") { 46 link += "#brick=" + productnumber.Replace(" ",""); 47 } else if (!string.IsNullOrWhiteSpace(brick)) { 48 link += "#brick=" + brick; 49 } else { 50 link += "#brick=RT522"; 51 } 52 53 if (!string.IsNullOrWhiteSpace(groove)) { 54 link += "&groove=" + groove; 55 } 56 57 if (!string.IsNullOrWhiteSpace(linking)) { 58 link += "&linking=" + linking; 59 } 60 61 if (!string.IsNullOrWhiteSpace(paving)) { 62 link += "&paving=" + paving; 63 } 64 65 if (categoryName == "tagsten") { 66 link += "&roof=" + productnumber.Replace(" ","_"); 67 } else if (!string.IsNullOrWhiteSpace(roof)) { 68 link += "&roof=" + roof; 69 } 70 71 if (!string.IsNullOrWhiteSpace(house)) { 72 link += "&house=" + house; 73 } else if (categoryName == "tagsten") { 74 link += "&house=05"; 75 } 76 77 if (!string.IsNullOrWhiteSpace(windows)) { 78 link += "&windows=" + windows; 79 } 80 81 if (!string.IsNullOrWhiteSpace(rnd)) { 82 link += "&rnd=" + rnd; 83 } 84 85 if (!string.IsNullOrWhiteSpace(viewmode)) { 86 link += "&viewmode=" + viewmode; 87 } else { 88 link += "&viewmode=house"; 89 } 90 } 91 if (GetBoolean("Item.IsTextureToolLink")) { 92 string groove = p.ProductFieldValues.GetProductFieldValue("VisualizationGroove").Value.ToString(); 93 string linking = p.ProductFieldValues.GetProductFieldValue("VisualizationLinking").Value.ToString(); 94 string viewmode = p.ProductFieldValues.GetProductFieldValue("VisualizationViewmode").Value.ToString(); 95 96 if (categoryName == "mursten") { 97 link += "#brick=" + productnumber.Replace(" ",""); 98 } else { 99 link += "#brick=RT522"; 100 } 101 102 if (!string.IsNullOrWhiteSpace(groove)) { 103 link += "&groove=" + groove; 104 } 105 106 if (!string.IsNullOrWhiteSpace(linking)) { 107 link += "&linking=" + linking; 108 } 109 110 if (!string.IsNullOrWhiteSpace(viewmode)) { 111 link += "&viewmode=" + viewmode; 112 } else { 113 link += "&viewmode=wall"; 114 } 115 } 116 } 117 118 string iconClass = GetString("Item.Icon"); 119 iconClass = iconClass.Substring(iconClass.LastIndexOf("/") + 1); 120 iconClass = iconClass.Replace(".svg",""); 121 } 122 @if (GetString("Item.Type") == "inline-form" || GetString("Item.Type") == "custom") { 123 if (GetString("Item.Type") == "inline-form") { 124 <a class="tablet-desktop-link" @if(!string.IsNullOrWhiteSpace(GetString("Item.LinkTitle"))) {<text>title='@GetString("Item.LinkTitle")'</text>} @if (GetBoolean("Item.IsReferenceForm") && p.ProductFieldValues.GetProductFieldValue("ShowNewReferenceTool").Value.ToString() == "False") {<text>href="mailto:@Translate("RT-2.0_Reference_mail_modtager")?subject=@productnumber - @Translate("RT-2.0_Forespørgsel_på_referenceadresse_mail_emne")&body=@Translate("RT-2.0_Forespørgsel_på_referenceadresse_mail_body")"</text>}><span class='icon @iconClass'> 125 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath(GetString("Item.Icon"))) 126 </span><h2> 127 @GetString("Item.Header").Replace("[RTXXX]",@productnumber) 128 <span>@GetString("Item.Subheader").Replace("[RTXXX]",@productnumber)</span></h2> 129 @if (GetBoolean("Item.IsReferenceForm")) { 130 if (p.ProductFieldValues.GetProductFieldValue("ShowNewReferenceTool").Value.ToString() == "True") { 131 <text>@RenderParagraphContent(GetInteger("Item.FormParagraph"))</text> 132 } else { 133 <span><span class="arrow-link"> 134 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg"))) { 135 <span> 136 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 137 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 138 </span> 139 } 140 </span> 141 @Translate("RT-2.0_Spørg_på_referenceadresser") 142 </span> 143 } 144 145 } else { 146 <text>@RenderParagraphContent(GetInteger("Item.FormParagraph"))</text> 147 } 148 </a><a class="mobile-link" 149 150 @if (GetBoolean("Item.IsReferenceForm") && p.ProductFieldValues.GetProductFieldValue("ShowNewReferenceTool").Value.ToString() == "True") {<text>data-target='product-modal-@GetString("Item.Id")'</text>} @if (GetBoolean("Item.IsReferenceForm") && p.ProductFieldValues.GetProductFieldValue("ShowNewReferenceTool").Value.ToString() == "False") {<text>href="mailto:@Translate("RT-2.0_Reference_mail_modtager")?subject=@productnumber - @Translate("RT-2.0_Forespørgsel_på_referenceadresse_mail_emne")&body=@Translate("RT-2.0_Forespørgsel_på_referenceadresse_mail_body")"</text>}><span class='icon @iconClass'> 151 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath(GetString("Item.Icon"))) 152 </span> 153 @if (GetBoolean("Item.IsReferenceForm")) { 154 if (p.ProductFieldValues.GetProductFieldValue("ShowNewReferenceTool").Value.ToString() == "True") { 155 <h2><span>@GetString("Item.MobileHeader").Replace("[RTXXX]",@productnumber)</span></h2> 156 } else { 157 <h2><span>@Translate("RT-2.0_Spørg_på_referenceadresser")</span></h2> 158 } 159 } else { 160 <h2><span>@GetString("Item.MobileHeader").Replace("[RTXXX]",@productnumber)</span></h2> 161 } 162 </a> 163 @SnippetStart("Modals") 164 <div id='product-modal-@GetString("Item.Id")' class="product-modal modal-light"><div class="column-xxs-22 column-lg-18 column-xl-14 column-xxs-left-1 column-lg-left-3 column-xl-left-5 column-xxs-top-6 column-xxs-bottom-2 column-md-top-2"><div class="wrap-inner"><div class="column-xxs-24"><span class="header"> 165 @GetString("Item.Header").Replace("[RTXXX]",@productnumber) 166 <span>@GetString("Item.Subheader").Replace("[RTXXX]",@productnumber)</span></span></div></div></div><div class="column-xxs-22 column-lg-18 column-xl-14 column-xxs-left-1 column-lg-left-3 column-xl-left-5"> 167 @RenderParagraphContent(GetInteger("Item.FormParagraph")) 168 </div><span class="icon-close"> 169 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-close.svg"))) { 170 <text>@System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-close.svg"))</text> 171 } 172 </span></div> 173 @SnippetEnd("Modals") 174 } else { 175 <a class="tablet-desktop-link" @if(!string.IsNullOrWhiteSpace(GetString("Item.LinkTitle"))) {<text>title='@GetString("Item.LinkTitle")'</text>}><span class='icon @iconClass'> 176 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath(GetString("Item.Icon"))) 177 </span><h2> 178 @GetString("Item.Header").Replace("[RTXXX]",@productnumber) 179 <span>@GetString("Item.Subheader").Replace("[RTXXX]",@productnumber)</span></h2><form action='/Default.aspx?Id=@GetString("Item.PostPage")' method="post" id='dw-form-@GetString("ParagraphID")'><div class="input-wrap"><input type="text" name='@GetString("Item.FieldName")' placeholder='@GetString("Item.FieldPlaceholder")' autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" /><button class="arrow-link"> 180 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg"))) { 181 <span> 182 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 183 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 184 </span> 185 } 186 </button></div></form></a><a class="mobile-link" data-target='product-modal-@GetString("Item.Id")'><span class='icon @iconClass'> 187 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath(GetString("Item.Icon"))) 188 </span><h2><span>@GetString("Item.MobileHeader").Replace("[RTXXX]",@productnumber)</span></h2></a> 189 @SnippetStart("Modals") 190 <div id='product-modal-@GetString("Item.Id")' class="product-modal modal-light"><div class="column-xxs-22 column-lg-18 column-xl-14 column-xxs-left-1 column-lg-left-3 column-xl-left-5 column-xxs-top-6 column-xxs-bottom-2 column-md-top-2"><div class="wrap-inner"><div class="column-xxs-24"><span class="header"> 191 @GetString("Item.Header").Replace("[RTXXX]",@productnumber) 192 <span>@GetString("Item.Subheader").Replace("[RTXXX]",@productnumber)</span></span></div></div></div><div class="column-xxs-22 column-lg-18 column-xl-14 column-xxs-left-1 column-lg-left-3 column-xl-left-5 column-xxs-top-6 column-xxs-bottom-2 column-md-top-2"><form action='/Default.aspx?Id=@GetString("Item.PostPage")' method="post" id='dw-form-@GetString("ParagraphID")'><div class="input-wrap"><input type="text" name='@GetString("Item.FieldName")' placeholder='@GetString("Item.FieldPlaceholder")' autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" /><button class="arrow-link"> 193 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg"))) { 194 <span> 195 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 196 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 197 </span> 198 } 199 </button></div></form></div><span class="icon-close"> 200 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-close.svg"))) { 201 <text>@System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-close.svg"))</text> 202 } 203 </span></div> 204 @SnippetEnd("Modals") 205 } 206 } else { 207 <a @if(GetString("Item.Type") == "link") {<text>href=@link</text>} 208 @if(!string.IsNullOrWhiteSpace(GetString("Item.LinkTitle"))) {<text>title='@GetString("Item.LinkTitle")'</text>} 209 @if(GetString("Item.Type") == "modal-form") {<text>data-target='modal-@GetString("Item.ModalFormParagraph")'</text>} 210 @(GetString("Item.ActionID") == "samples" ? "data-callback='hubspotLoad'" : null) 211 @if (GetBoolean("Item.IsVisualizationToolLink")) {<text>target="_blank"</text>} 212 @if (!string.IsNullOrWhiteSpace(GetString("Item.OpenTrackingCategory"))) {<text>data-open-tracking-category='@GetString("Item.OpenTrackingCategory")'</text>} 213 @if (!string.IsNullOrWhiteSpace(GetString("Item.OpenTrackingAction"))) {<text>data-open-tracking-action='@GetString("Item.OpenTrackingAction")'</text>}><span class='icon @iconClass'> 214 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath(GetString("Item.Icon"))) 215 </span><h2> 216 @GetString("Item.Header").Replace("[RTXXX]",@productnumber) 217 <span>@GetString("Item.Subheader").Replace("[RTXXX]",@productnumber)</span></h2><h2><span>@GetString("Item.MobileHeader").Replace("[RTXXX]",@productnumber)</span></h2> 218 @if (GetString("Item.Type") == "link") { 219 <span><span class="arrow-link"> 220 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg"))) { 221 <span> 222 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 223 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 224 </span> 225 } 226 </span> 227 @GetString("Item.LinkText") 228 </span> 229 } else if (GetString("Item.Type") == "modal-form") { 230 <span><span class="arrow-link"> 231 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg"))) { 232 <span> 233 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 234 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 235 </span> 236 } 237 </span> 238 @GetString("Item.FormLinkText") 239 </span> 240 } 241 </a> 242 } 243 </div></div> 244 } 245
Error executing template "/Designs/randers-tegl/Paragraph/rt-2.0.product-action.cshtml" System.NullReferenceException: Object reference not set to an instance of an object. at CompiledRazorTemplates.Dynamic.RazorEngine_0a125ffb5fab4b5e9b2b21f7eda05ea9.Execute() in D:\dynamicweb.net\Solutions\Gotcha\randerstegl.cloud.dynamicweb-cms.com\files\Templates\Designs\randers-tegl\Paragraph\rt-2.0.product-action.cshtml:line 6 at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context, TextWriter reader) at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag) at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass16_0.<RunCompile>b__0(TextWriter writer) at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter) at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template) at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template) at Dynamicweb.Rendering.Template.RenderRazorTemplate()
1 @{ 2 string productid = System.Web.HttpContext.Current.Request.QueryString.Get("ProductID"); 3 4 Dynamicweb.Ecommerce.Products.Product p = Dynamicweb.Ecommerce.Services.Products.GetProductById(productid, "", false); 5 6 string productname = p.Name; 7 string productnumber = p.Number; 8 string categoryName = p.Groups[0].Name.ToLower(); 9 } 10 11 @if (!GetString("Item.ExcludeProducts").Contains(productnumber)) { 12 <div class="column-xxs-12 column-md-8 column-xxs-top-1 column-xxs-bottom-1 column-sm-top-0 column-sm-bottom-0" id='@GetString("Item.ActionID")@("-action")'><div class="wrap-inner"> 13 @{ 14 bool islink = false; 15 string link = ""; 16 17 if (GetString("Item.Type") == "link") { 18 islink = true; 19 link = GetString("Item.Link"); 20 bool hasparameter = false; 21 22 if (GetBoolean("Item.IncludeRTNumberInURL")) { 23 link += (GetString("Item.Link").Contains("?") ? "&" : "?"); 24 25 if (!string.IsNullOrWhiteSpace(GetString("Item.URLParameterName"))) { 26 link += GetString("Item.URLParameterName") + "=" + productnumber.Replace(" ",""); 27 } else { 28 link += "ProductID=" + productid; 29 } 30 31 hasparameter = true; 32 } 33 34 if (GetBoolean("Item.IsVisualizationToolLink")) { 35 string brick = p.ProductFieldValues.GetProductFieldValue("VisualizationBrick").Value.ToString(); 36 string groove = p.ProductFieldValues.GetProductFieldValue("VisualizationGroove").Value.ToString(); 37 string linking = p.ProductFieldValues.GetProductFieldValue("VisualizationLinking").Value.ToString(); 38 string paving = p.ProductFieldValues.GetProductFieldValue("VisualizationPaving").Value.ToString(); 39 string roof = p.ProductFieldValues.GetProductFieldValue("VisualizationRoof").Value.ToString(); 40 string house = p.ProductFieldValues.GetProductFieldValue("VisualizationHouse").Value.ToString(); 41 string windows = p.ProductFieldValues.GetProductFieldValue("VisualizationWindows").Value.ToString(); 42 string rnd = p.ProductFieldValues.GetProductFieldValue("VisualizationRnd").Value.ToString(); 43 string viewmode = p.ProductFieldValues.GetProductFieldValue("VisualizationViewmode").Value.ToString(); 44 45 if (categoryName == "mursten") { 46 link += "#brick=" + productnumber.Replace(" ",""); 47 } else if (!string.IsNullOrWhiteSpace(brick)) { 48 link += "#brick=" + brick; 49 } else { 50 link += "#brick=RT522"; 51 } 52 53 if (!string.IsNullOrWhiteSpace(groove)) { 54 link += "&groove=" + groove; 55 } 56 57 if (!string.IsNullOrWhiteSpace(linking)) { 58 link += "&linking=" + linking; 59 } 60 61 if (!string.IsNullOrWhiteSpace(paving)) { 62 link += "&paving=" + paving; 63 } 64 65 if (categoryName == "tagsten") { 66 link += "&roof=" + productnumber.Replace(" ","_"); 67 } else if (!string.IsNullOrWhiteSpace(roof)) { 68 link += "&roof=" + roof; 69 } 70 71 if (!string.IsNullOrWhiteSpace(house)) { 72 link += "&house=" + house; 73 } else if (categoryName == "tagsten") { 74 link += "&house=05"; 75 } 76 77 if (!string.IsNullOrWhiteSpace(windows)) { 78 link += "&windows=" + windows; 79 } 80 81 if (!string.IsNullOrWhiteSpace(rnd)) { 82 link += "&rnd=" + rnd; 83 } 84 85 if (!string.IsNullOrWhiteSpace(viewmode)) { 86 link += "&viewmode=" + viewmode; 87 } else { 88 link += "&viewmode=house"; 89 } 90 } 91 if (GetBoolean("Item.IsTextureToolLink")) { 92 string groove = p.ProductFieldValues.GetProductFieldValue("VisualizationGroove").Value.ToString(); 93 string linking = p.ProductFieldValues.GetProductFieldValue("VisualizationLinking").Value.ToString(); 94 string viewmode = p.ProductFieldValues.GetProductFieldValue("VisualizationViewmode").Value.ToString(); 95 96 if (categoryName == "mursten") { 97 link += "#brick=" + productnumber.Replace(" ",""); 98 } else { 99 link += "#brick=RT522"; 100 } 101 102 if (!string.IsNullOrWhiteSpace(groove)) { 103 link += "&groove=" + groove; 104 } 105 106 if (!string.IsNullOrWhiteSpace(linking)) { 107 link += "&linking=" + linking; 108 } 109 110 if (!string.IsNullOrWhiteSpace(viewmode)) { 111 link += "&viewmode=" + viewmode; 112 } else { 113 link += "&viewmode=wall"; 114 } 115 } 116 } 117 118 string iconClass = GetString("Item.Icon"); 119 iconClass = iconClass.Substring(iconClass.LastIndexOf("/") + 1); 120 iconClass = iconClass.Replace(".svg",""); 121 } 122 @if (GetString("Item.Type") == "inline-form" || GetString("Item.Type") == "custom") { 123 if (GetString("Item.Type") == "inline-form") { 124 <a class="tablet-desktop-link" @if(!string.IsNullOrWhiteSpace(GetString("Item.LinkTitle"))) {<text>title='@GetString("Item.LinkTitle")'</text>} @if (GetBoolean("Item.IsReferenceForm") && p.ProductFieldValues.GetProductFieldValue("ShowNewReferenceTool").Value.ToString() == "False") {<text>href="mailto:@Translate("RT-2.0_Reference_mail_modtager")?subject=@productnumber - @Translate("RT-2.0_Forespørgsel_på_referenceadresse_mail_emne")&body=@Translate("RT-2.0_Forespørgsel_på_referenceadresse_mail_body")"</text>}><span class='icon @iconClass'> 125 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath(GetString("Item.Icon"))) 126 </span><h2> 127 @GetString("Item.Header").Replace("[RTXXX]",@productnumber) 128 <span>@GetString("Item.Subheader").Replace("[RTXXX]",@productnumber)</span></h2> 129 @if (GetBoolean("Item.IsReferenceForm")) { 130 if (p.ProductFieldValues.GetProductFieldValue("ShowNewReferenceTool").Value.ToString() == "True") { 131 <text>@RenderParagraphContent(GetInteger("Item.FormParagraph"))</text> 132 } else { 133 <span><span class="arrow-link"> 134 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg"))) { 135 <span> 136 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 137 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 138 </span> 139 } 140 </span> 141 @Translate("RT-2.0_Spørg_på_referenceadresser") 142 </span> 143 } 144 145 } else { 146 <text>@RenderParagraphContent(GetInteger("Item.FormParagraph"))</text> 147 } 148 </a><a class="mobile-link" 149 150 @if (GetBoolean("Item.IsReferenceForm") && p.ProductFieldValues.GetProductFieldValue("ShowNewReferenceTool").Value.ToString() == "True") {<text>data-target='product-modal-@GetString("Item.Id")'</text>} @if (GetBoolean("Item.IsReferenceForm") && p.ProductFieldValues.GetProductFieldValue("ShowNewReferenceTool").Value.ToString() == "False") {<text>href="mailto:@Translate("RT-2.0_Reference_mail_modtager")?subject=@productnumber - @Translate("RT-2.0_Forespørgsel_på_referenceadresse_mail_emne")&body=@Translate("RT-2.0_Forespørgsel_på_referenceadresse_mail_body")"</text>}><span class='icon @iconClass'> 151 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath(GetString("Item.Icon"))) 152 </span> 153 @if (GetBoolean("Item.IsReferenceForm")) { 154 if (p.ProductFieldValues.GetProductFieldValue("ShowNewReferenceTool").Value.ToString() == "True") { 155 <h2><span>@GetString("Item.MobileHeader").Replace("[RTXXX]",@productnumber)</span></h2> 156 } else { 157 <h2><span>@Translate("RT-2.0_Spørg_på_referenceadresser")</span></h2> 158 } 159 } else { 160 <h2><span>@GetString("Item.MobileHeader").Replace("[RTXXX]",@productnumber)</span></h2> 161 } 162 </a> 163 @SnippetStart("Modals") 164 <div id='product-modal-@GetString("Item.Id")' class="product-modal modal-light"><div class="column-xxs-22 column-lg-18 column-xl-14 column-xxs-left-1 column-lg-left-3 column-xl-left-5 column-xxs-top-6 column-xxs-bottom-2 column-md-top-2"><div class="wrap-inner"><div class="column-xxs-24"><span class="header"> 165 @GetString("Item.Header").Replace("[RTXXX]",@productnumber) 166 <span>@GetString("Item.Subheader").Replace("[RTXXX]",@productnumber)</span></span></div></div></div><div class="column-xxs-22 column-lg-18 column-xl-14 column-xxs-left-1 column-lg-left-3 column-xl-left-5"> 167 @RenderParagraphContent(GetInteger("Item.FormParagraph")) 168 </div><span class="icon-close"> 169 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-close.svg"))) { 170 <text>@System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-close.svg"))</text> 171 } 172 </span></div> 173 @SnippetEnd("Modals") 174 } else { 175 <a class="tablet-desktop-link" @if(!string.IsNullOrWhiteSpace(GetString("Item.LinkTitle"))) {<text>title='@GetString("Item.LinkTitle")'</text>}><span class='icon @iconClass'> 176 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath(GetString("Item.Icon"))) 177 </span><h2> 178 @GetString("Item.Header").Replace("[RTXXX]",@productnumber) 179 <span>@GetString("Item.Subheader").Replace("[RTXXX]",@productnumber)</span></h2><form action='/Default.aspx?Id=@GetString("Item.PostPage")' method="post" id='dw-form-@GetString("ParagraphID")'><div class="input-wrap"><input type="text" name='@GetString("Item.FieldName")' placeholder='@GetString("Item.FieldPlaceholder")' autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" /><button class="arrow-link"> 180 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg"))) { 181 <span> 182 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 183 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 184 </span> 185 } 186 </button></div></form></a><a class="mobile-link" data-target='product-modal-@GetString("Item.Id")'><span class='icon @iconClass'> 187 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath(GetString("Item.Icon"))) 188 </span><h2><span>@GetString("Item.MobileHeader").Replace("[RTXXX]",@productnumber)</span></h2></a> 189 @SnippetStart("Modals") 190 <div id='product-modal-@GetString("Item.Id")' class="product-modal modal-light"><div class="column-xxs-22 column-lg-18 column-xl-14 column-xxs-left-1 column-lg-left-3 column-xl-left-5 column-xxs-top-6 column-xxs-bottom-2 column-md-top-2"><div class="wrap-inner"><div class="column-xxs-24"><span class="header"> 191 @GetString("Item.Header").Replace("[RTXXX]",@productnumber) 192 <span>@GetString("Item.Subheader").Replace("[RTXXX]",@productnumber)</span></span></div></div></div><div class="column-xxs-22 column-lg-18 column-xl-14 column-xxs-left-1 column-lg-left-3 column-xl-left-5 column-xxs-top-6 column-xxs-bottom-2 column-md-top-2"><form action='/Default.aspx?Id=@GetString("Item.PostPage")' method="post" id='dw-form-@GetString("ParagraphID")'><div class="input-wrap"><input type="text" name='@GetString("Item.FieldName")' placeholder='@GetString("Item.FieldPlaceholder")' autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" /><button class="arrow-link"> 193 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg"))) { 194 <span> 195 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 196 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 197 </span> 198 } 199 </button></div></form></div><span class="icon-close"> 200 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-close.svg"))) { 201 <text>@System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-close.svg"))</text> 202 } 203 </span></div> 204 @SnippetEnd("Modals") 205 } 206 } else { 207 <a @if(GetString("Item.Type") == "link") {<text>href=@link</text>} 208 @if(!string.IsNullOrWhiteSpace(GetString("Item.LinkTitle"))) {<text>title='@GetString("Item.LinkTitle")'</text>} 209 @if(GetString("Item.Type") == "modal-form") {<text>data-target='modal-@GetString("Item.ModalFormParagraph")'</text>} 210 @(GetString("Item.ActionID") == "samples" ? "data-callback='hubspotLoad'" : null) 211 @if (GetBoolean("Item.IsVisualizationToolLink")) {<text>target="_blank"</text>} 212 @if (!string.IsNullOrWhiteSpace(GetString("Item.OpenTrackingCategory"))) {<text>data-open-tracking-category='@GetString("Item.OpenTrackingCategory")'</text>} 213 @if (!string.IsNullOrWhiteSpace(GetString("Item.OpenTrackingAction"))) {<text>data-open-tracking-action='@GetString("Item.OpenTrackingAction")'</text>}><span class='icon @iconClass'> 214 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath(GetString("Item.Icon"))) 215 </span><h2> 216 @GetString("Item.Header").Replace("[RTXXX]",@productnumber) 217 <span>@GetString("Item.Subheader").Replace("[RTXXX]",@productnumber)</span></h2><h2><span>@GetString("Item.MobileHeader").Replace("[RTXXX]",@productnumber)</span></h2> 218 @if (GetString("Item.Type") == "link") { 219 <span><span class="arrow-link"> 220 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg"))) { 221 <span> 222 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 223 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 224 </span> 225 } 226 </span> 227 @GetString("Item.LinkText") 228 </span> 229 } else if (GetString("Item.Type") == "modal-form") { 230 <span><span class="arrow-link"> 231 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg"))) { 232 <span> 233 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 234 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 235 </span> 236 } 237 </span> 238 @GetString("Item.FormLinkText") 239 </span> 240 } 241 </a> 242 } 243 </div></div> 244 } 245
Den moderna villan är helmurad. Helmurade byggnationer är robusta och väl ägnade för det skandinaviska klimatet eftersom tegel har egenskaper som inga andra byggmaterial har. Helmurade byggnationer ger ett hälsosamt inomhusklimat, energieffektivitet och hållbarhet i generationer.
Se varför trivsel är något man skaparDrömmer du om ett myshörn för ljumma sommarkvällar? Eleganta uterum belagda med tegel skapar små rekreativa oaser som skänker glädje i generationer. Beläggningar i äkta tegel är nämligen ett extremt robust naturmaterial som i princip är underhållsfritt och som med tiden får en vacker patina.
Upplev drömmen om en ny terrassError executing template "/Designs/randers-tegl/Paragraph/rt-2.0.bricktiler.cshtml" System.NullReferenceException: Object reference not set to an instance of an object. at CompiledRazorTemplates.Dynamic.RazorEngine_6c89fcd9bfbc49939842ce7718812405.Execute() in D:\dynamicweb.net\Solutions\Gotcha\randerstegl.cloud.dynamicweb-cms.com\files\Templates\Designs\randers-tegl\Paragraph\rt-2.0.bricktiler.cshtml:line 13 at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context, TextWriter reader) at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag) at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass16_0.<RunCompile>b__0(TextWriter writer) at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter) at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template) at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template) at Dynamicweb.Rendering.Template.RenderRazorTemplate()
1 @SnippetStart("Modals") 2 <script> 3 var brickimages = []; 4 </script><div id='modal-@GetString("ParagraphID")' class="product-modal modal-light-grey"> 5 @{ 6 bool showBrickTiler = true; 7 string[] brickimages; 8 9 string productid = System.Web.HttpContext.Current.Request.QueryString.Get("ProductID"); 10 11 Dynamicweb.Ecommerce.Products.Product p = Dynamicweb.Ecommerce.Services.Products.GetProductById(productid, "", true); 12 13 string productnumber = p.Number.Replace(" ",""); 14 string productName = p.Name; 15 string isWild = p.ProductFieldValues.GetProductFieldValue("BrickTilerVildtForbandt").Value.ToString(); 16 17 try { 18 brickimages = System.IO.Directory.GetFiles(System.Web.HttpContext.Current.Server.MapPath("~\\files\\images\\bricktiler\\" + productnumber)); 19 20 foreach (string brickImage in brickimages) { 21 string filepath = brickImage.Substring(brickImage.IndexOf("\\files"), brickImage.Length - brickImage.IndexOf("\\files")).Replace("\\","/"); 22 23 if (filepath.Contains(".png")) { 24 <script> 25 brickimages.push('@filepath'); 26 </script> 27 } 28 } 29 } catch { 30 showBrickTiler = false; 31 } 32 33 if (showBrickTiler) { 34 <div class="wrap-fluid" id="bricktiler"><div class="wrap-inner"><div class="column-xxs-22 column-xxs-left-1 column-xxs-top-6 column-xxs-bottom-2 column-md-top-2"><div id="brickTilerWrap"> 35 @if (GetGlobalValue("Global:Device.IsDesktop").ToString().ToLower() == "true") { 36 <div class="dropdowns"> 37 @if (isWild.ToLower() == "false") { 38 <ul class="drop-down" role="menu"><li class="bonds"><a>@Translate("RT-2.0_vaelgforbandt")</a><ul> 39 @RenderItemList(new { 40 ItemType = "ForbandtTyper", 41 ListSourceType = "Area", 42 ListSourceArea = Pageview.Area.ID, 43 IncludeParagraphItems = false, 44 ItemFieldsList = "*", 45 ListOrderBy = "Created", 46 ListTemplate = "ItemPublisher/List/Bonds.cshtml", 47 ListPageSize = 100 48 }) 49 </ul> 50 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg"))) { 51 <span class="icon-down"> 52 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 53 </span> 54 } 55 </li></ul> 56 } 57 <ul class="drop-down" role="menu"><li class="grooves"><a>@Translate("RT-2.0_vaelgfugefarve")</a><ul> 58 @RenderItemList(new { 59 ItemType = "Fugefaver", 60 ListSourceType = "Area", 61 ListSourceArea = Pageview.Area.ID, 62 IncludeParagraphItems = false, 63 ItemFieldsList = "*", 64 ListOrderBy = "Created", 65 ListTemplate = "ItemPublisher/List/Grooves.cshtml", 66 ListPageSize = 100 67 }) 68 </ul> 69 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg"))) { 70 <span class="icon-down"> 71 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 72 </span> 73 } 74 </li></ul></div> 75 } else { 76 if (isWild.ToLower() == "false") { 77 <select id="bond-select"> 78 @RenderItemList(new { 79 ItemType = "ForbandtTyper", 80 ListSourceType = "Area", 81 ListSourceArea = Pageview.Area.ID, 82 IncludeParagraphItems = false, 83 ItemFieldsList = "*", 84 ListOrderBy = "Created", 85 ListTemplate = "ItemPublisher/List/Bonds-native.cshtml", 86 ListPageSize = 100 87 }) 88 </select> 89 } 90 <select id="groove-select"> 91 @RenderItemList(new { 92 ItemType = "Fugefaver", 93 ListSourceType = "Area", 94 ListSourceArea = Pageview.Area.ID, 95 IncludeParagraphItems = false, 96 ItemFieldsList = "*", 97 ListOrderBy = "Created", 98 ListTemplate = "ItemPublisher/List/Grooves-native.cshtml", 99 ListPageSize = 100 100 }) 101 </select> 102 } 103 @if (GetGlobalValue("Global:Device.IsDesktop").ToString().ToLower() == "true") { 104 <div class="save"><a id="bricktiler_savepackage"><span class="arrow-link"><span> 105 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg"))) { 106 <span> 107 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 108 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/files/Templates/Designs/randers-tegl/images-rt-2.0/icon-arrow-right.svg")) 109 </span> 110 } 111 </span></span> 112 @Translate("RT-2.0_SavePackage") 113 </a></div> 114 } 115 <div id="canvasImg"><canvas id="myCanvas" width="1200px" height="630px" style="background-color:#fdfdfd"></canvas><!--canvas id="myCanvas" width="1900px" height="997px" style="background-color:#fdfdfd"></canvas--></div></div></div></div></div> 116 } 117 } 118 <span class="icon-close"> 119 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/files/Templates/Designs/randers-tegl/images-rt-2.0/icon-close.svg"))) { 120 <text>@System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/files/Templates/Designs/randers-tegl/images-rt-2.0/icon-close.svg"))</text> 121 } 122 </span></div><script src="/files/Templates/Designs/randers-tegl/js/bricktiler.min.js" async defer"></script><!--script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script><script src="/files/Templates/Designs/randers-tegl/js/jspdf/libs/filesaver.js/FileSaver.js"></script><script src="//cdnjs.cloudflare.com/ajax/libs/jszip/2.5.0/jszip.min.js"></script><script src="/files/Templates/Designs/randers-tegl/js/bricktiler6.js"></script--><script> 123 var track = false; 124 </script> 125 @if (Pageview.Area.ID != 8) { 126 <script> 127 track = true; 128 </script> 129 } 130 <script> 131 var checkjquery = setInterval(function() { 132 if (window.jQuery) { 133 clearInterval(checkjquery); 134 initBrickTiler(); 135 } 136 },10); 137 138 function initBrickTiler() { 139 /*if ($('html').hasClass('canvas')) {*/ 140 var timerStart = -1; 141 var timerEnd = -1; 142 143 /* ---------- Start timer when clicking save package button */ 144 if ($('#bricktiler').length > 0) { 145 $('#bricktiler_savepackage').click(function() { 146 // TODO: Start timer 147 var tmpStart = new Date(); 148 timerStart = tmpStart.getTime(); 149 150 if (track) { 151 ga('send', 'event', { 152 eventCategory: 'Murstenskonfigurator', 153 eventAction: 'Start download texture' 154 }); 155 } 156 }); 157 } 158 159 var selectedbond = ""; 160 var selectedbondname = ""; 161 var selectedgrooveimage = "" 162 var selectedgroovename = ""; 163 var usenative = false; 164 var vildtforbandt = '@isWild'; 165 166 if ($('#groove-select').length > 0) { 167 usenative = true; 168 } 169 170 if (vildtforbandt.toLowerCase() == 'true') { 171 if (usenative) { 172 selectedbond = []; 173 selectedbondname = 'Vildtforbandt'; 174 selectedgrooveimage = [$($('#groove-select option')[0]).attr('data-image-src')]; 175 selectedgroovename = $($('#groove-select option')[0]).attr('data-color-name'); 176 } else { 177 selectedbond = []; 178 selectedbondname = 'Vildtforbandt'; 179 selectedgrooveimage = [$($('#bricktiler .grooves ul li a')[0]).attr('data-image-src')]; 180 selectedgroovename = $($('#bricktiler .grooves ul li a')[0]).attr('data-color-name'); 181 } 182 } else { 183 if (usenative) { 184 selectedbond = JSON.parse($($('#bond-select option')[0]).attr('data-bond')); 185 selectedbondname = $($('#bond-select option')[0]).attr('data-bond-name'); 186 selectedgrooveimage = [$($('#groove-select option')[0]).attr('data-image-src')]; 187 selectedgroovename = $($('#groove-select option')[0]).attr('data-color-name'); 188 } else { 189 selectedbond = JSON.parse($($('#bricktiler .bonds ul li a')[0]).attr('data-bond')); 190 selectedbondname = $($('#bricktiler .bonds ul li a')[0]).attr('data-bond-name'); 191 selectedgrooveimage = [$($('#bricktiler .grooves ul li a')[0]).attr('data-image-src')]; 192 selectedgroovename = $($('#bricktiler .grooves ul li a')[0]).attr('data-color-name'); 193 } 194 } 195 196 $('#bricktiler .bonds ul li a').click(function() { 197 var selectedbondname = $(this).attr('data-bond-name'); 198 var selectedbond = JSON.parse($(this).attr('data-bond')); 199 200 brickTiler.switchBond(selectedbond, selectedbondname); 201 }); 202 203 $('#bricktiler .grooves ul li a').click(function() { 204 var selectedgroovename = $(this).attr('data-color-name'); 205 var selectedgrooveimage = [$(this).attr('data-image-src')]; 206 207 brickTiler.switchGroove(selectedgrooveimage, selectedgroovename); 208 }); 209 210 $('#bond-select').change(function(e) { 211 var selectedbondname = $(this).find('option:selected').attr('data-bond-name'); 212 var selectedbond = JSON.parse($(this).find('option:selected').attr('data-bond')); 213 214 brickTiler.switchBond(selectedbond, selectedbondname); 215 }); 216 217 $('#groove-select').change(function(e) { 218 var selectedgroovename = $(this).find('option:selected').attr('data-color-name'); 219 var selectedgrooveimage = [$(this).find('option:selected').attr('data-image-src')]; 220 221 brickTiler.switchGroove(selectedgrooveimage, selectedgroovename); 222 }); 223 224 $('#bricktiler_saveaspdf').click(function() { 225 showloader(); 226 227 setTimeout(function() { 228 brickTiler.savePdf('text here...').done(function() { 229 hideloader(); 230 }); 231 },300); 232 }); 233 234 $('#bricktiler_savepackage').click(function() { 235 showloader(); 236 237 $('body').append('<div id="downloadmessage" style="z-index: 999999; color: #fff; position: fixed; max-width: 960px; line-height: 40px; top: 50%; left: 0; right: 0; text-align: center; margin: auto;">Vänligen vänta. Du kommer inom kort att mottaga en zip-fil med den valda texturen. Det kan, beroende av din internetförbindelse, ta upp till 30 sekunder</div>'); 238 239 setTimeout(function() { 240 brickTiler.saveZip().done(function() { 241 hideloader(); 242 $('#downloadmessage').remove(); 243 244 var tmpEnd = new Date(); 245 timerEnd = tmpEnd.getTime(); 246 247 var seconds = (timerEnd - timerStart) / 1000; 248 249 if (track) { 250 ga('send', 'event', { 251 eventCategory: 'Murstenskonfigurator', 252 eventAction: 'Slut download texture', 253 eventLabel: 'download tid = ' + seconds 254 }); 255 } 256 }); 257 },300); 258 }); 259 260 function showloader() { 261 $('body').addClass('js-bricktiler-loading'); 262 } 263 264 function hideloader() { 265 $('body').removeClass('js-bricktiler-loading'); 266 } 267 268 function init() { 269 if (document.getElementById("myCanvas")){ 270 setTimeout(function() { 271 brickTiler.init( 272 document.getElementById('myCanvas'), 273 brickimages, 274 '@productnumber @productName', 275 selectedgrooveimage, 276 selectedgroovename, 277 selectedbond, 278 selectedbondname 279 ).done(function(){ 280 //console.log("Init done!"); 281 }); 282 }, 10); 283 } else{ 284 document.getElementById("bricktiler").setAttribute("style","display:none"); 285 } 286 } 287 288 init(); 289 290 /*$('.dropdowns ul li ul a').click(function() { 291 $('.dropdowns ul li ul a.js-selected').removeClass('js-selected'); 292 $(this).addClass('js-selected'); 293 var text = $(this).html(); 294 $(this).parent().parent().parent().find('> a').html(text); 295 });*/ 296 /*}*/ 297 } 298 </script> 299 @SnippetEnd("Modals") 300
Error executing template "Designs/randers-tegl/Forms/Form/rt-2.0.product-samples-form.cshtml" System.NullReferenceException: Object reference not set to an instance of an object. at CompiledRazorTemplates.Dynamic.RazorEngine_2e14ca80649548ca9e5f069627971c8b.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
Din beställning skickas så snart som möjligt.
RT-2.0_Tak_for_din_interesse_reference_modal_tekst
Vi återkommer inom kort.
Din beställning skickas så snart som möjligt.
Vi kommer att skicka adresserna så snart som möjligt. Passa på att inspireras av våra projekt medan du väntar.