Error compiling template "Designs/RO/_parsed/InstagramImport.parsed.cshtml"
Line 1674: 'Dynamicweb.Content.Page' does not contain a definition for 'GetPageById'
Line 1676: 'Dynamicweb.Content.Page' does not contain a definition for 'GetPagesByParentID'
Line 1702: 'Dynamicweb.Content.Page' does not contain a definition for 'Save' and no extension method 'Save' accepting a first argument of type 'Dynamicweb.Content.Page' could be found (are you missing a using directive or an assembly reference?)
Line 1962: Possible unintended reference comparison; to get a value comparison, cast the left hand side to type 'string'
Line 1988: Possible unintended reference comparison; to get a value comparison, cast the left hand side to type 'string'
Line 2014: Possible unintended reference comparison; to get a value comparison, cast the left hand side to type 'string'
Line 2040: Possible unintended reference comparison; to get a value comparison, cast the left hand side to type 'string'

1 @using System.Web; 2 @{ 3 string assetVersion = "?v1.1"; 4 string SearchQuery = HttpContext.Current.Request["Search"]; 5 if (string.IsNullOrEmpty(SearchQuery)) 6 { 7 SearchQuery = ""; 8 } 9 10 string SearchQueryMobile = HttpContext.Current.Request["Search"]; 11 if (string.IsNullOrEmpty(SearchQueryMobile)) 12 { 13 SearchQueryMobile = ""; 14 } 15 16 var GAtracking = GetString("Item.Area.Google_Analytics"); 17 18 var GTM = GetString("Item.Area.GTM"); 19 20 var mailchimpID = GetString("Item.Area.MailChimp_ID"); 21 22 var remarketingTag = GetString("Item.Area.Remarketing_Tag"); 23 24 25 } 26 <!DOCTYPE html> 27 28 @if(GetGlobalValue("Global:Pageview.Url.Raw").Contains("CountryCode") || GetGlobalValue("Global:Pageview.Url.Raw").Contains("CurrencyCode")){ 29 <script> 30 var ID = @GetInteger("DwPageID"); 31 alturl = "/Default.aspx?ID=" + ID; 32 window.location.href = alturl; 33 </script> 34 } 35 36 <html> 37 <head> 38 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 39 <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> 40 <title>@GetValue("Title")</title> 41 @GetValue("MetaTags") 42 @GetValue("CopyRightNotice") 43 44 45 46 @if(GetGlobalValue("Global:Pageview.Url.Raw").Contains("productid") || GetInteger("DwPageID")== 4919 || GetInteger("DwPageID")== 6104 ){ 47 48 49 <!--@Snippet(MetaDescription)--> 50 51 }else{ 52 53 <!-- not set meta @GetGlobalValue("Global:Pageview.Url.Raw") --> 54 55 56 <title></title> 57 58 59 60 61 62 } 63 64 65 66 @*<link rel="stylesheet" href="/Files/Templates/Designs/RO/css/bootstrap.min.css"> 67 <link rel="stylesheet" href="https://unpkg.com/flickity@2/dist/flickity.min.css"> 68 <link rel="stylesheet" href="/Files/Templates/Designs/RO/css/ro_style.min.css">*@ 69 @* <link href="/Files/Templates/Designs/RO/css/bundle.min.css@(assetVersion)" rel="stylesheet"> *@ 70 <link href="/Files/Templates/Designs/RO/css/newbundle.css?ver=5" rel="stylesheet"> 71 <link href="/Files/Templates/Designs/RO/css/custom.css?ver=4" rel="stylesheet"> 72 <link rel="stylesheet" href="/Files/Templates/Designs/RO/css/f-style.css?ver=4"> 73 <link rel="icon" href="/Files/Templates/Designs/RO/favicon.ico"> 74 75 76 77 <link rel="alternate" href="https://rocopenhagen.dk" hreflang="da-DK"> 78 <link rel="alternate" href="https://rocopenhagen.com" hreflang="en-US"> 79 <!--GTM Data Layer--> 80 <script> 81 dataLayer = []; 82 </script> 83 84 @if(!string.IsNullOrWhiteSpace(GetString("Item.Area.GTM"))){ 85 <!-- GTM --> 86 <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': 87 new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], 88 j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= 89 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); 90 })(window,document,'script','dataLayer','@GTM');</script> 91 <!-- End GTM --> 92 } 93 94 95 96 <script src="https://use.typekit.net/tjl4wdh.js"></script> 97 <script>try { Typekit.load({ async: true }); } catch (e) { }</script> 98 @*<script src="https://code.jquery.com/jquery.min.js"></script>*@ 99 <script src="/Files/Templates/Designs/RO/js/jquery.min.js@(assetVersion)"></script> 100 <!-- Facebook Pixel Code --> 101 <script> 102 !function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod? 103 n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n; 104 n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0; 105 t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window, 106 document,'script','https://connect.facebook.net/en_US/fbevents.js'); 107 fbq('init', '145461159424985' 108 ); 109 fbq('track', 'PageView'); 110 </script> 111 <noscript> 112 <img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=145461159424985&ev=PageView&noscript=1"> 113 </noscript> 114 <!-- DO NOT MODIFY --> 115 <!-- End Facebook Pixel Code --> 116 117 118 <!-- Google Code for Remarketing Tag --> 119 <!-------------------------------------------------- 120 Remarketing tags may not be associated with personally identifiable 121 information or placed on pages related to sensitive categories. See more 122 information and instructions on how to setup the tag on: 123 http://google.com/ads/remarketingsetup 124 125 ---------------------------------------------------> 126 <script type="text/javascript"> 127 /* <![CDATA[ */ 128 var google_conversion_id = @remarketingTag; 129 var google_custom_params = window.google_tag_params; 130 var google_remarketing_only = true; 131 /* ]]> */ 132 </script> 133 <script type="text/javascript" src="//www.googleadservices.com/pagead/conversion.js"> 134 </script> 135 <noscript> 136 <div style="display:inline;"> 137 <img height="1" width="1" style="border-style:none;" alt="" src="//googleads.g.doubleclick.net/pagead/viewthroughconversion/831067084/?guid=ON&amp;script=0"> 138 </div> 139 </noscript> 140 141 @* 142 <!-- script type="text/javascript" src="//downloads.mailchimp.com/js/signup-forms/popup/_embed.js" data-dojo-config="usePlainJson: true, isDebug: false"></script --> 143 <!-- script type="text/javascript">require(["mojo/signup-forms/Loader"], function(L) { L.start({"baseUrl":"mc.us16.list-manage.com","uuid":"4dd87e9d150463df79cfbb660","lid":"@mailchimpID"}) })</script --> 144 145 <!--script id="mcjs">!function(c,h,i,m,p){m=c.createElement(h),p=c.getElementsByTagName(h)[0],m.async=1,m.src=i,p.parentNode.insertBefore(m,p)}(document,"script","https://chimpstatic.com/mcjs-connected/js/users/4dd87e9d150463df79cfbb660/acea8145de4d14207c3c5fcc0.js");</script --> 146 *@ 147 148 <style> 149 *::-webkit-input-placeholder { 150 opacity: 1; 151 } 152 *:-moz-placeholder { 153 /* FF 4-18 */ 154 opacity: 1; 155 } 156 *::-moz-placeholder { 157 /* FF 19+ */ 158 opacity: 1; 159 } 160 *:-ms-input-placeholder { 161 /* IE 10+ */ 162 opacity: 1; 163 } 164 </style> 165 166 @*if(!string.IsNullOrWhiteSpace(GetString("Item.Area.Google_Analytics"))&&string.IsNullOrWhiteSpace(GetString("Item.Area.GTM"))){*@ 167 @if(!string.IsNullOrWhiteSpace(GetString("Item.Area.Google_Analytics"))){ 168 <script> 169 (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ 170 (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), 171 m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) 172 })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); 173 174 ga('create', '@GAtracking', 'auto'); 175 ga('send', 'pageview'); 176 ga('require', 'ecommerce'); 177 </script> 178 } 179 @GetValue("Stylesheets") 180 @GetValue("Javascripts") 181 </head> 182 <body> 183 @if(!string.IsNullOrWhiteSpace(GetString("Item.Area.GTM"))){ 184 <!-- GTM (noscript) --> 185 <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=@(GTM)" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript> 186 <!-- End GTM (noscript) --> 187 } 188 189 190 191 @{ 192 var ID = GetString("Item.Area.Produktside").Replace("Default.aspx?ID=", ""); 193 } 194 <form name="EcomSearchMobile" method="get" action='@GetString("Item.Area.Produktside")'> 195 <div id="searchbarmobile" style="display: none;"> 196 <input type="hidden" name="ID" value="@ID"> 197 <input type="text" name="Search" placeholder="Search" id="mobiletextsearch" value="@(SearchQueryMobile)"> 198 <button type="submit" onclick="submitSearchMobile()" class="button" id="searchbutton"> 199 <span class="glyphicon glyphicon-search" aria-hidden="true" id="searchmobile"></span> 200 </button> 201 </div> 202 </form> 203 <div id="overlay" onclick="closeOverlay()"></div> 204 <header id="header"> 205 <div class="container-fluid paddingtop"> 206 <div class="row"> 207 <div class="col-xs-12"> 208 <div id="top" style="display: block;"> 209 @{ 210 int numLang = 0; 211 foreach (var language in GetLoop("Languages")) { 212 numLang++; 213 } 214 } 215 216 <div class="language"> 217 @if (numLang > 1) { 218 <div class="languageDiv"> 219 <select id="selectLanguage" onchange="switchLanguage($(this))"> 220 @foreach (var language in GetLoop("Languages")) 221 { 222 if (language.GetBoolean("IsCurrent")) 223 { 224 <option value='@language.GetString("PageID")' selected="">@language.GetString("Name")</option> 225 } 226 else 227 { 228 <option value='@language.GetString("PageID")'>@language.GetString("Name")</option> 229 } 230 } 231 </select> 232 <i class="fa fa-caret-down" aria-hidden="true"></i> 233 </div> 234 } 235 236 <div class="currencieDiv"> 237 <select id="selectCurrencie" onchange="switchCurrencie($(this))"> 238 @foreach (var curn in GetLoop("Currencies")) 239 { 240 if (curn.GetBoolean("Currency.IsCurrent")) 241 { 242 <option value='@curn.GetString("Currency.Code")' selected="">@curn.GetString("Currency.Name")</option> 243 } 244 else 245 { 246 <option value='@curn.GetString("Currency.Code")'>@curn.GetString("Currency.Name")</option> 247 } 248 } 249 </select> 250 <i class="fa fa-caret-down" aria-hidden="true"></i> 251 </div> 252 253 254 @RenderSnippet("SocialMedia") 255 </div> 256 257 258 259 260 <div> 261 <!--ul class="dwnavigation" id="topMenulist" data-settings="template:Navbar.xslt;endlevel:1;expandmode:all;parentid:7091;"></ul--> 262 @GetValue("DwNavigation(topMenulist)") 263 </div> 264 265 <div class="functions"> 266 <form name="EcomSearch" method="get" action='@GetString("Item.Area.Produktside")'> 267 <div id="search" class="searchbar" style="display: none;"> 268 <input type="hidden" name="ID" value="@ID"> 269 <button type="submit" onclick="submitSearch()"> 270 <span style="display: inline;font-size: 21px;color: black; vertical-align: middle;" class="glyphicon glyphicon-search"></span> 271 </button> 272 <input type="text" name="Search" placeholder="@Translate(" search","søg")"="" id="textsearch" value="@(SearchQuery)"> 273 <!--<hr />--> 274 </div> 275 </form> 276 <button id="searchbuttontrigger" onclick="triggerSearch()" type="button"> 277 <span style="display: inline;font-size: 24px;color: black; vertical-align: middle;" class="glyphicon glyphicon-search"></span> 278 </button> 279 @if (GetGlobalValue("Global:Area.Lang") == "da") 280 { 281 <button class="clickable" data-toggle="modal" data-target="#modal-slide-down-basket" data-backdrop="true"> 282 <img src="/Files/Templates/Designs/RO/images/basket.png" alt="kurv">@RenderParagraphContent(158) 283 </button> 284 } 285 else 286 { 287 <button class="clickable" data-toggle="modal" data-target="#modal-slide-down-basket" data-backdrop="true"> 288 <img src="/Files/Templates/Designs/RO/images/basket.png" alt="basket">@RenderParagraphContent(194) 289 </button> 290 } 291 <input type="hidden" name="DwAreaCartPageID" value='@GetInteger("DwAreaCartPageID")'> 292 293 <div class="modal down fade" id="modal-slide-down-basket" tabindex="-1" role="dialog" aria-labelledby="myModalLabel2"> 294 <div class="modal-dialog" role="document"> 295 <div class="modal-content"> 296 297 <div class="modal-header container-fluid"> 298 <div class="row"> 299 <div class="col-xs-12"> 300 <h3 class="modal-title" id="myModalLabel2">Din Kurv</h3> 301 <button type="button" class="close" data-dismiss="modal"><img src='/Files/Templates/Designs/RO/images/close2.png' alt="close luk"></button> 302 </div> 303 </div> 304 <hr> 305 </div> 306 307 <div class="modal-body container-fluid"> 308 <div class="row"> 309 <div class="col-xs-12 col-sm-7"> 310 <h3>@Translate("summary","Summary")</h3> 311 <hr> 312 @foreach (LoopItem orderline in GetLoop("OrderLines")) 313 { 314 string productNumber = orderline.GetString("Ecom:Product.Number"); 315 string productsize = orderline.GetString("Ecom:Product:Field.productsize.Value"); 316 string productImage = ""; 317 318 if (orderline.GetString("Ecom:Order:OrderLine.Type") == "1") 319 { 320 productNumber = "1"; 321 } 322 323 var filePath = "/Files/Images/RO/Produkter/" + productNumber + "_packshot.png"; 324 325 if (productsize == "small") 326 { 327 productImage = "/Admin/Public/getImage.ashx?Image=/Files/Images/RO/Produkter/" + productNumber + "_packshot.png&format=png&width=240&height=180&crop=0"; 328 } 329 else 330 { 331 productImage = "/Admin/Public/getImage.ashx?Image=/Files/Images/RO/Produkter/" + productNumber + "_packshot.png&format=png&width=240&height=180&crop=0"; 332 } 333 334 string material = orderline.GetString("Ecom:Product:Field.material.Value"); 335 string translatedmaterial = Translate(material, material); 336 string karat = orderline.GetString("Ecom:Product:Field.karat.Value") + "kt"; 337 338 string price = orderline.GetString("Ecom:Order:OrderLine.Price.PriceWithVAT"); 339 340 string meta = ""; 341 var m = Dynamicweb.Content.Files.Metadata.EditorFactory.GetMetadataForFile(filePath); 342 if(m != null) 343 { 344 var lang = GetGlobalValue("Global:Area.Lang"); 345 if (lang == "da") 346 { 347 meta = m.GetValue("Alt"); 348 } 349 else if (lang == "en") 350 { 351 meta = m.GetValue("AltEng"); 352 } 353 } 354 355 <div class="row"> 356 <div class="col-xs-12 col-sm-4"> 357 <img class="img-responsive img-top" src="@productImage" alt="produktbillede productimage"> 358 </div> 359 <div class="col-xs-12 col-sm-8"> 360 <div class="orderlineinfo"> 361 @if (orderline.GetString("Ecom:Order:OrderLine.Type") != "1" && orderline.GetString("Ecom:Order:OrderLine.Type") != "6") 362 { 363 <h2>@orderline.GetString("Ecom:Order:OrderLine.ProductName")</h2> 364 <p>@karat @translatedmaterial</p> 365 <p>@orderline.GetString("Ecom:Order:OrderLine.ProductVariantText")</p> 366 <p>@Translate("quantity", "Amount"): @orderline.GetValue("Ecom:Order:OrderLine.Quantity") <span class="price">@GetString("Ecom:Order.Currency.Code") @price</span></p> 367 } 368 369 @if (orderline.GetString("Ecom:Order:OrderLine.Type") == "6") 370 { 371 <h2>@orderline.GetString("Ecom:Order:OrderLine.ProductName")</h2> 372 <p>@Translate("quantity", "Amount"): @orderline.GetValue("Ecom:Order:OrderLine.Quantity") <span class="price">@GetString("Ecom:Order.Currency.Code") @price</span></p> 373 } 374 375 @if (orderline.GetString("Ecom:Order:OrderLine.Type") == "1") 376 { 377 <h2>@orderline.GetString("Ecom:Order:OrderLine.ProductName") <i><small>(@Translate("giftcardredeem", "Redeem"))</small></i></h2> 378 <p><span class="price">@GetString("Ecom:Order.Currency.Code") @price</span></p> 379 } 380 </div> 381 </div> 382 </div> 383 384 <hr> 385 } 386 </div> 387 <div class="col-xs-12 col-sm-offset-1 col-sm-4"> 388 <h3>@Translate("total", "Total")</h3> 389 <hr> 390 @{ 391 string shippingname = GetString("Ecom:Order.ShippingMethod"); 392 string shippingprice = GetString("Ecom:Order.ShippingFee.Price"); 393 394 string totalDiscount = GetString("Ecom:Order.OrderLines.TotalDiscount"); 395 bool activeDiscount = false; 396 if (totalDiscount.Contains("-") || totalDiscount.Contains("(")) 397 { 398 activeDiscount = true; 399 } 400 401 if (activeDiscount) 402 { 403 <p>@Translate("discount", "Discount")</p> 404 } 405 } 406 407 <div class="row"> 408 <div class="col-xs-6"> 409 <p>@Translate("subtotal", "Sub total")</p> 410 <p>@Translate("vat", "VAT")</p> 411 @if (activeDiscount) 412 { 413 <p>@Translate("discount", "Discount")</p> 414 } 415 <p>@shippingname</p> 416 </div> 417 <div class="col-xs-6 text-right"> 418 419 @{ 420 var priceWithoutDiscountAndShipping = GetDouble("Ecom:Order.Price.PriceWithoutVAT") - GetDouble("Ecom:Order.ShippingFee.Price"); 421 string newprice = priceWithoutDiscountAndShipping.ToString("N"); 422 } 423 424 <p>@GetString("Ecom:Order.Currency.Code") @*<span id="combinedSubPrice"></span>*@ @newprice</p> 425 <p id="vattype">@GetString("Ecom:Order.Currency.Code") @GetString("Ecom:Order.Price.VAT")</p> 426 @if (!String.IsNullOrEmpty(GetString("Ecom:Product.Discount.Price"))) 427 { 428 <p>@GetString("Ecom:Order.Currency.Code") @GetString("Ecom:Product.Discount.Price.Price")</p> 429 } 430 @if (activeDiscount) 431 { 432 <p>@GetString("Ecom:Order.Currency.Code") -@GetString("Ecom:Order.OrderLines.TotalDiscount").Replace("€", "").Replace("(", "").Replace("kr. ", "").Replace(")", "").Replace("-", "")</p> 433 } 434 <p>@GetString("Ecom:Order.Currency.Code") @shippingprice</p> 435 </div> 436 </div> 437 <hr> 438 <div class="row"> 439 <div class="col-xs-6"> 440 <p class="price">Total</p> 441 </div> 442 <div class="col-xs-6 text-right"> 443 <p class="price">@GetString("Ecom:Order.Currency.Code") @GetString("Ecom:Order.OrderLines.TotalPriceWithoutSymbol")</p> 444 </div> 445 <hr> 446 <button style="width: 100%;" class="btn" onclick="GoToBasket()">@Translate("basketcheckout", "Basket / Checkout")</button> 447 </div> 448 </div> 449 </div> 450 </div> 451 </div><!-- modal-content --> 452 </div><!-- modal-dialog --> 453 </div><!-- modal --> 454 455 </div> 456 457 </div> 458 <nav class="navbar navbar-default"> 459 <div class="container"> 460 <div class="navbar-header"> 461 <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse" aria-expanded="false" onclick="hideTop()"> 462 <span class="sr-only"></span> 463 <span class="icon-bar"></span> 464 <span class="icon-bar"></span> 465 <span class="icon-bar"></span> 466 </button> 467 </div> 468 <div class="collapse navbar-collapse" id="navbar-collapse"> 469 <button type="button" id="searchbuttonmobile" onclick="openSearchMobile()"><span class="glyphicon glyphicon-search" aria-hidden="true"></span></button> 470 <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse" aria-expanded="false" onclick="hideTop()"> 471 <span class="sr-only"></span> 472 <span class="closemobile">&#10005;</span> 473 </button> 474 <div class="logo" style="display: none;"> 475 <img src="/Files/Templates/Designs/RO/images/ro_logo.png" class="img-responsive" alt="ro logo"> 476 </div> 477 @GetValue("DwNavigation(topnavigation)") 478 479 @GetValue("DwNavigation(topMenulistmobile)") 480 481 <div class="language mobile text-center"> 482 @if (numLang > 1) { 483 <div class="languageDiv visible-xs" style="margin-top: 2em;display: inline-block !important; float: initial;"> 484 <select id="selectLanguageMobile" onchange="switchLanguage($(this))"> 485 @foreach (var language in GetLoop("Languages")) 486 { 487 if (language.GetBoolean("IsCurrent")) 488 { 489 <option value='@language.GetString("PageID")' selected="">@language.GetString("Name")</option> 490 } 491 else 492 { 493 <option value='@language.GetString("PageID")'>@language.GetString("Name")</option> 494 } 495 } 496 </select> 497 <i class="fa fa-caret-down" aria-hidden="true" style="position: relative; top: -21px; left: 77px; float: left"></i> 498 </div> 499 } 500 501 <div class="currencieDiv"> 502 <select id="selectCurrencie" onchange="switchCurrencie($(this))"> 503 @foreach (var curn in GetLoop("Currencies")) 504 { 505 if (curn.GetBoolean("Currency.IsCurrent")) 506 { 507 <option value='@curn.GetString("Currency.Code")' selected="">@curn.GetString("Currency.Name")</option> 508 } 509 else 510 { 511 <option value='@curn.GetString("Currency.Code")'>@curn.GetString("Currency.Name")</option> 512 } 513 } 514 </select> 515 <i class="fa fa-caret-down" aria-hidden="true"></i> 516 </div> 517 518 </div> 519 <div class="mobile-social">@RenderSnippet("SocialMedia")</div> 520 </div> 521 </div> 522 </nav> 523 524 @if (GetInteger("DwAreaFirstPageID") == GetInteger("DwPageID")) { 525 <div class="logo on-front"> 526 <a href='Default.aspx?ID=@GetInteger("DwAreaFirstPageID")'> 527 <img src="/Files/Templates/Designs/RO/images/ro_logo.png" class="img-responsive" alt="ro logo"> 528 </a> 529 </div> 530 } 531 532 @if (GetInteger("DwAreaFirstPageID") != GetInteger("DwPageID")) { 533 <div class="logo"> 534 <a href='Default.aspx?ID=@GetInteger("DwAreaFirstPageID")'> 535 <img src="/Files/Templates/Designs/RO/images/ro_logo.png" class="img-responsive" alt="ro logo"> 536 </a> 537 </div> 538 } 539 540 </div> 541 </div> 542 </div> 543 </header> 544 545 <div class="main"> 546 <div class="breadcrumbs-title"> 547 <div class="container-fluid"> 548 549 <div> 550 @if (GetInteger("DwAreaFirstPageID") != GetInteger("DwPageID")) 551 { 552 var productpage = ""; 553 554 if (GetString("DWExtranetAction").Contains("productid")) 555 { 556 productpage = "true"; 557 } 558 559 <ul class="breadcrumb" id="breadcrumb"></ul> 560 561 <script> 562 $(document).ready(function () { 563 var urlNoHost = location.href.split('/').slice(3); 564 565 function capitalizeFirstLetter(string) { 566 return string.charAt(0).toUpperCase() + string.slice(1); 567 } 568 569 function noDash(string) { 570 return string.replace(/\-/g, " ").trim(); 571 } 572 573 function convertSpecialChars(name) { 574 return name.replace("ae", "æ").replace("&#230;", "æ").replace("oe", "ø").replace("&#248;", "ø").replace("aa", "å").replace("&#229;", "å"); 575 } 576 577 function setLiAndA(name,number) { 578 579 var host = location.protocol + '//' + location.host + '/'; 580 var url = location.href; 581 url = url.substring(0, url.indexOf(name)); 582 var link = url + name; 583 var newname = ""; 584 585 if ("@productpage" == "true" && number == urlNoHost.length - 1) 586 { 587 newname = document.getElementById('prodName').innerHTML; 588 } 589 else 590 { 591 newname = noDash(name); 592 } 593 594 if("@GetString("DwAreaName")" == "Dansk") 595 { 596 newname = convertSpecialChars(newname); 597 } 598 599 newname = capitalizeFirstLetter(newname); 600 if (newname.indexOf('?') > -1) 601 { 602 newname = newname.substring(0, newname.indexOf('?')); 603 } 604 605 $('<a />', { 606 href: link, 607 text: newname 608 }).wrap('<li />').parent().appendTo('#breadcrumb'); 609 } 610 611 for (var i in urlNoHost) { 612 if (urlNoHost[i] == 'produkter' || urlNoHost[i] == 'products') { 613 urlNoHost.splice(i, 1); 614 } 615 } 616 617 for (var i in urlNoHost) { 618 setLiAndA(urlNoHost[i],i); 619 } 620 }) 621 </script> 622 } 623 </div> 624 625 626 @if (GetInteger("DwAreaFirstPageID") != GetInteger("DwPageID")) { 627 <h1>@GetString("DwPageName")</h1> 628 } 629 </div></div> 630 631 632 @using Newtonsoft.Json; 633 @using Newtonsoft.Json.Linq; 634 @using System.Net; 635 @using System.IO; 636 @using System.Web; 637 @using System.Collections; 638 @using System.Linq; 639 640 @functions{ 641 642 public class FeedResolver 643 { 644 public Meta meta { get; set; } 645 public Pagination pagination { get; set; } 646 public List<Data> data { get; set; } 647 } 648 649 public class Data 650 { 651 public Images images { get; set; } 652 public Caption caption { get; set; } 653 public double created_time { get; set; } 654 public string id { get; set; } 655 } 656 657 public class Caption 658 { 659 public string text { get; set; } 660 } 661 662 public class Pagination 663 { 664 public string next_url { get; set; } 665 public string next_max_id { get; set; } 666 } 667 668 // Meta class 669 public class Meta 670 { 671 public string code { get; set; } 672 } 673 674 public class Images 675 { 676 public Image low_resolution { get; set; } 677 public Image thumbnail { get; set; } 678 public Image standard_resolution { get; set; } 679 public Image __original { get; set; } 680 } 681 682 public class Image 683 { 684 public string url { get; set; } 685 public string width { get; set; } 686 public string height { get; set; } 687 } 688 689 public string getListJson(string url) 690 { 691 692 HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); 693 request.Method = "GET"; 694 request.Accept = "application/json"; 695 WebResponse response = request.GetResponse(); 696 Stream stream = response.GetResponseStream(); 697 StreamReader reader = new StreamReader(stream); 698 string content = reader.ReadToEnd(); 699 reader.Close(); 700 response.Close(); 701 702 return content; 703 704 } 705 706 public JToken convertToObject(string jsonString) 707 { 708 JToken token = JObject.Parse(jsonString); 709 return token; 710 } 711 712 public static DateTime UnixTimeStampToDateTime(double unixTimeStamp) 713 { 714 // Unix timestamp is seconds past epoch 715 System.DateTime dtDateTime = new DateTime(1970, 1, 1, 0, 0, 0, 0, System.DateTimeKind.Utc); 716 dtDateTime = dtDateTime.AddSeconds(unixTimeStamp).ToLocalTime(); 717 return dtDateTime; 718 } 719 } 720 721 @{ 722 // Hent resultater som json 723 string ApiUrl = "https://api.instagram.com/v1/users/1966900245/media/recent/?access_token=1966900245.c9c6b68.375ea7bd65914bcfb827ad081c2b4ef2&count=33"; 724 string JsonList = getListJson(ApiUrl); 725 FeedResolver ListOfImages = Newtonsoft.Json.JsonConvert.DeserializeObject<FeedResolver>(JsonList); 726 int Increment = 0; 727 728 729 var parentPage = Dynamicweb.Content.Page.GetPageById(7004); 730 int TopPageForFeedEntries = parentPage.ID; 731 var CurrentFeedEntries = Dynamicweb.Content.Page.GetPagesByParentID(TopPageForFeedEntries, parentPage.AreaID); 732 } 733 734 @foreach (var insta in ListOfImages.data) 735 { 736 737 var CountExistingPage = CurrentFeedEntries.Where(x => 738 x != null && 739 !string.IsNullOrEmpty(x.NavigationTag) && 740 x.NavigationTag.Equals(insta.id) 741 ); 742 743 744 if (!CountExistingPage.Any() ) 745 { 746 747 try 748 { 749 var NewPage = new Dynamicweb.Content.Page(parentPage.AreaID, TopPageForFeedEntries); 750 751 NewPage.ItemType = "InstagramBillede"; 752 NewPage.MenuText = "" + insta.id; 753 NewPage.Hidden = true; 754 NewPage.NavigationTag = insta.id; 755 NewPage.Active = false; 756 NewPage.Save(); 757 758 var item = Dynamicweb.Content.Items.ItemManager.Storage.GetById(NewPage.ItemType, NewPage.ItemId); 759 item["Dato"] = UnixTimeStampToDateTime(insta.created_time); 760 item["Billede"] = insta.images.__original.url; 761 item["BilledeBredde"] = insta.images.__original.width; 762 item["BilledeH_jde"] = insta.images.__original.height; 763 item["Overskrift"] = "" + insta.id; 764 if (insta.caption != null) 765 { 766 item["Tekst"] = insta.caption.text; 767 } 768 769 item.Save(); 770 771 Increment++; 772 } 773 catch (Exception e) 774 { 775 <text>Fejl i oprettelse af side @(Increment) @e<br></text> 776 } 777 } 778 } 779 780 781 <!--@If(Global:CookieOptInLevel == "_All")--> 782 <div class="cookie" id="cookieWarningDiv"> 783 <div class="container-fluid bg-grey"> 784 <div class="row"> 785 <div class="col-xs-12" style="padding: 1.5em;"> 786 <p> 787 @Translate("cookie", "This website uses cookies to remember your preferences, statistics and direct targeting. Read more about our policy <a href='#'>here</a>") 788 <a class="cookie-close pull-right" onclick="return setOptInCookie(2);"> 789 <span style="display:block; float:left; color: #000000; cursor: pointer;">X</span> 790 </a> 791 </p> 792 </div> 793 </div> 794 </div> 795 </div> 796 <!--@EndIf--> 797 </div> 798 799 <footer> 800 <div class="container-fluid bg-grey nav-bottom"> 801 <div class="row"> 802 <div class="col-xs-12 col-sm-12 col-md-6"> 803 <div class="row"> 804 <div class="col-xs-12 col-sm-6 left-nav-part"> 805 <ul> 806 @{ 807 foreach (LoopItem item in GetLoop("Item.Area.Menupunkter")) 808 { 809 if (item.GetString("Item.Area.Menupunkter.Placering.Value") == "left") 810 { 811 if (item.GetString("Item.Area.Menupunkter.Link.Value") != "") 812 { 813 <li><a href='@item.GetString("Item.Area.Menupunkter.Link.Value")'> @item.GetString("Item.Area.Menupunkter.Overskrift.Value")</a></li> 814 } 815 } 816 } 817 } 818 </ul> 819 </div> 820 @* Is possible to set Placering.Value = center. See properties at Website setttings *@ 821 <div class="col-xs-12 col-sm-6"> 822 <ul> 823 @{ 824 foreach (LoopItem item in GetLoop("Item.Area.Menupunkter")) 825 { 826 if (item.GetString("Item.Area.Menupunkter.Placering.Value") == "right") 827 { 828 if (item.GetString("Item.Area.Menupunkter.Link.Value") != "") 829 { 830 <li><a href='@item.GetString("Item.Area.Menupunkter.Link.Value")'> @item.GetString("Item.Area.Menupunkter.Overskrift.Value")</a></li> 831 } 832 } 833 } 834 } 835 </ul> 836 </div> 837 </div> 838 </div> 839 <div class="col-xs-12 col-sm-12 col-md-6"> 840 @* 841 <div class="col-xs-12 col-sm-offset-1 col-sm-7 pull-right" id="maillistdiv"> 842 <p id="maillisttext">Mail list</p> 843 <table id="maillisttable"> 844 <tr> 845 <td style="width: 100%;"><input type="text" name="maillist" value=""></td> 846 <td><button class="btn" name="maillistsubmit" type="submit">@Translate("submit", "Submit")</button></td> 847 </tr> 848 </table> 849 </div> 850 *@ 851 852 @{ var translateTing = @Translate("submit", "Tilmeld"); 853 var newsLetterPlaceholder = @Translate("newsletter-placeholder", "Indtast e-mail adresse"); 854 } 855 856 @if(GetString("LongLang")=="en-GB") { 857 @RenderParagraphContent(1297) 858 } else { 859 @RenderParagraphContent(1296) 860 } 861 862 @* 863 <!-- Begin MailChimp Signup Form --> 864 <!--<link href="//cdn-images.mailchimp.com/embedcode/slim-10_7.css" rel="stylesheet" type="text/css"> --> 865 866 <div id="mc_embed_signup"> 867 <form action="https://rocopenhagen.us16.list-manage.com/subscribe/post?u=4dd87e9d150463df79cfbb660&amp;id=@mailchimpID" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate=""> 868 <div id="mc_embed_signup_scroll"> 869 <label for="mce-EMAIL" style="font-weight: normal;">@Translate("newsletter", "Tilmeld nyhedsbrev")</label><br> 870 871 <div class="input-append"> 872 <input type="email" value="" name="EMAIL" class="email" id="mce-EMAIL" placeholder="@newsLetterPlaceholder" required="" style="border: none; padding: 0.4em 0.6em;width:50%;"> 873 <input type="submit" value="@translateTing" name="subscribe" id="mc-embedded-subscribe" class="button" style="margin-left: -10px;background-color: #000;border-radius: 0 !important;color: #fff !important;text-decoration: none;border: none;padding: 0.4em 0.6em;"> 874 </div> 875 876 <!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups--> 877 <div style="position: absolute; left: -5000px;" aria-hidden="true"><input type="text" name="b_4dd87e9d150463df79cfbb660_@mailchimpID" tabindex="-1" value=""></div> 878 <div class="clear"></div> 879 </div> 880 </form> 881 </div><!--End mc_embed_signup--> 882 *@ 883 </div> 884 </div> 885 886 <div class="row cards"> 887 <div class="col-xs-12 connect">@RenderSnippet("SocialMedia")</div> 888 <div class="col-xs-12"> 889 <img src="/Files/Templates/Designs/RO/images/dankort_22.gif" alt="dankort"> 890 <img src="/Files/Templates/Designs/RO/images/master_22.gif" alt="master card"> 891 <img src="/Files/Templates/Designs/RO/images/visa-22.gif" alt="visa"> 892 <img src="/Files/Templates/Designs/RO/images/jcb_22.gif" alt="jcb"> 893 <img src="/Files/Templates/Designs/RO/images/MobilePay_Logo.png" alt="MobilePay"> 894 </div> 895 </div> 896 </div> 897 898 <div class="container-fluid bg-grey information"> 899 <div class="row"> 900 <div class="col-xs-12 content">@GetString("Item.Area.Information")</div> 901 </div> 902 </div> 903 </footer> 904 905 @SnippetStart("SocialMedia") 906 907 @if (GetValue("Item.Area.Facebook") != "") 908 { 909 <a href='@GetString("Item.Area.Facebook")' target="_blank" class="nounderline"> 910 <div class="fa fa-facebook fa-3" aria-hidden="true"></div> 911 </a> 912 } 913 @if (GetValue("Item.Area.Pinterest") != "") 914 { 915 <a href='@GetString("Item.Area.Pinterest")' target="_blank" class="nounderline"> 916 <div class="fa fa-pinterest" aria-hidden="true"></div> 917 </a> 918 } 919 @if (GetValue("Item.Area.LinkedIn") != "") 920 { 921 <a href='@GetString("Item.Area.LinkedIn")' target="_blank" class="nounderline"> 922 <div class="fa fa-linkedin" aria-hidden="true"></div> 923 </a> 924 } 925 @if (GetValue("Item.Area.Instagram") != "") 926 { 927 <a href='@GetString("Item.Area.Instagram")' target="_blank" class="nounderline"> 928 <div class="fa fa-instagram" aria-hidden="true"></div> 929 </a> 930 } 931 @SnippetEnd("SocialMedia") 932 933 934 @*<script src="/Files/Templates/Designs/RO/js/bootstrap.min.js"></script> 935 <script src="https://unpkg.com/flickity@2/dist/flickity.pkgd.min.js"></script> 936 <script src="https://unpkg.com/packery@2/dist/packery.pkgd.min.js"></script> 937 <script src="https://use.fontawesome.com/a5f6115c09.js"></script>*@ 938 <script src="/Files/Templates/Designs/RO/js/bundle.js@(assetVersion)"></script> 939 940 <script> 941 var $container = $('.grid').imagesLoaded(function () { 942 // init Packery after all images have loaded 943 $container.packery({ 944 itemSelector: 'div[class*="col-"', 945 percentPosition: true 946 }); 947 }); 948 949 function hideTop() { 950 var top = document.getElementById('top'); 951 952 if (top.style.display == "none") { 953 top.style.display = "block"; 954 } 955 else { 956 top.style.display = "none"; 957 } 958 } 959 960 function openSearchMobile() { 961 var searchbar = document.getElementById('searchbarmobile'); 962 var navbar = document.getElementById('navbar-collapse'); 963 var overlay = document.getElementById('overlay'); 964 965 if (searchbar.style.display == "none") { 966 searchbar.style.display = "block"; 967 setTimeout(function () { 968 searchbar.style.opacity = 1; 969 }, 0); 970 overlay.style.display = "block"; 971 } 972 else { 973 searchbar.style.display = "none"; 974 navbar.style.top = "0%"; 975 overlay.style.display = "none"; 976 } 977 } 978 979 function closeOverlay() { 980 var searchbar = document.getElementById('searchbarmobile'); 981 var navbar = document.getElementById('navbar-collapse'); 982 var overlay = document.getElementById('overlay'); 983 984 searchbar.style.display = "none"; 985 searchbar.style.opacity = 0; 986 overlay.style.display = "none"; 987 } 988 989 function setOptInCookie(optInLevel) { 990 var xmlhttp; 991 if (window.XMLHttpRequest) { 992 xmlhttp = new XMLHttpRequest(); 993 } 994 else { 995 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); 996 } 997 xmlhttp.onreadystatechange = function () { 998 if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { 999 var div = document.getElementById("cookieWarningDiv"); 1000 div.parentNode.removeChild(div); 1001 return false; 1002 } 1003 } 1004 xmlhttp.open("GET", "/admin/public/CookieOptInLevelConfig.aspx?cmd=SetCookieOptInLevel&OptInLevel=" + optInLevel, true); 1005 xmlhttp.send(); 1006 return false; 1007 } 1008 1009 var searchbutton = document.getElementById('searchbuttontrigger'); 1010 var searchbar = document.getElementById('search'); 1011 var textsearch = document.getElementById('textsearch'); 1012 var topContainer = document.getElementById('top'); 1013 var check = 0; 1014 1015 function triggerSearch() { 1016 1017 if (searchbar.style.display == "none") { 1018 searchbar.style.display = "block"; 1019 setTimeout(function () { 1020 searchbar.style.opacity = 1; 1021 searchbar.style.transition = "all 0.5s"; 1022 searchbutton.style.transition = "all 0.5s" 1023 }, 0); 1024 searchbutton.style.display = "none"; 1025 check = 1; 1026 topContainer.classList.add("active"); 1027 } 1028 } 1029 1030 $(document).click(function (e) { 1031 if (check == 0 && e.target != textsearch) { 1032 topContainer.classList.remove("active"); 1033 searchbar.style.display = "none"; 1034 setTimeout(function () { 1035 searchbutton.style.opacity = 1; 1036 searchbutton.style.transition = "all 0.5s"; 1037 searchbar.style.transition = "all 0.5s" 1038 }, 0); 1039 searchbutton.style.display = "inline-block"; 1040 1041 } 1042 else { 1043 check = 0; 1044 } 1045 }); 1046 1047 function submitSearch() { 1048 document.EcomSearch.submit(); 1049 } 1050 1051 function submitSearchMobile() { 1052 document.EcomSearchMobile.submit(); 1053 } 1054 1055 function switchLanguage(caller) { 1056 var selectLang = document.getElementById($(caller).attr('id')); 1057 var ID = selectLang.options[selectLang.selectedIndex].value; 1058 1059 // empty the cart before we go to new language layer 1060 var url = '<!--@Global:Pageview.Url.Raw.JSEncoded()-->'; 1061 // $.post(url, { 1062 // 'CartCmd': 'emptycart' 1063 // }) 1064 // .done(function () { 1065 // 1066 // }) 1067 1068 alturl = "/Default.aspx?ID=" + ID; 1069 @if (!string.IsNullOrEmpty(Dynamicweb.Base.Request("GroupID"))){ 1070 <text>alturl = alturl + "&GroupID=@Dynamicweb.Base.Request("GroupID")";</text> 1071 } 1072 @if (!string.IsNullOrEmpty(Dynamicweb.Base.Request("ProductId"))){ 1073 <text>alturl = alturl + "&ProductID=@Dynamicweb.Base.Request("ProductID")";</text> 1074 } 1075 1076 window.location.href = alturl; 1077 } 1078 1079 function switchCurrencie(caller) { 1080 var selectCurn = document.getElementById($(caller).attr('id')); 1081 var CC = selectCurn.options[selectCurn.selectedIndex].value; 1082 var ID = @GetInteger("DwPageID"); 1083 1084 1085 // var url = '<!--@Global:Pageview.Url.Raw.JSEncoded()-->'; 1086 1087 alturl = "/Default.aspx?ID=" + ID; 1088 1089 if(CC=="DKK"){ 1090 alturl = alturl + "&CountryCode=DK&CurrencyCode=DKK"; 1091 }else if(CC=="GBP"){ 1092 alturl = alturl + "&CountryCode=GB&CurrencyCode=GBP"; 1093 }else{ 1094 // alturl = alturl + "&CountryCode=DE&CurrencyCode=EUR"; 1095 alturl = alturl + "&CurrencyCode=EUR"; 1096 } 1097 window.location.href = alturl; 1098 1099 1100 // alert(alturl) 1101 1102 } 1103 1104 1105 function GoToBasket() { 1106 var url = document.getElementsByName("DwAreaCartPageID")[0].value; 1107 window.location.href = "/Default.aspx?ID=" + url; 1108 } 1109 </script> 1110 <!--@Snippet(AdditionalJavascript)--> 1111 1112 1113 </body> 1114 </html> 1115 1116