Error compiling template "Designs/PacificBag/_parsed/leftMenu.parsed.cshtml"
Line 792: 'Dynamicweb.Ecommerce.Products.Group.GetGroupById(string)' is obsolete: 'Use Services.ProductGroups.GetGroup instead.'
Line 1771: No overload for method 'PageTitle' takes 0 arguments

1 @inherits RazorTemplateBase<RazorTemplateModel<Template>> 2 @using System 3 @using System.Linq 4 @using Dynamicweb.Rendering 5 @using Dynamicweb.Content 6 @using System.Text.RegularExpressions 7 @using System.Web.UI.HtmlControls 8 @{ string designName = GetString("Template:DesignBaseUrl").Replace("/Files/Templates/Designs/", "").Replace("/", "");}@functions{ 9 public static string GetImage(string sourceString, int imageWidth, int imageHeight, int imageWidthTablet = 0, int imageHeightTablet = 0, int imageWidthMobile = 0, int imageHeightMobile = 0, string imageFormat = "jpg", int imageCompression = 0, int imageCrop = 5, string background = "", string designName = "PacificBag") 10 { 11 Dynamicweb.Frontend.PageView currentPageview = Dynamicweb.Frontend.PageView.Current(); 12 string currDevice = currentPageview.Device.ToString(); 13 string alternativeImage = !String.IsNullOrEmpty(currentPageview.Area.Item["NoImage"].ToString()) ? currentPageview.Area.Item["NoImage"].ToString() : "/Files/Templates/Designs/"+ designName + "/images/alternativeImage.jpg"; 14 string widthString = ""; 15 string heightString = ""; 16 string getImageFormat = imageFormat != "jpg" ? "&amp;Format=" + imageFormat : ""; 17 string getImageCompression = imageCompression != 0 ? "&amp;Compression=" + imageCompression : ""; 18 string bgColor = !string.IsNullOrEmpty(background) ? "&amp;Background="+background : ""; 19 int getImageWidth = imageWidth != 0 ? imageWidth : 0; 20 int getImageHeight = imageHeight != 0 ? imageHeight : 0; 21 22 if (currDevice == Dynamicweb.Frontend.Devices.DeviceType.Tablet.ToString()) 23 { 24 getImageWidth = imageWidthTablet != 0 ? imageWidthTablet : getImageWidth; 25 getImageHeight = imageHeightTablet != 0 ? imageHeightTablet : getImageHeight; 26 } 27 else if (currDevice == Dynamicweb.Frontend.Devices.DeviceType.Mobile.ToString()) 28 { 29 getImageWidth = imageWidthMobile != 0 ? imageWidthMobile : getImageWidth; 30 getImageHeight = imageHeightMobile != 0 ? imageHeightMobile : getImageHeight; 31 } 32 33 if (getImageWidth != 0) 34 { 35 widthString = "&amp;Width=" + getImageWidth; 36 } 37 if (getImageHeight != 0) 38 { 39 heightString = "&amp;Height=" + getImageHeight; 40 } 41 42 string output = "/Admin/Public/GetImage.ashx?Image=" + sourceString + widthString + heightString + "&amp;altFmImage_path=" + alternativeImage + getImageFormat + getImageCompression + "&amp;Crop=" + imageCrop + bgColor; 43 return output; 44 } 45 46 public static string GetImageWhiteSpace(string sourceString, int imageWidth, int imageHeight, int imageWidthTablet = 0, int imageHeightTablet = 0, int imageWidthMobile = 0, int imageHeightMobile = 0, string imageFormat = "jpg", int imageCompression = 0, int imageCrop = 5, string background = "", string designName = "PacificBag") 47 { 48 Dynamicweb.Frontend.PageView currentPageview = Dynamicweb.Frontend.PageView.Current(); 49 string currDevice = currentPageview.Device.ToString(); 50 string alternativeImage = "/Files/Templates/Designs/" + designName + "/images/white80.png"; 51 string widthString = ""; 52 string heightString = ""; 53 string getImageFormat = imageFormat != "jpg" ? "&amp;Format=" + imageFormat : ""; 54 string getImageCompression = imageCompression != 0 ? "&amp;Compression=" + imageCompression : ""; 55 string bgColor = !string.IsNullOrEmpty(background) ? "&amp;Background="+background : ""; 56 int getImageWidth = imageWidth != 0 ? imageWidth : 0; 57 int getImageHeight = imageHeight != 0 ? imageHeight : 0; 58 59 if (currDevice == Dynamicweb.Frontend.Devices.DeviceType.Tablet.ToString()) 60 { 61 getImageWidth = imageWidthTablet != 0 ? imageWidthTablet : getImageWidth; 62 getImageHeight = imageHeightTablet != 0 ? imageHeightTablet : getImageHeight; 63 } 64 else if (currDevice == Dynamicweb.Frontend.Devices.DeviceType.Mobile.ToString()) 65 { 66 getImageWidth = imageWidthMobile != 0 ? imageWidthMobile : getImageWidth; 67 getImageHeight = imageHeightMobile != 0 ? imageHeightMobile : getImageHeight; 68 } 69 70 if (getImageWidth != 0) 71 { 72 widthString = "&amp;Width=" + getImageWidth; 73 } 74 if (getImageHeight != 0) 75 { 76 heightString = "&amp;Height=" + getImageHeight; 77 } 78 79 string output = "/Admin/Public/GetImage.ashx?Image=" + sourceString + widthString + heightString + "&amp;altFmImage_path=" + alternativeImage + getImageFormat + getImageCompression + "&amp;Crop=" + imageCrop + bgColor; 80 return output; 81 } 82 } 83 @functions{ 84 public string GetCurrentUrl() 85 { 86 string currentUrl = Pageview.GlobalTags.GetTagByName("Global:Request.Scheme").Value.ToString() + "://" + Pageview.GlobalTags.GetTagByName("Global:Request.Host").Value.ToString() + Pageview.GlobalTags.GetTagByName("Global:Pageview.Url").Value.ToString(); 87 88 return currentUrl; 89 } 90 } 91 @using System.Runtime 92 @using Dynamicweb.Rendering 93 @using System.Text.RegularExpressions 94 @using Dynamicweb.Core 95 @inherits RazorTemplateBase<RazorTemplateModel<Template>> 96 97 @helper OgMeta(string designName) 98 { 99 if (string.IsNullOrEmpty(System.Web.HttpContext.Current.Request.Params["ProductID"])) 100 { 101 @SnippetStart("OGMeta")<meta property="og:title" content='@GetString("Title")'> 102 <meta property="og:image" content='@Pageview.GlobalTags.GetTagByName("Global:Request.Scheme").Value.ToString()://@Pageview.GlobalTags.GetTagByName("Global:Request.Host").Value.ToString()/Files/Templates/Designs/@designName/images/logo.png'> 103 <meta property="og:site_name" content='@GetString("Item.Area.CompanyName")'> 104 <meta property="og:url" content='@Pageview.GlobalTags.GetTagByName("Global:Request.Scheme").Value.ToString()://@Pageview.GlobalTags.GetTagByName("Global:Request.Host").Value.ToString()@Pageview.GlobalTags.GetTagByName("Global:Pageview.Url").Value.ToString()'> 105 <meta property="og:description" content='@StripHtml(GetString("Meta.Description"))'> 106 <meta property="og:type" content="article"> 107 <meta property="og:locale" content='@Pageview.GlobalTags.GetTagByName("Global:Area.LongLang").Value.ToString().Replace("-", "_")'> 108 @SnippetEnd("OGMeta") 109 } 110 } 111 @helper HtmlHead(string designName) 112 { 113 string designFolder = GetString("Template:DesignBaseUrl"); 114 string robots = ""; 115 string ipCountry = Dna.IP.Frontend.GetCountryCode(); 116 var googleReCaptchaSiteKey = GetString("Item.Area.GoogleReCaptchaSiteKey"); 117 string countryCodeModule = !string.IsNullOrEmpty(ipCountry) ? ipCountry : "US"; 118 string userCountryCode = (Pageview.User != null && !string.IsNullOrEmpty(Pageview.User.Country)) ? Pageview.User.Country : ipCountry; 119 string userState = Pageview.User != null ? Pageview.User.State : string.Empty; 120 string userAccountsNumber = (System.Web.HttpContext.Current.Session["AccountsNumber"] ?? "").ToString(); 121 robots = (GetBoolean("Item.Area.DemoBanner") || GetBoolean("Item.Area.NoIndex")) ? CommaSplittedString(robots, "noindex") : ""; 122 robots += (GetBoolean("Item.Area.DemoBanner") || GetBoolean("Item.Area.NoFollow")) ? CommaSplittedString(robots, "nofollow") : ""; 123 124 <head> 125 126 <!-- begin SnapEngage code --> 127 <script type="text/javascript"> 128 (function() { 129 var se = document.createElement('script'); se.type = 'text/javascript'; se.async = true; 130 se.src = '//storage.googleapis.com/code.snapengage.com/js/326bf66f-7884-4214-bcd8-09da130b6534.js'; 131 var done = false; 132 se.onload = se.onreadystatechange = function() { 133 if (!done&&(!this.readyState||this.readyState==='loaded'||this.readyState==='complete')) { 134 done = true; 135 /* Place your SnapEngage JS API code below */ 136 /* SnapEngage.allowChatSound(true); Example JS API: Enable sounds for Visitors. */ 137 } 138 }; 139 var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(se, s); 140 })(); 141 </script> 142 <!-- end SnapEngage code --> 143 144 <script>(function(w,d,t,r,u){var f,n,i;w[u]=w[u]||[],f=function(){var o={ti:"21000061"};o.q=w[u],w[u]=new UET(o),w[u].push("pageLoad")},n=d.createElement(t),n.src=r,n.async=1,n.onload=n.onreadystatechange=function(){var s=this.readyState;s&&s!=="loaded"&&s!=="complete"||(f(),n.onload=n.onreadystatechange=null)},i=d.getElementsByTagName(t)[0],i.parentNode.insertBefore(n,i)})(window,document,"script","//bat.bing.com/bat.js","uetq");</script> 145 <script src="https://my.hellobar.com/cef4edf037f4a5eb8a87717b77b678872e81b91e.js" type="text/javascript" charset="utf-8" async="async"></script> 146 147 <!-- Facebook Pixel Code --> 148 149 <script> 150 151 !function(f,b,e,v,n,t,s) 152 153 {if(f.fbq)return;n=f.fbq=function(){n.callMethod? 154 155 n.callMethod.apply(n,arguments):n.queue.push(arguments)}; 156 157 if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0'; 158 159 n.queue=[];t=b.createElement(e);t.async=!0; 160 161 t.src=v;s=b.getElementsByTagName(e)[0]; 162 163 s.parentNode.insertBefore(t,s)}(window,document,'script', 164 165 'https://connect.facebook.net/en_US/fbevents.js'); 166 167 168 fbq('init', '1576804409143309'); 169 170 fbq('track', 'PageView'); 171 172 </script> 173 174 <noscript> 175 176 <img height="1" width="1" src="https://www.facebook.com/tr?id=1576804409143309&ev=PageView 177 178 &noscript=1"> 179 180 </noscript> 181 182 <!-- End Facebook Pixel Code --> 183 184 <title>@GetValue("Title")</title> 185 <meta http-equiv="content-type" content="text/html; charset=utf-8"> 186 <meta name="viewport" content="initial-scale=1.0, width=device-width, user-scalable=no"> 187 <meta http-equiv="X-UA-Compatible" content="IE=edge"> 188 <meta name="SKYPE_TOOLBAR" content="SKYPE_TOOLBAR_PARSER_COMPATIBLE"> 189 @if (!string.IsNullOrEmpty(robots)) 190 { 191 <meta name="robots" content="@robots"> 192 } 193 @OgMeta(designName) 194 @RenderSnippet("OGMeta") 195 @GetString("MetaTags") 196 @GetString("CopyRightNotice") 197 @GetString("Stylesheets") 198 @RenderSnippet("outScripts") 199 @GetString("Javascripts") 200 201 <!-- Begin Bing Conversion Tracking --> 202 203 <script>(function(w,d,t,r,u){var f,n,i;w[u]=w[u]||[],f=function(){var o={ti:"21000061"};o.q=w[u],w[u]=new UET(o),w[u].push("pageLoad")},n=d.createElement(t),n.src=r,n.async=1,n.onload=n.onreadystatechange=function(){var s=this.readyState;s&&s!=="loaded"&&s!=="complete"||(f(),n.onload=n.onreadystatechange=null)},i=d.getElementsByTagName(t)[0],i.parentNode.insertBefore(n,i)})(window,document,"script","//bat.bing.com/bat.js","uetq");</script> 204 205 <!-- End Bing Conversion Tracking Code --> 206 207 <link rel="shortcut icon" href="@(designFolder)images/favicon.ico" type="image/x-icon"> 208 @{ 209 var minify = GetBoolean("Item.Area.Minify_CSS_And_JavaScript"); 210 var styleBundle = Dna.Optimizer.Renderer.RenderStyles(string.Format("{0}css", designFolder), minify, true, "-main-styles", new[] { "exceptions" }); 211 var scriptBundle = Dna.Optimizer.Renderer.RenderScripts(string.Format("{0}js", designFolder), minify, true, "-main-scripts", new[] { "exceptions" }); 212 } 213 <link rel="stylesheet" href="@styleBundle"> 214 @if (googleReCaptchaSiteKey.IsNotNullOrEmpty()) 215 { 216 <script src="https://www.google.com/recaptcha/api.js" async="" defer=""></script> 217 } 218 <script src="@scriptBundle"></script> 219 @SnippetStart("outScripts") @SnippetEnd("outScripts") 220 <!--[if lte IE 9]> 221 <script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script> 222 <script src="//cdnjs.cloudflare.com/ajax/libs/respond.js/1.1.0/respond.min.js"></script> 223 <![endif]--> 224 <script> 225 @RenderSnippet("jsVariables") 226 @SnippetStart("jsVariables") @SnippetEnd("jsVariables") 227 228 var obj_pages = { 229 str_miniCart: '@Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(GetString("Item.Area.MiniCart"))', 230 str_login: '@Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(GetString("Item.Area.Login"))', 231 str_globalTranslates: '@Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(GetString("Item.Area.GlobalTranslates"))', 232 str_contactPopup : '@Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(GetString("Item.Area.ContactUs_Popup"))', 233 str_cartInformation: '@Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(GetString("Item.Area.Cart_Information"))', 234 str_typeAhead : '@Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(GetString("Item.Area.TypeAhead"))' 235 }, 236 obj_user = { 237 str_country: '@userCountryCode', 238 str_state: '@userState', 239 str_accountsNumber:'@userAccountsNumber' 240 }, 241 obj_settings = { 242 str_contactTimeout: '@GetString("Item.Area.Time")', 243 str_cartQty: '@GetString("Ecom:Order.OrderLines.TotalProductQuantity")' 244 }, 245 obj_translates = { 246 str_seeAll: '@Translate("seeAllThe", "See all the")', 247 str_results: '@Translate("results", "results")', 248 str_invalidAddress: '@Translate("invalidAddress", "Something isn’t correct with your address. Please check that each *required line has appropriate information in it, e.g. Address line 1 has an actual street address.")' 249 }; 250 $(function () { 251 @UserDoesNotExist() 252 @RenderSnippet("jsOnLoadVariables") 253 @SnippetStart("jsOnLoadVariables") @SnippetEnd("jsOnLoadVariables") 254 @RenderSnippet("jsOnLoad") 255 @SnippetStart("jsOnLoad") @SnippetEnd("jsOnLoad") 256 }); 257 @if(!string.IsNullOrWhiteSpace(GetString("Item.Area.GoogleAnalytics"))) 258 { 259 <text> 260 (function (i, s, o, g, r, a, m) { 261 i['GoogleAnalyticsObject'] = r; i[r] = i[r] || function () { 262 (i[r].q = i[r].q || []).push(arguments) 263 }, i[r].l = 1 * new Date(); a = s.createElement(o), 264 m = s.getElementsByTagName(o)[0]; a.async = 1; a.src = g; m.parentNode.insertBefore(a, m) 265 })(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga'); 266 267 ga('create', '@GetString("Item.Area.GoogleAnalytics")', 'auto'); 268 ga('send', 'pageview'); 269 </text> 270 } 271 </script> 272 @{ 273 var googleAdwords = GetString("Item.Area.GoogleAdwords"); 274 } 275 @if (!string.IsNullOrWhiteSpace(googleAdwords)) 276 { 277 <script async="" src="https://www.googletagmanager.com/gtag/js?id=@googleAdwords"></script> 278 <script> 279 window.dataLayer = window.dataLayer || []; 280 function gtag(){dataLayer.push(arguments);} 281 gtag('js', new Date()); 282 283 gtag('config', '@googleAdwords'); 284 </script> 285 } 286 287 @RenderSnippet("eCommerceTracking") 288 @SnippetStart("eCommerceTracking") @SnippetEnd("eCommerceTracking") 289 </head> 290 } 291 @helper RenderPageImageVideo(string image, string video) 292 { 293 if (!String.IsNullOrWhiteSpace(video)) 294 { 295 image = "/Admin/Public/GetImage.ashx?Image=" + image + "&Height=1080&Crop=5"; 296 297 <section id="topMediaContainer" data-image="@image" data-video="@video"> 298 @if (!String.IsNullOrWhiteSpace(image)) 299 { 300 <img src="@image" class="hidden"> 301 } 302 @if (!String.IsNullOrWhiteSpace(video)) 303 { 304 <span class="hidden">@video</span> 305 } 306 </section> 307 @SnippetStart("jsOnLoad") 308 @:onLoadTopMediaContainer("@(GetString("Item.Page.ButtonText"))", "@(GetString("Item.Page.ButtonLink"))"); 309 @SnippetEnd("jsOnLoad") 310 } 311 } 312 313 @helper RenderPageHeading(string heading, string subHeading, string image, string video, bool leftAlign) 314 { 315 image = !String.IsNullOrWhiteSpace(image) ? "/Admin/Public/GetImage.ashx?Image=" + image + "&Height=1080&Crop=5" : ""; 316 string topMediaContainerClass = GetBoolean("Item.Page.BigHeader") ? "bigHeader" : String.Empty; 317 topMediaContainerClass += GetBoolean("Item.Page.NoWhiteText") ? " noWhiteText" : String.Empty; 318 var request = System.Web.HttpContext.Current.Request.Params; 319 string buttonText = GetString("Item.Page.ButtonText"), 320 buttonLink = GetString("Item.Page.ButtonLink"); 321 322 // Group Image - Banner 323 if (request["groupid"] != null) 324 { 325 var group = Dynamicweb.Ecommerce.Products.Group.GetGroupById(request["groupid"].ToString()); 326 327 if(group != null){ 328 if (group.ParentGroups.Count > 0) 329 { 330 group = group.ParentGroups[0]; 331 } 332 333 string groupName = group.Name; 334 string groupImage = !string.IsNullOrWhiteSpace(group.LargeImage) ? group.LargeImage : group.SmallImage; 335 string groupDescription = group.ProductGroupFieldValues.GetProductGroupFieldValue("BannerDescription").Value.ToString(); 336 337 if (!string.IsNullOrWhiteSpace(groupImage)) 338 { 339 heading = groupName; 340 subHeading = groupDescription; 341 image = "/Admin/Public/GetImage.ashx?Image=/Files" + groupImage + "&Height=1080&Crop=5"; 342 } 343 } 344 345 } 346 347 if (!String.IsNullOrWhiteSpace(image) && String.IsNullOrWhiteSpace(video)) 348 { 349 string layoutType = !string.IsNullOrWhiteSpace(subHeading) ? "twoColumn" : "oneColumn"; 350 string headerClass = leftAlign ? "text-left" : ""; 351 352 <section id="pageHeadingContainer" class="@topMediaContainerClass" style="background-image:url('@image')"> 353 <div id="pageHeadingContent" class="container @layoutType"> 354 <p class="h1 @headerClass">@heading</p> 355 <p>@subHeading 356 @if (!string.IsNullOrEmpty(buttonLink)) 357 { 358 <a class="btn btn-bg pull-left" href="@buttonLink">@buttonText</a> 359 } 360 </p> 361 </div> 362 </section> 363 } 364 } 365 @helper UserDoesNotExist() 366 { 367 if (Dynamicweb.Environment.ExecutingContext.IsFrontEnd() && !Dynamicweb.Security.UserManagement.User.IsExtranetUserLoggedIn()) 368 { 369 if (!string.IsNullOrEmpty(System.Web.HttpContext.Current.Request.Params["Password"]) && !string.IsNullOrEmpty(System.Web.HttpContext.Current.Request.Params["Username"])) 370 { 371 @SnippetStart("jsOnLoad") 372 @:var showLogin = true; 373 @:alert("@(Translate("userNotFoundInTheDatabase", "User not found in the database"))"); 374 @SnippetEnd("jsOnLoad") 375 } 376 } 377 } 378 @helper Logo(string cssclass, string companyName, string designName) 379 { 380 string logo = !string.IsNullOrEmpty(System.Web.HttpContext.Current.Request.Params["print"]) ? "/Admin/Public/GetImage.ashx?Image=/Files/Templates/Designs/"+designName+"/images/logo.png&Width=220" : "/Files/Templates/Designs/"+designName+"/images/logo.png"; 381 382 <figure class="@cssclass"> 383 <a href="/"> 384 <img class="img-responsive" src="@logo" alt="@companyName" title="@companyName"> 385 </a> 386 </figure> 387 } 388 @helper DemoBanner() 389 { 390 if (GetBoolean("Item.Area.Banner") && System.Web.HttpContext.Current.Request.Cookies["demoMode"] == null) 391 { 392 <div class="demoMode">Demo</div> 393 } 394 } 395 @helper Copyright() 396 { 397 <div class="col-xs-12 copyright">&copy; @DateTime.Now.Year @GetString("Item.Area.CompanyName") @*- @GetString("Item.Area.Copyright")*@</div> 398 } 399 400 @helper RenderSearchBar() 401 { 402 var resultsPage = GetInteger("Item.Area.SearchResults"); 403 var q = (System.Web.HttpContext.Current.Request["q"] ?? "").ToString(); 404 405 <div id="searchContainer" class="col-sm-offset-4 col-sm-8 col-xs-12"> 406 <div class="searchContainer col-xs-12"> 407 <form action="/Default.aspx" id="searchForm"> 408 <fieldset class="col-xs-4 Select mandatory pull-right hidden"> 409 <label for="searchSubmit" class="hide">@Translate("search", "Search")</label> 410 <select name="ID"> 411 <option value="@resultsPage" selected="">@Translate("productSearch", "Product Search")</option> 412 </select> 413 </fieldset> 414 <fieldset class="col-xs-12 TextInput mandatory noPadding"> 415 <label for="searchSubmit" class="hide">@Translate("search", "Search")</label> 416 <input placeholder='@Translate("search", "Search")' id="searchSubmit" data-error='@Translate("searchText", "Search for something")' type="text" name="q" value="@q"> 417 </fieldset> 418 <input type="submit" class="hidden" value="send"> 419 </form> 420 </div> 421 <div id="autocompleteWrap">&nbsp;</div> 422 </div> 423 } 424 425 @functions { 426 private string CommaSplittedString(string CommaSplittedString, string NewString) 427 { 428 429 if (!string.IsNullOrEmpty(CommaSplittedString)) 430 { 431 CommaSplittedString += ", "; 432 } 433 CommaSplittedString += NewString; 434 435 return CommaSplittedString; 436 } 437 public static string StripHtml(string source) 438 { 439 return Regex.Replace(source, "<.*?>", string.Empty); 440 } 441 } 442 @{ 443 var currentQuery = "Default.aspx" + System.Web.HttpContext.Current.Request.Url.Query; 444 if (!string.IsNullOrEmpty(currentQuery) && currentQuery.ToLower().Equals(string.Format("default.aspx?id={0}", Pageview.Page.ID))) 445 { 446 var newQuery = currentQuery; 447 var filterParamters = GetString("Item.Page.FilterParameters").Split(new string[] {"&", "?"}, StringSplitOptions.RemoveEmptyEntries); 448 449 foreach (var fp in filterParamters) 450 { 451 if (!currentQuery.Contains(fp.Substring(0, fp.IndexOf("=")) + "=")) 452 { 453 newQuery += newQuery.Contains("?") ? "&" : "?"; 454 newQuery += fp; 455 } 456 } 457 458 if (currentQuery != newQuery) 459 { 460 System.Web.HttpContext.Current.Response.Redirect(Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(newQuery), true); 461 } 462 } 463 464 string device = Pageview.Device.ToString(); 465 string homeOrSubpage = GetString("DwAreaFirstPageID") == Pageview.Page.ID.ToString() ? "home" : "subpage"; 466 string print = !string.IsNullOrEmpty(System.Web.HttpContext.Current.Request.Params["print"]) ? "printOrPdf" : ""; 467 string contactUsPage = GetString("Item.Area.ContactUs"); 468 string countryCode = Dna.IP.Frontend.GetCountryCode(); 469 string longLang = Pageview.GlobalTags.GetTagByName("Global:Area.LongLang").Value.ToString(); 470 string email = GetString("Item.Area.Email"); 471 string phone = GetString("Item.Area.Phone"); 472 bool userIsLoggedIn = Dynamicweb.Security.UserManagement.User.IsExtranetUserLoggedIn(); 473 bool isPrint = !string.IsNullOrEmpty(System.Web.HttpContext.Current.Request.Params["print"]); 474 bool bol_backofficeLogged = Dynamicweb.Security.UserManagement.User.GetCurrentBackendUser() != null ? true : false; 475 List<LoopItem> socialMedia = GetLoop("Item.Area.SocialNetworks"); 476 List<LoopItem> websiteLanguages = GetLoop("WebsiteLanguages"); 477 if (userIsLoggedIn) 478 { 479 string logedUserId = Pageview.User.CurrentSecondaryUser == null ? Dynamicweb.Security.UserManagement.User.GetCurrentExtranetUserId().ToString() : Pageview.User.CurrentSecondaryUser.ID.ToString(); 480 System.Web.HttpContext.Current.Session["UserId"] = logedUserId; 481 482 if (System.Web.HttpContext.Current.Request["DWExtranetSecondaryUserSelector"] != null && Pageview.User.CurrentSecondaryUser != null) 483 { 484 System.Web.HttpContext.Current.Session["AccountsNumber"] = Pageview.User.CurrentSecondaryUser.GetUsersICanSetAsSecondary().Count; 485 } 486 } 487 }<!DOCTYPE HTML> 488 <!--[if lt IE 8 ]><html class="ie7" lang="@(longLang)"><![endif]--><!--[if IE 8 ]><html class="ie8" lang="@(longLang)"><![endif]--><!--[if IE 9 ]><html class="ie9" lang="@(longLang)"><![endif]--><!--[if (gt IE 9)|!(IE)]><!--> 489 <html lang="@(longLang)"> 490 <!--<![endif]--> 491 @HtmlHead(designName) 492 <body class="@device logged_@userIsLoggedIn.ToString() @homeOrSubpage @print" data-countrycode="@countryCode"> 493 <div class="wrap"> 494 <header id="headerContainer" class="container-fluid noPadding"> 495 <h1 class="hidden">@GetString("Title")</h1> 496 <div id="topHeaderContainer" class="col-xs-12 noPadding"> 497 <div class="container noPadding"> 498 @Logo("col-md-4 col-sm-6 col-xs-12", GetString("Item.Area.CompanyName"), designName) 499 @if (!string.IsNullOrEmpty(GetString("DwNavigation(topMenu)")) && !isPrint) 500 { 501 <nav id="topMenuContainer" class="navbar navbar-default col-xs-12 col-sm-6 col-md-8"> 502 <div class="col-xs-12 welcomeBack"> 503 @if (userIsLoggedIn) 504 { 505 string userName = !string.IsNullOrWhiteSpace(Pageview.User.Name) ? Pageview.User.Name : string.Format("{0}{1}", Pageview.User.FirstName, Pageview.User.LastName); 506 string pageId = Pageview.Page.ID.ToString(); 507 bool isImpersonate = Pageview.User.CurrentSecondaryUser != null; 508 string switchAccountUrl = string.Format("Default.aspx?ID={0}", (Pageview.Area.Item["ManageAccounts"] ?? "").ToString()); 509 510 if (isImpersonate && !(System.Web.HttpContext.Current.Session["AccountsNumber"] ?? "").ToString().Equals("1")) 511 { 512 <span>@Translate("managingAccount", "Managing Account"): @(!string.IsNullOrWhiteSpace(userName) ? userName : Pageview.User.UserName)</span> 513 <a href="@switchAccountUrl">@Translate("switchAccount", "SwitchAccount")</a> 514 <a href="/Admin/Public/ExtranetLogoff.aspx">@Translate("logout", "Logout")</a> 515 } 516 else 517 { 518 <span>@Translate("welcomeBack", "Welcome Back,") @(!string.IsNullOrWhiteSpace(userName) ? userName : Pageview.User.UserName)</span> 519 <a href="/Admin/Public/ExtranetLogoff.aspx">@Translate("logout", "Logout")</a> 520 } 521 } 522 </div> 523 @RenderSearchBar() 524 @GetValue("DwNavigation(topMenu)") 525 </nav> 526 } 527 </div> 528 </div> 529 <div id="menuMainContainer" class="col-xs-12 noPadding"> 530 <div id="mainNavContainer" class="col-xs-12 noPadding"> 531 <div class="container noPadding"> 532 @if (!string.IsNullOrEmpty(GetString("DwNavigation(menuMain)"))) 533 { 534 <nav class="navbar navbar-default"> 535 <div class="navbar-header"> 536 <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar"> 537 <i class="fa fa-bars"></i> 538 </button> 539 </div> 540 <div id="navbar" class="navbar-collapse collapse noPadding"> 541 @GetValue("DwNavigation(menuMain)") 542 </div> 543 </nav> 544 } 545 </div> 546 </div> 547 </div> 548 @RenderSnippet("loginForm") 549 </header> 550 @RenderPageImageVideo(GetString("Item.Page.Image"), GetString("Item.Page.Video")) 551 @RenderPageHeading(GetString("Item.Page.PageHeading"), GetString("Item.Page.PageSubHeading"), GetString("Item.Page.Image"), GetString("Item.Page.Video"), GetBoolean("Item.Page.PageHeadingAlignLeft")) 552 553 @if (!GetBoolean("Item.Page.Hide2ndLevelMenu") && !GetString("Item.ItemInstanceType").Equals("News")) 554 { 555 @GetValue("DwNavigation(groupMenu)") 556 } 557 558 <section id="contentWrapper"> 559 @inherits RazorTemplateBase<RazorTemplateModel<Template>> 560 @using Dynamicweb.Rendering; 561 562 563 @inherits RazorTemplateBase<RazorTemplateModel<Template>> 564 @using Dynamicweb.Rendering; 565 566 @helper Breadcrumb() { 567 if (!string.IsNullOrEmpty(GetString("DwNavigation(breadCrumbsMenu2)"))) 568 { 569 <div class="col-xs-12 noPadding"> 570 <nav id="breadMenuContainer" class="col-xs-12 noPadding"> 571 <ul id="breadCrumbsMenu"> 572 <li><a href="/">@Translate("home", "Home")</a></li> 573 @GetValue("DwNavigation(breadCrumbsMenu2)") 574 @if (!string.IsNullOrEmpty(System.Web.HttpContext.Current.Request.Params["productid"])) 575 { 576 <li> 577 &nbsp;»&nbsp; 578 @GetString("Title") 579 </li> 580 } 581 </ul> 582 </nav> 583 </div> 584 } 585 } 586 587 @helper PageTitle(string image, string video) 588 { 589 if (String.IsNullOrWhiteSpace(image) && String.IsNullOrWhiteSpace(video) && !GetBoolean("Item.Page.HidePageTitle")) 590 { 591 string heading = GetString("Item.Page.PageHeading"), 592 title = !String.IsNullOrEmpty(heading) ? heading : GetString("DwPageName"); 593 <div class="container pageTitle"> 594 <div class="h1">@title</div> 595 </div> 596 } 597 } 598 599 @helper CentralContent(string rightClass = "col-xs-12 noPadding") { 600 if (!string.IsNullOrEmpty(GetString("DwContent(fullWidthContent)"))) 601 { 602 <section id="fullWidthContainer" class="container-fluid fullWidthSection"> 603 <div id="fullWidthContent" class="row">@GetValue("DwContent(fullWidthContent)")</div> 604 </section> 605 } 606 607 if (!string.IsNullOrEmpty(GetString("DwContent(centralContent)"))) 608 { 609 <div class="container"> 610 <section id="centralContainer" class="col-xs-12 noPadding-xs"> 611 <div id="centralContent" class="row">@GetValue("DwContent(centralContent)")</div> 612 </section> 613 </div> 614 } 615 616 if (!string.IsNullOrEmpty(GetString("DwContent(fullWidthContent2)"))) 617 { 618 <section id="fullWidthContainer2" class="container-fluid fullWidthSection"> 619 <div id="fullWidthContent2" class="row">@GetValue("DwContent(fullWidthContent2)")</div> 620 </section> 621 } 622 623 if (!string.IsNullOrEmpty(GetString("DwContent(centralContent2)"))) 624 { 625 <div class="container"> 626 <section id="centralContainer2" class="col-xs-12 noPadding-xs"> 627 <div id="centralContent2" class="row">@GetValue("DwContent(centralContent2)")</div> 628 </section> 629 </div> 630 } 631 } 632 633 @Breadcrumb() 634 @PageTitle() 635 @if(!string.IsNullOrEmpty(GetString("DwNavigation(leftMenu)"))){ 636 <nav id="leftMenuContainer" class="col-sm-3 noPaddingLeft"> 637 @GetValue("DwNavigation(leftMenu)") 638 </nav> 639 } 640 @CentralContent("col-xs-9 noPadding") 641 </section> 642 643 @if (!isPrint) 644 { 645 <footer id="footer" class="container-fluid noPadding"> 646 <div id="footerLargeMenuContainer" class="container-fluid noPadding"> 647 <div class="container"> 648 <div class="col-sm-12 socialContainer"> 649 @if (socialMedia.Any()) 650 { 651 @SnippetStart("socialMedia") 652 <ul class="noPadding" id="socialMedia"> 653 @foreach (LoopItem socialItem in socialMedia) 654 { 655 string className = socialItem.GetString("Item.Area.SocialNetworks.Icon"), 656 socialName = socialItem.GetString("Item.Area.SocialNetworks.Name"), 657 socialLink = socialItem.GetString("Item.Area.SocialNetworks.Link"); 658 659 socialLink = !string.IsNullOrEmpty(socialLink) ? socialLink : "#"; 660 661 <li> 662 <a title="@socialName" class="@className fa" target="_blank" href="@socialLink"> 663 <span class="hidden">@socialName</span> 664 </a> 665 </li> 666 } 667 </ul> 668 @SnippetEnd("socialMedia") 669 @RenderSnippet("socialMedia") 670 } 671 </div> 672 673 @if (!string.IsNullOrEmpty(GetString("DwNavigation(bottomMenu)"))) 674 { 675 <nav id="bottomMenuContainer" class="col-xs-12"> 676 @GetValue("DwNavigation(bottomMenu)") 677 </nav> 678 } 679 680 <div class="footerContactInfo col-xs-12 noPadding-left hidden"> 681 <p class="noPadding"> 682 <a href="mailto:@email">@email</a> 683 </p> 684 <p class="noPadding"> 685 <a href="tel:@phone">@phone</a> 686 </p> 687 </div> 688 689 </div> 690 <div id="copyrightContainer" class="container-fluid"> 691 <div class="container"> 692 <div class="row"> 693 <div class="col-xs-12 col-md-6">@Copyright()</div> 694 <div class="col-xs-12 col-md-6"> 695 @if (!string.IsNullOrEmpty(GetString("DwNavigation(copyrightMenu)"))) 696 { 697 <nav id="copyrightMenuContainer"> 698 @GetValue("DwNavigation(copyrightMenu)") 699 </nav> 700 } 701 702 </div> 703 </div> 704 </div> 705 </div> 706 @DemoBanner() 707 </div></footer> 708 } 709 710 711 @if (bol_backofficeLogged) 712 { 713 <div id="urlPath" class="text-center col-xs-12"> 714 @Pageview.GlobalTags.GetTagByName("Global:Request.PathAndQuery").Value <br> 715 @Pageview.GlobalTags.GetTagByName("Global:Request.Url").Value 716 </div> 717 } 718 @RenderSnippet("bodyBeforeEnd") 719 </div></body> 720 <!--Start Cookie Script--> <script type="text/javascript" charset="UTF-8" src="//cookie-script.com/s/4615528e5aefd86935f9f18ffef91ed5.js"></script> <!--End Cookie Script--> 721 <!--Start Cookie Script--> <script type="text/javascript" charset="UTF-8" src="//eu.cookie-script.com/s/4615528e5aefd86935f9f18ffef91ed5.js"></script> <!--End Cookie Script--> 722 </html> 723 724 @SnippetStart("loginForm") 725 @{ 726 string createAccountPage = GetString("Item.Area.CreateAccount"); 727 string addUserPage = GetString("Item.Area.AddUser"); 728 string loginPage = GetString("Item.Area.Login"); 729 } 730 <form id="masterExtUserForm" class="col-xs-12 DMForms userRelatedForms hidden" action="/Default.aspx?ID=@Pageview.Page.ID" method="post"> 731 <fieldset class="mandatory TextInput"> 732 <label for="Username">@Translate("usernameEmail", "Username / Email")</label> 733 <input type="email" id="Username" name="username" value="" tabindex="1"> 734 </fieldset> 735 <fieldset class="mandatory TextInput"> 736 <label for="Password">@Translate("password", "Password")</label> 737 <input autocomplete="off" type="password" id="Password" name="password" value="" tabindex="2"> 738 </fieldset> 739 740 <div class="col-xs-12 noPadding"> 741 <input tabindex="3" class="btn btn-bg" name="LoginAction" type="submit" value='@Translate("Login", "Login")'> 742 </div> 743 <div class="forgotButtons col-xs-12 noPadding"> 744 <span class="title">@Translate("currentCustomer", "Current Customer?")</span> 745 <a id="forgotPassword" href="@loginPage&amp;LoginAction=Recovery">@Translate("forgotYourPassword", "Forgot your password?")</a> 746 <a href="@addUserPage">@Translate("addUserToExistingAccount", "Add new user to an existing PBi account")</a> 747 </div> 748 <div id="dontHaveAnAccount" class="col-xs-12 noPadding"> 749 <span class="title">@Translate("newCustomer", "New Customer?")</span> 750 <a href="@createAccountPage">@Translate("createAccount", "Create account")</a> 751 </div> 752 </form> 753 @SnippetEnd("loginForm")