Error compiling template "Designs/lyspunkt/_parsed/Designer.parsed.cshtml"
Line 947: A local variable named 'image' cannot be declared in this scope because it would give a different meaning to 'image', which is already used in a 'child' scope to denote something else

1 @using System.Web; 2 @using Dynamicweb.Frontend; 3 @using Dynamicweb.Ecommerce; 4 @using Dynamicweb.Ecommerce.Products; 5 @using Dynamicweb.Ecommerce.Shops; 6 @using Dynamicweb.Content.Items; 7 8 <!DOCTYPE html> 9 <html xmlns="http://www.w3.org/1999/xhtml" lang="en"> 10 <head> 11 <title>@GetValue("Title")</title> 12 @GetValue("MetaTags") 13 @GetValue("CopyRightNotice") 14 15 <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> 16 <link rel="shortcut icon" type="image/x-icon" href="/Files/Templates/Designs/lyspunkt/favicon.ico"> 17 18 <!--theme color --> 19 <meta name="theme-color" content="#000000"> 20 21 @if (HttpContext.Current.Request.Url.AbsoluteUri.ToLower().Contains("inet-design") || 22 HttpContext.Current.Request.Url.AbsoluteUri.ToLower().Contains("staging") || 23 HttpContext.Current.Request.Url.AbsoluteUri.ToLower().Contains("195.249.142.68")) 24 { 25 <meta name="robots" content="noindex, nofollow"> 26 } 27 28 @{ 29 string defaultOGTitle = "Lyspunkt"; 30 string defaultOGImage = "https://lyspunkt.dk//files/templates/designs/lyspunkt/assets_new/images/lp-logo.png"; 31 string defaultOGDescription = "Find lamper fra LE KLINT, Flos. Designet af Verner Panton, Arne Jacobsen, PH m.fl.: Caravaggio pendel, Panthella gulvlampe, Idell bordlampe."; 32 string defaultOGUrl = "https://lyspunkt.dk/"; 33 string defaultOGSiteName = "lyspunkt.dk"; 34 } 35 36 @if (!string.IsNullOrWhiteSpace(HttpContext.Current.Request.QueryString["ProductID"])) 37 { 38 string productmetaId = HttpContext.Current.Request.QueryString["ProductID"]; 39 var productmeta = Dynamicweb.Ecommerce.Services.Products.GetProductById(productmetaId, string.Empty, false); 40 string image = string.Format("http://cdn1.elsalg.dk/inetimagegen.ashx?altFmImage_path=/Files/ELSALG/eCom/Pictures/0000000000001.png&Width=280&image=/files/ELSALG/eCom/Pictures/{0}_detailheader.png&width=1024&height=768&crop=5", Dynamicweb.Ecommerce.Services.Products.GetProductFieldValue(productmeta, "ELSEan").ToString()); 41 string productUrl = "https://lyspunkt.dk" + Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl("Default.aspx?ID=9&ProductID=" + productmeta.Id); 42 if (!productmeta.IsVariantMaster) 43 { 44 productUrl += "?VariantID=" + productmeta.VariantId; 45 } 46 <meta property="og:title" content="@(string.IsNullOrWhiteSpace(productmeta.Meta.Title) ? defaultOGTitle : productmeta.Meta.Title)"> 47 <meta property="og:image" content="@image"> 48 <meta property="og:description" content="@(string.IsNullOrWhiteSpace(productmeta.Meta.Description) ? defaultOGDescription : productmeta.Meta.Description)"> 49 <meta property="og:url" content="@productUrl"> 50 } 51 52 @if (!string.IsNullOrWhiteSpace(HttpContext.Current.Request.QueryString["GroupID"])) 53 { 54 string groupmetaId = HttpContext.Current.Request.QueryString["GroupID"].Trim().Split(',').Last(); 55 var groupmeta = Dynamicweb.Ecommerce.Services.ProductGroups.GetGroup(groupmetaId); 56 string groupUrl = "https://lyspunkt.dk" + Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl("Default.aspx?ID=9&GroupID=" + groupmeta.Id); 57 <meta property="og:title" content="@(string.IsNullOrWhiteSpace(groupmeta.Meta.Title) ? defaultOGTitle : groupmeta.Meta.Title)"> 58 <meta property="og:image" content="@defaultOGImage"> 59 <meta property="og:description" content="@(string.IsNullOrWhiteSpace(groupmeta.Meta.Description) ? defaultOGDescription : groupmeta.Meta.Description)"> 60 <meta property="og:url" content="@groupUrl"> 61 } 62 63 @if (string.IsNullOrWhiteSpace(HttpContext.Current.Request.QueryString["GroupID"]) && string.IsNullOrWhiteSpace(HttpContext.Current.Request.QueryString["ProductID"])) 64 { 65 var pageTitle = GetString("Title"); 66 var pageDescription = GetString("Meta.Description"); 67 <meta property="og:title" content="@(string.IsNullOrWhiteSpace(pageTitle) ? defaultOGTitle : pageTitle)"> 68 <meta property="og:image" content="@defaultOGImage"> 69 <meta property="og:description" content="@(string.IsNullOrWhiteSpace(pageDescription) ? defaultOGDescription : pageDescription)"> 70 <meta property="og:url" content="@defaultOGUrl"> 71 } 72 73 <meta property="og:site_name" content="@defaultOGSiteName"> 74 75 <!--@Snippet(googleStructuredData)--> 76 <!--css paths--> 77 <link rel="stylesheet" type="text/css" href="/files/templates/designs/lyspunkt/assets_new/css/font.awesome.css"> 78 <link rel="stylesheet" type="text/css" href="/files/templates/designs/lyspunkt/assets_new/css/normalize.css"> 79 <link rel="stylesheet" type="text/css" href="/files/templates/designs/lyspunkt/assets_new/css/royalslider.css?v=1.1"> 80 <link rel="stylesheet" type="text/css" href="/files/templates/designs/lyspunkt/assets_new/css/fonts.css"> 81 <link rel="stylesheet" type="text/css" href="/files/templates/designs/lyspunkt/assets_new/css/rangeslider.css"> 82 <link rel="stylesheet" type="text/css" href="/files/templates/designs/lyspunkt/assets_new/css/magnific-popup.css"> 83 <link rel="stylesheet" type="text/css" href="/files/templates/designs/lyspunkt/assets_new/css/lyspunkt-icons.css"> 84 <link rel="stylesheet" type="text/css" href="/files/templates/designs/lyspunkt/assets_new/css/animate.css"> 85 <link rel="stylesheet" type="text/css" href="/files/templates/designs/lyspunkt/assets_new/css/style.css?ver=1.20"> 86 <link rel="stylesheet" type="text/css" href="/files/templates/designs/lyspunkt/assets_new/css/jquery.prettycheckbox.css"> 87 88 <!--@Snippet(cssFiles)--> 89 <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries --> 90 <!--[if lt IE 9]> 91 <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> 92 <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> 93 <![endif]--> 94 <!--scripts --> 95 <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script> 96 <script type="text/javascript" src="/files/templates/designs/lyspunkt/assets_new/js/jquery.livequery.js"></script> 97 <script type="text/javascript" src="/files/templates/designs/lyspunkt/assets_new/js/jquery.royalslider.min.js"></script> 98 <script type="text/javascript" src="/files/templates/designs/lyspunkt/assets_new/js/masonry.pkgd.min.js"></script> 99 <script type="text/javascript" src="/files/templates/designs/lyspunkt/assets_new/js/imagesloaded.pkgd.js"></script> 100 <script type="text/javascript" src="/files/templates/designs/lyspunkt/assets_new/js/jquery.magnific-popup.js"></script> 101 <script type="text/javascript" src="/files/templates/designs/lyspunkt/assets_new/js/jquery.cookie.js"></script> 102 <script type="text/javascript" src="/files/templates/designs/lyspunkt/assets_new/js/jquery.prettycheckbox.js"></script> 103 <script type="text/javascript" src="/files/templates/designs/lyspunkt/assets_new/js/wow.js"></script> 104 <script type="text/javascript" src="/files/templates/designs/lyspunkt/assets_new/js/ion.rangeslider.js"></script> 105 <script type="text/javascript" src="/files/templates/designs/lyspunkt/assets_new/js/jquery.prettyselect.js"></script> 106 <script type="text/javascript" src="/files/templates/designs/lyspunkt/assets_new/js/scripts.js?ver=1.12"></script> 107 <script type="text/javascript" src="/files/templates/designs/lyspunkt/assets_new/js/search.js?v=1.5"></script> 108 <script type="text/javascript" src="/files/templates/designs/lyspunkt/assets_new/js/1stweb.js?v=1.7"></script> 109 110 <script type="text/javascript" src="/files/templates/designs/lyspunkt/assets_new/js/elsalg-newsletter-src.js?v=1.6"></script> 111 <script type="text/javascript" src="/files/templates/designs/lyspunkt/assets_new/js/elsalg-sticknote-src-v2.js"></script> 112 113 <!--@Snippet(head)--> 114 @if (HttpContext.Current.Request.IsLocal) 115 { 116 <script type="text/javascript"> 117 SEARCH.locations = 'http://lyspunkt.dw.inet-design.dk' + SEARCH.locations; 118 </script> 119 } 120 121 <script type="text/javascript"> 122 $(document).ready(function () { 123 var s = document.createElement('script'); s.type = 'text/javascript'; s.charset = 'utf-8'; 124 s.src = '/elsalg-sticknote?stickNoteId=3217&v=' + Math.random(); 125 document.body.appendChild(s); 126 }); 127 </script> 128 129 <!--@Snippet(scripts)--> 130 131 @GetString("Item.Area.Header_Scripts") 132 @GetValue("Stylesheets") 133 @GetValue("Javascripts") 134 </head> 135 <body> 136 @GetString("Item.Area.AfterOpeningBody_Scripts") 137 <!--page loader--> 138 <div class="loader"> 139 <div class="loading"> 140 @*<strong>Loading</strong>*@ 141 <i class="fa fa-load"></i> 142 </div> 143 </div> 144 145 <div class="wrapper"> 146 <div class="wrapper"> 147 <div class="wrapper"> 148 <nav> 149 <div class="grid"> 150 <a href="/" class="logo"><img src="/files/templates/designs/lyspunkt/assets_new/images/lp-logo.png" width="150"></a> 151 152 <div class="move-menu"> 153 154 <!--main-menu desktop--> 155 <ul class="main-menu desktop"> 156 157 @{ 158 var topPages = Dynamicweb.Services.Pages.GetPages().Where(p => p.ParentPageId == 0 && p.LayoutTemplate == "webshop.cshtml").ToList(); 159 160 var topGroups = Dynamicweb.Ecommerce.Services.Shops.GetShop("SHOP4").TopLevelGroups.ToList(); 161 162 //if you change something here, do not forget to change it for the mobile menu below 163 foreach (var group in topGroups) 164 { 165 var groupIdStr = group.Id.ToString().Replace("-at-SHOP4", ""); 166 int groupId = int.TryParse(groupIdStr, out groupId) ? groupId : 0; 167 if (groupId <= 0) { continue; } 168 169 var categoryPage = topPages.FirstOrDefault(tp => tp.MenuText == group.Name && !tp.Hidden); 170 if (categoryPage == null) { continue; } 171 if (!Dynamicweb.Services.Pages.GetPage(categoryPage.ID).Active) { continue; } 172 173 var hasItems = group.HasChildGroups ? "has-items" : string.Empty; 174 var groupNormalizedName = "/" + group.ProductGroupFieldValues.GetProductGroupFieldValue("ELSNormalizedName").Value; 175 176 var currentClass = HttpContext.Current.Request.RawUrl.ToLower().StartsWith(groupNormalizedName.ToLower()) ? "current" : string.Empty; 177 <li> 178 <a href="@groupNormalizedName" class="transition" data-hover="@group.Name"> 179 <span class="txt">@group.Name</span> 180 </a> 181 </li> 182 } 183 } 184 185 <li><a href="/maerker" class="transition" data-hover="Mærker">Mærker</a></li> 186 <li><a href="/find-butik" class="transition" data-hover="Find butik">Find butik </a></li> 187 <li class="divider"></li> 188 </ul> 189 190 <!--cart menu all devices--> 191 <!--@Global:Paragraph.Content(5)--> 192 </div> 193 194 <!--menu right--> 195 <div id="menu-right" class="menu"> 196 <i class="icon-close close-menu"></i> 197 <ul class="main-menu mobile"> 198 @{ 199 //if you change something here, do not forget to change it for the mobile menu below 200 foreach (var group in topGroups) 201 { 202 var groupIdStr = group.Id.ToString().Replace("-at-SHOP4", ""); 203 int groupId = int.TryParse(groupIdStr, out groupId) ? groupId : 0; 204 if (groupId <= 0) { continue; } 205 206 var categoryPage = topPages.FirstOrDefault(tp => tp.MenuText == group.Name && !tp.Hidden); 207 if (categoryPage == null) { continue; } 208 if (!Dynamicweb.Services.Pages.GetPage(categoryPage.ID).Active) { continue; } 209 210 var hasItems = group.HasChildGroups ? "has-items" : string.Empty; 211 var groupNormalizedName = "/" + group.ProductGroupFieldValues.GetProductGroupFieldValue("ELSNormalizedName").Value; 212 213 var currentClass = HttpContext.Current.Request.RawUrl.ToLower().StartsWith(groupNormalizedName.ToLower()) ? "current" : string.Empty; 214 <li> 215 <a href="@groupNormalizedName" class="transition" data-hover="@group.Name"> 216 <span class="txt">@group.Name</span> 217 </a> 218 </li> 219 } 220 } 221 222 <li><a href="/maerker" class="transition" data-hover="Mærker">Mærker</a></li> 223 <li><a href="/find-butik" class="transition" data-hover="Find butik">Find butik </a></li> 224 <li class="divider"></li> 225 </ul> 226 227 @{ 228 var regularPages = Dynamicweb.Services.Pages.GetPages().Where(p => p.ParentPageId == 0 && p.LayoutTemplate != "webshop.cshtml" && p.Active == true && p.Hidden == false && p.IsFolder == false).OrderBy(p => p.Sort).ToList(); 229 } 230 231 <ul> 232 @foreach (var page in regularPages) 233 { 234 <li> 235 <a href="Default.aspx?id=@page.ID" class="transition" data-hover="@page.MenuText"> 236 @page.MenuText 237 </a> 238 </li> 239 } 240 241 @*<li><a href="#" class="transition" data-hover="Katalog">Katalog</a></li> 242 <li><a href="#" class="transition" data-hover="Nyhedsbrev">Nyhedsbrev</a></li> 243 <li><a href="#" class="transition" data-hover="Blog">Blog</a></li> 244 <li><a href="#" class="transition" data-hover="Designer">Designer</a></li> 245 <li><a href="#" class="transition" data-hover="Kontakt os">Kontakt os</a></li>*@ 246 247 <li class="divider"></li> 248 <li style="display: none;"><a href="#" class="transition" data-hover="Min side">Min side</a></li> 249 <li style="display: none;"> 250 <a href="javascript:void(0)" class="transition open" data-hover="Log ind">Log ind</a> 251 <div class="login-wrapper"> 252 <div> 253 <input class="form-control form-invert dd" type="email" name="email" value="" placeholder="E-mail"> 254 <input class="form-control form-invert dd" cl="" type="password" name="password" value="" placeholder="Password"> 255 <button class="btn btn-round btn-circle dd"></button> 256 <a class="dd" href="#">Hor du glemt dit password?</a> 257 </div> 258 </div> 259 <script type="text/javascript"> 260 $(function () { 261 LYSPUNKT.Layout.login(); 262 }); 263 </script> 264 </li> 265 @*<li class="divider"></li>*@ 266 @GetValue("Item.Area.Social_Icons") 267 </ul> 268 </div> 269 270 <!--menu-cart content--> 271 <!--@Global:Paragraph.Content(3832)--> 272 <!--menu-search--> 273 <div id="menu-search" class="menu-search clearfix"> 274 <i class="icon-close close-menu"></i> 275 <form action="/" method="post"> 276 <div class="form-group"> 277 <input type="text" id="quicksearch" name="name" value="" class="form-control" placeholder="Hvad søger du?"> 278 <i id="quicksearch-icon" class="icon-search"></i> 279 </div> 280 <div id="quicksearch-results" class="search-product-list"> 281 @*<div class="search-product"> 282 <div class="image"> 283 <img src="/files/templates/designs/lyspunkt/assets_new/images/products/a-1.png"> 284 </div> 285 </div>*@ 286 </div> 287 </form> 288 </div> 289 290 291 <script type="text/javascript"> 292 $(function () { 293 LYSPUNKT.Layout.initMenu(); 294 }); 295 </script> 296 </div> 297 </nav> 298 299 300 301 @using System.Web 302 @using Dynamicweb.Frontend 303 @using Dynamicweb.Content 304 @using Dynamicweb.Data 305 306 307 308 @{ 309 var pageId = GetString("DwPageID"); 310 var currentPage = Dynamicweb.Services.Pages.GetPage(Convert.ToInt32(pageId)); 311 var currentItem = Dynamicweb.Content.Items.ItemManager.Storage.GetById("Designer", currentPage.ItemId.ToString()); 312 if(currentItem == null) { return; } 313 314 var image = currentItem["Image"]; 315 var buttonTitle = currentItem["Button_Title"]; 316 var buttonUrl = currentItem["Button_Url"]; 317 318 var yearBorn = currentItem["Year_Born"].ToString(); 319 } 320 321 <section class="blog designer first"> 322 <div class="grid"> 323 <div class="news-block designer-block"> 324 <div class="image fadeIn wow" data-wow-delay="0.1s"> 325 <div class="wrap boxes overhide" style=""> 326 <div class="box circle"> 327 <img src="@image"> 328 </div> 329 </div> 330 </div> 331 <div class="content fadeIn wow" data-wow-delay="0.2s"> 332 <div class="box"> 333 <article> 334 <h1> 335 @GetDesignerName(currentItem["Designer"]) 336 <br> 337 @if (yearBorn != "0") 338 { 339 <span class="thin"> 340 @currentItem["Year_Born"] 341 @if (currentItem["Year_Died"] != null) 342 { 343 <text>-</text> @currentItem["Year_Died"] 344 } 345 </span> 346 } 347 348 </h1> 349 @currentItem["Description"] 350 351 @if (buttonTitle != null && !buttonTitle.ToString().IsNullOrEmpty()) 352 { 353 <p> 354 <a href="@buttonUrl" class="btn btn-main btn-right"> 355 <span>@buttonTitle</span> 356 </a> 357 </p> 358 } 359 360 </article> 361 </div> 362 </div> 363 </div> 364 </div> 365 </section> 366 367 <div id="content2">@GetValue("DwContent(content2)")</div> 368 369 370 @functions { 371 public string GetDesignerName(object id) 372 { 373 if (id == null) { return string.Empty; } 374 375 var ds = Database.CreateDataSet("select DesignerName from EcomDesigners where DesignerID = " + id); 376 if (ds.Tables[0].Rows.Count > 0) 377 { 378 return ds.Tables[0].Rows[0][0].ToString(); 379 } 380 381 return string.Empty; 382 } 383 } 384 385 386 387 @{ 388 var contactInfo = Pageview.Area.Item["Contact_Info"]; 389 var contactText = ""; 390 391 var contactParagraph = Dynamicweb.Services.Paragraphs.GetParagraphsByPageId(PageView.Current().Page.ID).FirstOrDefault(p => p.ItemType == "FooterText"); 392 393 if (contactParagraph != null) 394 { 395 var contactParagraphItem = Dynamicweb.Content.Items.ItemManager.Storage.GetById("FooterText", contactParagraph.ItemId.ToString()); 396 397 if (contactParagraphItem != null && contactParagraphItem["Text"] != null) 398 { 399 contactText = contactParagraphItem["Text"].ToString(); 400 } 401 } 402 } 403 404 <section class="black-box"> 405 <div> 406 <div class="grid"> 407 @if (!string.IsNullOrEmpty(contactText)) 408 { 409 <p class="divider">&nbsp;</p> 410 <p>@contactText</p> 411 } 412 413 <p class="divider"> 414 @contactInfo 415 <p class="divider"> 416 </div> 417 </div> 418 </section> 419 420 421 @GetValue("Item.Area.Footer") 422 </div> 423 424 <div id="loading" class="mfp-hide main-popup">todo: loading, please wait</div> 425 426 @{ 427 428 } 429 430 431 432 <script type="text/javascript"> 433 var SETTINGS = {}; 434 435 SETTINGS.data = { 436 vat: @(((Dynamicweb.Ecommerce.Common.Context.Country.Vat / 100.0) + 1).ToString().Replace(",", ".")) 437 }; 438 </script> 439 440 @RenderParagraphContent(4225) 441 442 443 444 445 </div></div></body> 446 </html> 447