Error executing template "Designs/Rapido/_parsed/Page.parsed.cshtml"
System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
   at System.ThrowHelper.ThrowKeyNotFoundException()
   at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
   at Dynamicweb.Frontend.UrlProviders.Handler.GetUrlFromQueryString(String queryStringParameter, String parameterValue, String alternateKey)
   at Dynamicweb.Frontend.UrlProviders.Handler.HandleModuleUrl(String& url, String& querystring, String alternatekey)
   at Dynamicweb.Frontend.SearchEngineFriendlyURLs.ResolveQueryString(String fullQueryString, Int32 pageid, String alternatekey)
   at Dynamicweb.Ecommerce.Frontend.NavigationProviders.GroupNavigationProvider.SetHref(GroupNavigationItem groupItem, Group group, Page productPage)
   at Dynamicweb.Ecommerce.Frontend.NavigationProviders.GroupNavigationProvider.MakeGroupTree(GroupCollection groups, Page page, NavigationItem parentNode, Int32 thisLevel, Int32 maxLevel, Page productPage)
   at Dynamicweb.Ecommerce.Frontend.NavigationProviders.GroupNavigationProvider.MakeGroupTree(Page page, NavigationItem parentNode)
   at Dynamicweb.Ecommerce.Frontend.NavigationProviders.GroupNavigationProvider.Process(NavigationItem node)
   at Dynamicweb.Ecommerce.Frontend.NavigationProviders.GroupNavigationProvider.ProcessTree(RootNavigationItem rootNode, NavigationType navigationType)
   at Dynamicweb.Frontend.XmlNavigation.MakeXml(Int32 parentId, Int32 levelStart, Int32 levelStop, Expand expand, Int32 selectedAreaId)
   at Dynamicweb.Frontend.XmlNavigation.GetNavigationHtml(Int32 parentId, Int32 levelStart, Int32 levelStop, Expand expand, String name, String xsltPath, Int32 selectedAreaId, Boolean sitemapMode, NameValueCollection settings, NameValueCollection attributes, IncludeMode mode)
   at Dynamicweb.Frontend.XmlNavigation.GetNavigationHtml(NameValueCollection settings, NameValueCollection attributes)
   at Dynamicweb.Rendering.TemplateBase`1.RenderNavigation(Object settings)
   at CompiledRazorTemplates.Dynamic.RazorEngine_7fb037df4e7f4065a780028feae22ed1.b__91_0(TextWriter __razor_helper_writer) in D:\dynamicweb.net\Solutions\Nextech\superhome.cloud.dynamicweb-cms.com\Files\Templates\Designs\Rapido\_parsed\Page.parsed.cshtml:line 4036
   at CompiledRazorTemplates.Dynamic.RazorEngine_7fb037df4e7f4065a780028feae22ed1.<>c__DisplayClass3_0.b__0(TextWriter __razor_helper_writer) in D:\dynamicweb.net\Solutions\Nextech\superhome.cloud.dynamicweb-cms.com\Files\Templates\Designs\Rapido\_parsed\Page.parsed.cshtml:line 225
   at CompiledRazorTemplates.Dynamic.RazorEngine_7fb037df4e7f4065a780028feae22ed1.<>c__DisplayClass2_0.b__0(TextWriter __razor_helper_writer) in D:\dynamicweb.net\Solutions\Nextech\superhome.cloud.dynamicweb-cms.com\Files\Templates\Designs\Rapido\_parsed\Page.parsed.cshtml:line 165
   at CompiledRazorTemplates.Dynamic.RazorEngine_7fb037df4e7f4065a780028feae22ed1.b__115_0(TextWriter __razor_helper_writer) in D:\dynamicweb.net\Solutions\Nextech\superhome.cloud.dynamicweb-cms.com\Files\Templates\Designs\Rapido\_parsed\Page.parsed.cshtml:line 5226
   at CompiledRazorTemplates.Dynamic.RazorEngine_7fb037df4e7f4065a780028feae22ed1.<>c__DisplayClass3_0.b__0(TextWriter __razor_helper_writer) in D:\dynamicweb.net\Solutions\Nextech\superhome.cloud.dynamicweb-cms.com\Files\Templates\Designs\Rapido\_parsed\Page.parsed.cshtml:line 225
   at CompiledRazorTemplates.Dynamic.RazorEngine_7fb037df4e7f4065a780028feae22ed1.<>c__DisplayClass2_0.b__0(TextWriter __razor_helper_writer) in D:\dynamicweb.net\Solutions\Nextech\superhome.cloud.dynamicweb-cms.com\Files\Templates\Designs\Rapido\_parsed\Page.parsed.cshtml:line 137
   at CompiledRazorTemplates.Dynamic.RazorEngine_7fb037df4e7f4065a780028feae22ed1.b__145_0(TextWriter __razor_helper_writer) in D:\dynamicweb.net\Solutions\Nextech\superhome.cloud.dynamicweb-cms.com\Files\Templates\Designs\Rapido\_parsed\Page.parsed.cshtml:line 6463
   at CompiledRazorTemplates.Dynamic.RazorEngine_7fb037df4e7f4065a780028feae22ed1.<>c__DisplayClass3_0.b__0(TextWriter __razor_helper_writer) in D:\dynamicweb.net\Solutions\Nextech\superhome.cloud.dynamicweb-cms.com\Files\Templates\Designs\Rapido\_parsed\Page.parsed.cshtml:line 225
   at CompiledRazorTemplates.Dynamic.RazorEngine_7fb037df4e7f4065a780028feae22ed1.<>c__DisplayClass2_0.b__0(TextWriter __razor_helper_writer) in D:\dynamicweb.net\Solutions\Nextech\superhome.cloud.dynamicweb-cms.com\Files\Templates\Designs\Rapido\_parsed\Page.parsed.cshtml:line 137
   at CompiledRazorTemplates.Dynamic.RazorEngine_7fb037df4e7f4065a780028feae22ed1.b__146_0(TextWriter __razor_helper_writer) in D:\dynamicweb.net\Solutions\Nextech\superhome.cloud.dynamicweb-cms.com\Files\Templates\Designs\Rapido\_parsed\Page.parsed.cshtml:line 6472
   at CompiledRazorTemplates.Dynamic.RazorEngine_7fb037df4e7f4065a780028feae22ed1.<>c__DisplayClass3_0.b__0(TextWriter __razor_helper_writer) in D:\dynamicweb.net\Solutions\Nextech\superhome.cloud.dynamicweb-cms.com\Files\Templates\Designs\Rapido\_parsed\Page.parsed.cshtml:line 225
   at CompiledRazorTemplates.Dynamic.RazorEngine_7fb037df4e7f4065a780028feae22ed1.<>c__DisplayClass2_0.b__0(TextWriter __razor_helper_writer) in D:\dynamicweb.net\Solutions\Nextech\superhome.cloud.dynamicweb-cms.com\Files\Templates\Designs\Rapido\_parsed\Page.parsed.cshtml:line 137
   at CompiledRazorTemplates.Dynamic.RazorEngine_7fb037df4e7f4065a780028feae22ed1.<>c__DisplayClass3_0.b__0(TextWriter __razor_helper_writer) in D:\dynamicweb.net\Solutions\Nextech\superhome.cloud.dynamicweb-cms.com\Files\Templates\Designs\Rapido\_parsed\Page.parsed.cshtml:line 245
   at CompiledRazorTemplates.Dynamic.RazorEngine_7fb037df4e7f4065a780028feae22ed1.<>c__DisplayClass2_0.b__0(TextWriter __razor_helper_writer) in D:\dynamicweb.net\Solutions\Nextech\superhome.cloud.dynamicweb-cms.com\Files\Templates\Designs\Rapido\_parsed\Page.parsed.cshtml:line 137
   at CompiledRazorTemplates.Dynamic.RazorEngine_7fb037df4e7f4065a780028feae22ed1.Execute() in D:\dynamicweb.net\Solutions\Nextech\superhome.cloud.dynamicweb-cms.com\Files\Templates\Designs\Rapido\_parsed\Page.parsed.cshtml:line 6453
   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.b__0(TextWriter writer)
   at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
   at Dynamicweb.Rendering.Template.RenderRazorTemplate()

1 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 2 3 @using System.Web; 4 @using Dynamicweb.Frontend 5 @using Dynamicweb.Frontend.Devices 6 @using Dynamicweb.Extensibility 7 @using Dynamicweb.Content 8 @using Dynamicweb.Security 9 @using Dynamicweb.Core 10 @using System 11 @using System.Web 12 @using System.IO 13 @using Dynamicweb.Rapido.Blocks 14 @using System.Net 15 16 17 18 @functions { 19 BlocksPage masterPage = BlocksPage.GetBlockPage("Master"); 20 21 string getFontFamily(params string[] items) 22 { 23 var itemParent = Pageview.AreaSettings; 24 foreach (var item in items) 25 { 26 itemParent = itemParent.GetItem(item); 27 if (itemParent == null) 28 { 29 return null; 30 } 31 } 32 33 var googleFont = itemParent.GetGoogleFont("FontFamily"); 34 if (googleFont == null) 35 { 36 return null; 37 } 38 return googleFont.Family.Replace(" ", "+"); 39 } 40 } 41 42 @{ 43 //Font settings 44 var fonts = new string[] { 45 getFontFamily("Layout", "HeaderFont"), 46 getFontFamily("Layout", "SubheaderFont"), 47 getFontFamily("Layout", "TertiaryHeaderFont"), 48 getFontFamily("Layout", "Header", "ToolsFont"), 49 getFontFamily("Layout", "Header", "NavigationFont"), 50 getFontFamily("Layout", "MobileNavigation", "Font"), 51 getFontFamily("ProductList", "Facets", "HeaderFont"), 52 getFontFamily("ProductPage", "PriceFontDesign"), 53 getFontFamily("Ecommerce", "SaleSticker", "Font"), 54 getFontFamily("Ecommerce", "NewSticker", "Font"), 55 getFontFamily("Ecommerce", "CustomSticker", "Font") 56 }; 57 58 string autoCssLink = "/Files/Templates/Designs/Rapido/css/rapido/rapido_" + Model.Area.ID.ToString() + ".min.css?ticks=" + Model.Area.UpdatedDate.Ticks; 59 string favicon = Model.Area.Item.GetItem("Layout").GetFile("LogoFavicon") != null ? Model.Area.Item.GetItem("Layout").GetFile("LogoFavicon").Path : "/Files/Images/favicon.png"; 60 bool useFontAwesomePro = Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetBoolean("UseFontAwesomePro"); 61 string fontAwesomeCssLink = "/Files/Templates/Designs/Rapido/css/fonts/FontAwesomeFree/css/fontawesome-all.min.css"; 62 if (useFontAwesomePro) 63 { 64 fontAwesomeCssLink = "/Files/Templates/Designs/Rapido/css/fonts/FontAwesomePro/css/fontawesome-all.min.css"; 65 } 66 } 67 68 @{ 69 Block master = new Block() 70 { 71 Id = "Master", 72 BlocksList = new List<Block> { 73 new Block { 74 Id = "MasterTopSnippets", 75 SortId = 10 76 }, 77 new Block { 78 Id = "MasterMain", 79 SortId = 20, 80 Template = RenderMain(), 81 SkipRenderBlocksList = true, 82 BlocksList = new List<Block> { 83 new Block { 84 Id = "MasterHeader", 85 SortId = 10, 86 Template = RenderMasterHeader(), 87 SkipRenderBlocksList = true 88 }, 89 new Block { 90 Id = "MasterPageContent", 91 SortId = 20, 92 Template = RenderPageContent() 93 } 94 } 95 }, 96 new Block { 97 Id = "MasterFooter", 98 SortId = 30 99 }, 100 new Block { 101 Id = "MasterReferences", 102 SortId = 40 103 }, 104 new Block { 105 Id = "MasterBottomSnippets", 106 SortId = 50 107 } 108 } 109 }; 110 111 masterPage.Add(master); 112 } 113 114 @* Include the required Grid builder (Contains the methods @RenderBlockList and @RenderBlock) *@ 115 @using System.Text.RegularExpressions 116 @using System.Collections.Generic 117 @using System.Reflection 118 @using System.Web.UI.HtmlControls 119 @using Dynamicweb.Rapido.Blocks.Components 120 @using Dynamicweb.Rapido.Blocks.Components.Articles 121 @using Dynamicweb.Rapido.Blocks.Components.Documentation 122 @using Dynamicweb.Rapido.Blocks 123 124 125 @*--- START: Base block renderers ---*@ 126 127 @helper RenderBlockList(List<Block> blocks) 128 { 129 blocks = blocks.OrderBy(item => item.SortId).ToList(); 130 131 foreach (Block item in blocks) 132 { 133 <!-- START: @item.Id --> 134 135 if (item.Design == null) 136 { 137 @RenderBlock(item) 138 } 139 else if (item.Design.RenderType == RenderType.None) { 140 string cssClass = item.Design.CssClass != null ? item.Design.CssClass : ""; 141 142 <div class="@cssClass dw-mod"> 143 @RenderBlock(item) 144 </div> 145 } 146 else if (item.Design.RenderType != RenderType.Hide) 147 { 148 string cssClass = item.Design.CssClass != null ? item.Design.CssClass : ""; 149 150 if (!item.SkipRenderBlocksList) { 151 if (item.Design.RenderType == RenderType.Row) 152 { 153 <div class="grid grid--align-content-start @cssClass dw-mod" id="Block__@item.Id"> 154 @RenderBlock(item) 155 </div> 156 } 157 158 if (item.Design.RenderType == RenderType.Column) 159 { 160 string hidePadding = item.Design.HidePadding ? "u-no-padding" : ""; 161 string size = item.Design.Size ?? "12"; 162 size = Regex.IsMatch(size, @"\d") ? "md-" + item.Design.Size : item.Design.Size; 163 164 <div class="grid__col-lg-@item.Design.Size grid__col-md-@item.Design.Size grid__col-sm-12 grid__col-xs-12 @hidePadding @cssClass dw-mod" id="Block__@item.Id"> 165 @RenderBlock(item) 166 </div> 167 } 168 169 if (item.Design.RenderType == RenderType.Table) 170 { 171 <table class="table @cssClass dw-mod" id="Block__@item.Id"> 172 @RenderBlock(item) 173 </table> 174 } 175 176 if (item.Design.RenderType == RenderType.TableRow) 177 { 178 <tr class="@cssClass dw-mod" id="Block__@item.Id"> 179 @RenderBlock(item) 180 </tr> 181 } 182 183 if (item.Design.RenderType == RenderType.TableColumn) 184 { 185 <td class="@cssClass dw-mod" id="Block__@item.Id"> 186 @RenderBlock(item) 187 </td> 188 } 189 190 if (item.Design.RenderType == RenderType.CardHeader) 191 { 192 <div class="card-header @cssClass dw-mod"> 193 @RenderBlock(item) 194 </div> 195 } 196 197 if (item.Design.RenderType == RenderType.CardBody) 198 { 199 <div class="card @cssClass dw-mod"> 200 @RenderBlock(item) 201 </div> 202 } 203 204 if (item.Design.RenderType == RenderType.CardFooter) 205 { 206 <div class="card-footer @cssClass dw-mod"> 207 @RenderBlock(item) 208 </div> 209 } 210 } 211 else 212 { 213 @RenderBlock(item) 214 } 215 } 216 217 <!-- END: @item.Id --> 218 } 219 } 220 221 @helper RenderBlock(Block item) 222 { 223 if (item.Template != null) 224 { 225 @BlocksPage.RenderTemplate(item.Template) 226 } 227 228 if (item.Component != null) 229 { 230 string methodName = item.Component.HelperName; 231 dynamic[] methodParameters = new dynamic[1]; 232 methodParameters[0] = item.Component; 233 Type methodType = this.GetType(); 234 MethodInfo generalMethod = methodType.GetMethod(methodName); 235 236 if (generalMethod != null) { 237 @generalMethod.Invoke(this, methodParameters).ToString(); 238 } else { 239 throw new Exception(item.Component.GetType().Name + " method '" + methodName +"' could not be invoked"); 240 } 241 } 242 243 if (item.BlocksList.Count > 0 && !item.SkipRenderBlocksList) 244 { 245 @RenderBlockList(item.BlocksList) 246 } 247 } 248 249 @*--- END: Base block renderers ---*@ 250 251 252 @* Include the components *@ 253 @using Dynamicweb.Rapido.Blocks.Components 254 @using Dynamicweb.Rapido.Blocks.Components.General 255 @using Dynamicweb.Rapido.Blocks 256 257 258 @* Components *@ 259 @using System.Reflection 260 @using Dynamicweb.Rapido.Blocks.Components.General 261 262 263 @* Component *@ 264 265 @helper RenderIcon(Icon settings) { 266 if (settings != null) 267 { 268 dynamic[] methodParameters = new dynamic[1]; 269 methodParameters[0] = settings; 270 MethodInfo customMethod = this.GetType().GetMethod("RenderIconCustom"); 271 272 if (customMethod != null) 273 { 274 @customMethod.Invoke(this, methodParameters).ToString(); 275 } else { 276 string color = settings.Color != null ? "style=\"color: " + settings.Color + "\"" : ""; 277 278 if (settings.Name != null) 279 { 280 if (String.IsNullOrEmpty(settings.Label)) { 281 <i class="@settings.Prefix @settings.Name @settings.CssClass" @color></i> 282 } else { 283 if (settings.LabelPosition == IconLabelPosition.Before) { 284 <span>@settings.Label <i class="@settings.Prefix @settings.Name @settings.CssClass" @color></i></span> 285 } else { 286 <span><i class="@settings.Prefix @settings.Name @settings.CssClass" @color></i> @settings.Label</span> 287 } 288 } 289 } 290 } 291 } 292 } 293 @using System.Reflection 294 @using Dynamicweb.Rapido.Blocks.Components.General 295 @using Dynamicweb.Rapido.Blocks.Components 296 297 298 @* Component *@ 299 300 @helper RenderButton(Button settings) { 301 dynamic[] methodParameters = new dynamic[1]; 302 methodParameters[0] = settings; 303 MethodInfo customMethod = this.GetType().GetMethod("RenderButtonCustom"); 304 305 if (customMethod != null) 306 { 307 @customMethod.Invoke(this, methodParameters).ToString(); 308 } 309 else 310 { 311 string target; 312 string disabled = settings.Disabled ? "disabled" : ""; 313 string buttonType = settings.ButtonType == ButtonType.Submit ? "submit" : "button"; 314 buttonType = settings.ButtonType == ButtonType.Reset ? "reset" : buttonType; 315 string buttonLayout = settings.ButtonLayout.ToString().ToLower(); 316 317 switch (settings.Target) 318 { 319 case LinkTargetType.Blank: 320 target = "_blank"; 321 break; 322 case LinkTargetType.Parent: 323 target = "_parent"; 324 break; 325 case LinkTargetType.Self: 326 target = "_self"; 327 break; 328 case LinkTargetType.Top: 329 target = "_top"; 330 break; 331 default: 332 target = "_self"; 333 break; 334 } 335 336 string onClickAction = settings.OnClick != null ? settings.OnClick : ""; 337 string noOpener = target == "_blank" ? "rel=\"noopener\"" : ""; 338 339 if (!String.IsNullOrEmpty(settings.ConfirmText)) 340 { 341 string modalId = settings.Id; 342 @RenderConfirmDialog(settings); 343 onClickAction = "document.getElementById('" + modalId + "ModalTrigger').checked = true"; 344 } 345 346 if (settings.Icon != null) 347 { 348 if (settings.IconPosition == null) { 349 settings.Icon.LabelPosition = IconLabelPosition.After; 350 } else { 351 settings.Icon.LabelPosition = settings.IconPosition == IconPosition.Before ? IconLabelPosition.After : IconLabelPosition.Before; 352 } 353 if (settings.Icon.Label == null) { 354 settings.Icon.Label = settings.Title; 355 } 356 } 357 string content = settings.Icon == null ? settings.Title : Convert.ToString(RenderIcon(settings.Icon)); 358 359 if (!String.IsNullOrEmpty(settings.Link) && String.IsNullOrEmpty(settings.ConfirmText)) 360 { 361 <a href="@settings.Link" target="@target" @noOpener class="btn btn--@buttonLayout @settings.CssClass @disabled dw-mod" onclick="@onClickAction" @ComponentMethods.AddAttributes(settings.ExtraAttributes) @disabled>@content</a> 362 } 363 else 364 { 365 <button type="@buttonType" class="btn btn--@buttonLayout @settings.CssClass @disabled dw-mod" onclick="@onClickAction" @ComponentMethods.AddAttributes(settings.ExtraAttributes) @disabled>@content</button> 366 } 367 } 368 } 369 370 371 @helper RenderConfirmDialog(Button settings) { 372 dynamic[] methodParameters = new dynamic[1]; 373 methodParameters[0] = settings; 374 MethodInfo customMethod = this.GetType().GetMethod("RenderConfirmDialogCustom"); 375 376 if (customMethod != null) 377 { 378 @customMethod.Invoke(this, methodParameters).ToString(); 379 } else { 380 string modalTriggerId = settings.Id + "ModalTrigger"; 381 382 <!-- Trigger for the confirm modal --> 383 <input type="checkbox" id="@modalTriggerId" class="modal-trigger" /> 384 385 <!-- Login modal --> 386 <div class="modal-container"> 387 <label for="@modalTriggerId" class="modal-overlay"></label> 388 <div class="modal modal--xs"> 389 <div class="modal__header"> 390 <h2>@settings.ConfirmText</h2> 391 </div> 392 <div class="modal__body"> 393 @RenderButton(new Button { Title = Translate("OK"), ButtonLayout = ButtonLayout.Primary, OnClick = settings.OnClick, CssClass = "u-full-width", Link = settings.Link }) 394 </div> 395 </div> 396 </div> 397 } 398 } 399 @using System.Reflection 400 @using Dynamicweb.Rapido.Blocks.Components 401 @using Dynamicweb.Rapido.Blocks.Components.General 402 @using Dynamicweb.Rapido.Blocks 403 404 405 @* Component *@ 406 407 @helper RenderRating(Rating settings) 408 { 409 dynamic[] methodParameters = new dynamic[1]; 410 methodParameters[0] = settings; 411 MethodInfo customMethod = this.GetType().GetMethod("RenderRatingCustom"); 412 413 if (customMethod != null) 414 { 415 @customMethod.Invoke(this, methodParameters).ToString(); 416 } else { 417 if (settings.Score > 0) 418 { 419 int rating = settings.Score; 420 string iconType = "fa-star"; 421 422 switch (settings.Type.ToString()) { 423 case "Stars": 424 iconType = "fa-star"; 425 break; 426 case "Hearts": 427 iconType = "fa-heart"; 428 break; 429 case "Lemons": 430 iconType = "fa-lemon"; 431 break; 432 case "Bombs": 433 iconType = "fa-bomb"; 434 break; 435 } 436 437 <div class="u-ta-right"> 438 @for (int i = 0; i < settings.OutOf; i++) 439 { 440 <i class="@(rating > i ? "fas" : "far") @iconType"></i> 441 } 442 </div> 443 } 444 } 445 } 446 @using System.Reflection 447 @using Dynamicweb.Rapido.Blocks.Components.General 448 @using Dynamicweb.Rapido.Blocks.Components 449 450 451 @* Component *@ 452 453 @helper RenderFieldListOption(FieldListOption settings) { 454 dynamic[] methodParameters = new dynamic[1]; 455 methodParameters[0] = settings; 456 MethodInfo customMethod = this.GetType().GetMethod("RenderFieldListOptionCustom"); 457 458 if (customMethod != null) 459 { 460 @customMethod.Invoke(this, methodParameters).ToString(); 461 } else { 462 string disabled = settings.Disabled ? "disabled" : ""; 463 string selected = settings.Checked ? "checked" : ""; 464 465 if (settings.Type.ToString() == "RadioButton") 466 { 467 <input class="form__control @disabled dw-mod" onchange="@settings.OnChange" onclick="@settings.OnClick" type="radio" name="@settings.Name" id="@settings.Id" value="@settings.Value" @selected @disabled @ComponentMethods.AddAttributes(settings.ExtraAttributes) /> 468 <label for="@settings.Id" class="u-inline @disabled dw-mod">@settings.Label</label> 469 @RenderNotificationMessage(new NotificationMessage { Message = settings.ErrorMessage }) 470 } 471 472 if (settings.Type.ToString() == "Checkbox") 473 { 474 @RenderCheckboxField(settings) 475 } 476 477 if (settings.Type.ToString() == "SelectOption") 478 { 479 <option value="@settings.Value" id="@settings.Id" onclick="@settings.OnClick" class="@disabled" @disabled @selected @ComponentMethods.AddAttributes(settings.ExtraAttributes) >@settings.Name</option> 480 @RenderNotificationMessage(new NotificationMessage { Message = settings.ErrorMessage }) 481 } 482 } 483 } 484 485 @using System.Reflection 486 @using Dynamicweb.Rapido.Blocks.Components.General 487 @using Dynamicweb.Rapido.Blocks.Components 488 489 490 @* Component *@ 491 492 @helper RenderNavigation(Navigation settings) { 493 dynamic[] methodParameters = new dynamic[1]; 494 methodParameters[0] = settings; 495 MethodInfo customMethod = this.GetType().GetMethod("RenderNavigationCustom"); 496 497 if (customMethod != null) 498 { 499 @customMethod.Invoke(this, methodParameters).ToString(); 500 } else { 501 @RenderNavigation(new 502 { 503 id = settings.Id, 504 cssclass = settings.CssClass, 505 startLevel = settings.StartLevel, 506 endlevel = settings.EndLevel, 507 expandmode = settings.Expandmode, 508 template = settings.Template 509 }) 510 } 511 } 512 @using System.Reflection 513 @using Dynamicweb.Rapido.Blocks.Components.General 514 @using Dynamicweb.Rapido.Blocks.Components 515 516 517 @* Component *@ 518 519 @helper RenderBreadcrumbNavigation(BreadcrumbNavigation settings) { 520 dynamic[] methodParameters = new dynamic[1]; 521 methodParameters[0] = settings; 522 MethodInfo customMethod = this.GetType().GetMethod("RenderBreadcrumbNavigationCustom"); 523 524 if (customMethod != null) 525 { 526 @customMethod.Invoke(this, methodParameters).ToString(); 527 } else { 528 settings.Id = String.IsNullOrEmpty(settings.Id) ? "breadcrumb" : settings.Id; 529 settings.Template = String.IsNullOrEmpty(settings.Template) ? "Breadcrumb.xslt" : settings.Template; 530 settings.StartLevel = settings.StartLevel == 0 ? 1 : settings.StartLevel; 531 settings.EndLevel = settings.EndLevel == 10 ? 1 : settings.EndLevel; 532 settings.Expandmode = String.IsNullOrEmpty(settings.Expandmode) ? "all" : settings.Expandmode; 533 534 @RenderNavigation(settings) 535 } 536 } 537 @using System.Reflection 538 @using Dynamicweb.Rapido.Blocks.Components.General 539 540 541 @* Component *@ 542 543 @helper RenderHeading(Heading settings) { 544 dynamic[] methodParameters = new dynamic[1]; 545 methodParameters[0] = settings; 546 MethodInfo customMethod = this.GetType().GetMethod("RenderHeadingCustom"); 547 548 if (customMethod != null) 549 { 550 @customMethod.Invoke(this, methodParameters).ToString(); 551 } else { 552 string startTag = "<h" + settings.Level.ToString() + " class=\"" + settings.CssClass + "\">"; 553 string endTag = "</h" + settings.Level.ToString() + "\">"; 554 555 if (settings.Icon != null) 556 { 557 if (settings.IconPosition == null) { 558 settings.Icon.LabelPosition = IconLabelPosition.After; 559 } else { 560 settings.Icon.LabelPosition = settings.IconPosition == IconPosition.Before ? IconLabelPosition.After : IconLabelPosition.Before; 561 } 562 if (settings.Icon.Label == null) { 563 settings.Icon.Label = settings.Title; 564 } 565 566 @startTag@RenderIcon(settings.Icon)@endTag 567 } else { 568 @startTag@settings.Title@endTag 569 } 570 } 571 } 572 @using System.Reflection 573 @using Dynamicweb.Rapido.Blocks.Components 574 @using Dynamicweb.Rapido.Blocks.Components.General 575 @using Dynamicweb.Rapido.Blocks 576 577 578 @* Component *@ 579 580 @helper RenderImage(Image settings) 581 { 582 if (settings.Path != null) 583 { 584 dynamic[] methodParameters = new dynamic[1]; 585 methodParameters[0] = settings; 586 MethodInfo customMethod = this.GetType().GetMethod("RenderImageCustom"); 587 588 if (customMethod != null) 589 { 590 @customMethod.Invoke(this, methodParameters).ToString(); 591 } else { 592 <div> 593 @if (settings.Link != null) 594 { 595 <a href="@settings.Link"> 596 @RenderTheImage(settings); 597 </a> 598 } 599 else 600 { 601 @RenderTheImage(settings); 602 } 603 </div> 604 } 605 } 606 } 607 608 @functions { 609 string getImagePathFromSettings(ImageSettings settings) 610 { 611 string result = ""; 612 613 if (settings != null) 614 { 615 result += settings.Width != 0 ? "Width=" + settings.Width + "&" : ""; 616 result += settings.Height != 0 ? "Height=" + settings.Height + "&" : ""; 617 result += "Crop=" + settings.Crop + "&"; 618 result += "Compression=" + settings.Compression + "&"; 619 result += "DoNotUpscale=" + settings.DoNotUpscale.ToString() + "&"; 620 result += "FillCanvas=" + settings.FillCanvas.ToString() + "&"; 621 } 622 623 return result; 624 } 625 } 626 627 @helper RenderTheImage(Image settings) 628 { 629 if (settings != null) 630 { 631 dynamic[] methodParameters = new dynamic[1]; 632 methodParameters[0] = settings; 633 MethodInfo customMethod = this.GetType().GetMethod("RenderTheImageCustom"); 634 635 if (customMethod != null) 636 { 637 @customMethod.Invoke(this, methodParameters).ToString(); 638 } else { 639 string placeholderImage = "/Files/Images/placeholder.gif"; 640 string imageEngine = "/Admin/Public/GetImage.ashx?"; 641 642 string imageStyle = ""; 643 644 switch (settings.Style) 645 { 646 case ImageStyle.Ball: 647 imageStyle = "grid__cell-img--ball"; 648 break; 649 } 650 651 if (settings.Style == ImageStyle.Ball || settings.Style == ImageStyle.Circle) 652 { 653 if (settings.ImageDefault != null) 654 { 655 settings.ImageDefault.Height = settings.ImageDefault.Width; 656 } 657 if (settings.ImageMedium != null) 658 { 659 settings.ImageMedium.Height = settings.ImageMedium.Width; 660 } 661 if (settings.ImageSmall != null) 662 { 663 settings.ImageSmall.Height = settings.ImageSmall.Width; 664 } 665 } 666 667 string defaultImage = imageEngine; 668 string imageSmall = ""; 669 string imageMedium = ""; 670 671 if (settings.DisableImageEngine) { 672 defaultImage = settings.Path; 673 } else { 674 if (settings.ImageDefault != null) 675 { 676 defaultImage += getImagePathFromSettings(settings.ImageDefault); 677 678 if (settings.Path.GetType() != typeof(string)) 679 { 680 defaultImage += settings.Path != null ? "Image=" + settings.Path.PathUrlEncoded : ""; 681 defaultImage += settings.Path != null ? "&" + settings.Path.GetFocalPointParameters() : ""; 682 } 683 else 684 { 685 defaultImage += settings.Path != null ? "Image=" + settings.Path : ""; 686 } 687 } 688 689 if (settings.ImageSmall != null) 690 { 691 imageSmall = "data-src-small=\"" + imageEngine; 692 imageSmall += getImagePathFromSettings(settings.ImageSmall); 693 694 if (settings.Path.GetType() != typeof(string)) 695 { 696 imageSmall += settings.Path != null ? "Image=" + settings.Path.PathUrlEncoded : ""; 697 imageSmall += settings.Path != null ? "&" + settings.Path.GetFocalPointParameters() : ""; 698 } 699 else 700 { 701 imageSmall += settings.Path != null ? "Image=" + settings.Path : ""; 702 } 703 704 imageSmall += "\""; 705 } 706 707 if (settings.ImageMedium != null) 708 { 709 imageMedium = "data-src-medium=\"" + imageEngine; 710 imageMedium += getImagePathFromSettings(settings.ImageMedium); 711 712 if (settings.Path.GetType() != typeof(string)) 713 { 714 imageMedium += settings.Path != null ? "Image=" + settings.Path.PathUrlEncoded : ""; 715 imageMedium += settings.Path != null ? "&" + settings.Path.GetFocalPointParameters() : ""; 716 } 717 else 718 { 719 imageMedium += settings.Path != null ? "Image=" + settings.Path : ""; 720 } 721 722 imageMedium += "\""; 723 } 724 } 725 726 Dictionary<String, String> optionalAttributes = new Dictionary<string, string>(); 727 if (!String.IsNullOrEmpty(settings.OnClick)) { optionalAttributes.Add("onclick", settings.OnClick); } 728 if (!String.IsNullOrEmpty(settings.Title)) { optionalAttributes.Add("alt", settings.Title); } 729 730 if (settings.DisableLazyLoad) { 731 <img class="grid__cell-img @imageStyle @settings.CssClass dw-mod" src="@defaultImage" @ComponentMethods.AddAttributes(optionalAttributes) @ComponentMethods.AddAttributes(settings.ExtraAttributes) /> 732 } else { 733 <!--CS NT <img class="grid__cell-img b-lazy @imageStyle @settings.CssClass dw-mod" src="@placeholderImage" data-src="@defaultImage" @imageSmall @imageMedium @ComponentMethods.AddAttributes(optionalAttributes) @ComponentMethods.AddAttributes(settings.ExtraAttributes) />--> 734 <img class="grid__cell-img @imageStyle @settings.CssClass dw-mod" src="@defaultImage" /> 735 } 736 737 if (settings.Caption != null) 738 { 739 <span class="image-caption dw-mod">@settings.Caption</span> 740 } 741 } 742 } 743 } 744 @using System.Reflection 745 @using Dynamicweb.Rapido.Blocks.Components.General 746 @using Dynamicweb.Rapido.Blocks.Components 747 748 749 @* Component *@ 750 751 @helper RenderTextField(TextField settings) { 752 dynamic[] methodParameters = new dynamic[1]; 753 methodParameters[0] = settings; 754 MethodInfo customMethod = this.GetType().GetMethod("RenderTextFieldCustom"); 755 756 if (customMethod != null) 757 { 758 @customMethod.Invoke(this, methodParameters).ToString(); 759 } else { 760 int maxLength = settings.MaxLength != 0 ? settings.MaxLength : 524288; 761 Dictionary<String, String> optionalAttributes = new Dictionary<string, string>(); 762 if (settings.Type == TextFieldType.Password) { optionalAttributes.Add("autocomplete", "off"); }; 763 if (!String.IsNullOrEmpty(settings.OnClick)) { optionalAttributes.Add("onclick", settings.OnClick.ToString()); } 764 if (!String.IsNullOrEmpty(settings.Placeholder)) { optionalAttributes.Add("placeholder", settings.Placeholder); } 765 if (settings.Disabled) { optionalAttributes.Add("disabled", settings.Disabled.ToString()); } 766 if (settings.Required) { optionalAttributes.Add("required", settings.Required.ToString()); } 767 if (settings.MaxLength != 0) { optionalAttributes.Add("maxlength", settings.MaxLength.ToString()); } 768 769 <div class="form__field-group dw-mod"> 770 @if (!String.IsNullOrEmpty(settings.Label)) 771 { 772 <label for="@settings.Id">@settings.Label</label> 773 } 774 775 <input type="@settings.Type" class="u-full-width @settings.CssClass dw-mod" name="@settings.Id" id="@(settings.Id)" value="@settings.Value" @ComponentMethods.AddAttributes(optionalAttributes) @ComponentMethods.AddAttributes(settings.ExtraAttributes) /> 776 777 @RenderNotificationMessage(new NotificationMessage { Message = settings.ErrorMessage }) 778 </div> 779 } 780 } 781 @using System.Reflection 782 @using Dynamicweb.Rapido.Blocks.Components.General 783 @using Dynamicweb.Rapido.Blocks.Components 784 785 786 @* Component *@ 787 788 @helper RenderNumberField(NumberField settings) { 789 dynamic[] methodParameters = new dynamic[1]; 790 methodParameters[0] = settings; 791 MethodInfo customMethod = this.GetType().GetMethod("RenderNumberFieldCustom"); 792 793 if (customMethod != null) 794 { 795 @customMethod.Invoke(this, methodParameters).ToString(); 796 } else { 797 Dictionary<String, String> optionalAttributes = new Dictionary<string, string>(); 798 if (!String.IsNullOrEmpty(settings.OnClick)) { optionalAttributes.Add("onclick", settings.OnClick.ToString()); } 799 if (settings.Disabled) { optionalAttributes.Add("disabled", settings.Disabled.ToString()); } 800 if (settings.Required) { optionalAttributes.Add("required", settings.Required.ToString()); } 801 if (settings.Max != 0) { optionalAttributes.Add("max", settings.Max.ToString()); } 802 if (settings.Min != 0) { optionalAttributes.Add("min", settings.Min.ToString()); } 803 if (settings.Step != 0) { optionalAttributes.Add("step", settings.Step.ToString()); } 804 805 <div class="form__field-group dw-mod"> 806 @if (!String.IsNullOrEmpty(settings.Label)) 807 { 808 <div> 809 <label for="@settings.Id">@settings.Label</label> 810 </div> 811 } 812 813 <input type="Number" class="u-w70px @settings.CssClass dw-mod" name="@settings.Id" id="@(settings.Id)" value="@settings.Value" @ComponentMethods.AddAttributes(optionalAttributes) @ComponentMethods.AddAttributes(settings.ExtraAttributes) /> 814 815 @RenderNotificationMessage(new NotificationMessage { Message = settings.ErrorMessage }) 816 </div> 817 } 818 } 819 @using System.Reflection 820 @using Dynamicweb.Rapido.Blocks.Components.General 821 @using Dynamicweb.Rapido.Blocks.Components 822 823 824 @* Component *@ 825 826 @helper RenderTextareaField(TextareaField settings) { 827 dynamic[] methodParameters = new dynamic[1]; 828 methodParameters[0] = settings; 829 MethodInfo customMethod = this.GetType().GetMethod("RenderTextareaFieldCustom"); 830 831 if (customMethod != null) 832 { 833 @customMethod.Invoke(this, methodParameters).ToString(); 834 } else { 835 int maxLength = settings.MaxLength != 0 ? settings.MaxLength : 524288; 836 Dictionary<String, String> optionalAttributes = new Dictionary<string, string>(); 837 if (!String.IsNullOrEmpty(settings.OnClick)) { optionalAttributes.Add("onclick", settings.OnClick.ToString()); } 838 if (!String.IsNullOrEmpty(settings.Placeholder)) { optionalAttributes.Add("placeholder", settings.Placeholder); } 839 if (settings.Disabled) { optionalAttributes.Add("disabled", settings.Disabled.ToString()); } 840 if (settings.Required) { optionalAttributes.Add("required", settings.Required.ToString()); } 841 if (settings.MaxLength != 0) { optionalAttributes.Add("maxlength", settings.MaxLength.ToString()); } 842 if (settings.Rows != 0) { optionalAttributes.Add("rows", settings.Rows.ToString()); } 843 844 <div class="form__field-group dw-mod"> 845 @if (!String.IsNullOrEmpty(@settings.Label)) 846 { 847 <label for="@settings.Id">@settings.Label</label> 848 } 849 850 <textarea class="u-full-width @settings.CssClass dw-mod" name="@settings.Id" id="@(settings.Id)" value="@settings.Value" @ComponentMethods.AddAttributes(optionalAttributes) @ComponentMethods.AddAttributes(settings.ExtraAttributes)></textarea> 851 852 @RenderNotificationMessage(new NotificationMessage { Message = settings.ErrorMessage }) 853 </div> 854 } 855 } 856 @using System.Reflection 857 @using Dynamicweb.Rapido.Blocks.Components.General 858 @using Dynamicweb.Rapido.Blocks.Components 859 860 861 @* Component *@ 862 863 @helper RenderHiddenField(HiddenField settings) { 864 dynamic[] methodParameters = new dynamic[1]; 865 methodParameters[0] = settings; 866 MethodInfo customMethod = this.GetType().GetMethod(settings.HelperName + "Custom"); 867 868 if (customMethod != null) 869 { 870 @customMethod.Invoke(this, methodParameters).ToString(); 871 } else { 872 <input type="hidden" name="@settings.Id" id="@(settings.Id)" value="@settings.Value" @ComponentMethods.AddAttributes(settings.ExtraAttributes)/> 873 } 874 } 875 @using System.Reflection 876 @using Dynamicweb.Rapido.Blocks.Components.General 877 @using Dynamicweb.Rapido.Blocks.Components 878 879 880 @* Component *@ 881 882 @helper RenderCheckboxField(dynamic settings) { 883 dynamic[] methodParameters = new dynamic[1]; 884 methodParameters[0] = settings; 885 MethodInfo customMethod = this.GetType().GetMethod("RenderCheckboxFieldCustom"); 886 887 if (customMethod != null) 888 { 889 @customMethod.Invoke(this, methodParameters).ToString(); 890 } else { 891 settings.Type = FieldListOptionType.Checkbox; 892 string disabled = settings.Disabled ? "disabled" : ""; 893 string required = settings.Required ? "required" : ""; 894 string checkedString = settings.Checked == true ? "checked" : ""; 895 string id = settings.Id != null ? settings.Id : settings.Label.Replace(" ", ""); 896 897 <div class="form__field-group dw-mod"> 898 <input type="checkbox" class="form__control @settings.CssClass @disabled dw-mod" name="@settings.Name" id="@id" value="@settings.Value" onclick="@settings.OnClick" @disabled @required @checkedString @ComponentMethods.AddAttributes(settings.ExtraAttributes) /> 899 900 @if (!String.IsNullOrEmpty(settings.Label)) 901 { 902 <label for="@id" class="@disabled dw-mod">@settings.Label</label> 903 } 904 905 @RenderNotificationMessage(new NotificationMessage { Message = settings.ErrorMessage }) 906 </div> 907 } 908 } 909 @using System.Reflection 910 @using Dynamicweb.Rapido.Blocks.Components.General 911 @using Dynamicweb.Rapido.Blocks.Components 912 913 914 @* Component *@ 915 916 @helper RenderCheckboxListField(CheckboxListField settings) { 917 dynamic[] methodParameters = new dynamic[1]; 918 methodParameters[0] = settings; 919 MethodInfo customMethod = this.GetType().GetMethod("RenderCheckboxListFieldCustom"); 920 921 if (customMethod != null) 922 { 923 @customMethod.Invoke(this, methodParameters).ToString(); 924 } else { 925 string disabled = settings.Disabled ? "disabled" : ""; 926 927 <div class="form__field-group @settings.CssClass u-margin-bottom @disabled dw-mod" @disabled @ComponentMethods.AddAttributes(settings.ExtraAttributes)> 928 @if (!String.IsNullOrEmpty(settings.Label)) 929 { 930 <div class="u-bold u-margin-bottom">@settings.Label</div> 931 } 932 933 @foreach (var item in settings.Options) 934 { 935 item.Type = FieldListOptionType.Checkbox; 936 @RenderFieldListOption(item) 937 } 938 939 @RenderNotificationMessage(new NotificationMessage { Message = settings.ErrorMessage }) 940 </div> 941 } 942 } 943 944 @using System.Reflection 945 @using Dynamicweb.Rapido.Blocks.Components.General 946 @using Dynamicweb.Rapido.Blocks.Components 947 948 949 @* Component *@ 950 951 @helper RenderSelectField(SelectField settings) { 952 dynamic[] methodParameters = new dynamic[1]; 953 methodParameters[0] = settings; 954 MethodInfo customMethod = this.GetType().GetMethod("RenderSelectFieldCustom"); 955 956 if (customMethod != null) 957 { 958 @customMethod.Invoke(this, methodParameters).ToString(); 959 } else { 960 string disabled = settings.Disabled ? "disabled" : ""; 961 string required = settings.Required ? "required" : ""; 962 963 if (settings.Default != null) 964 { 965 settings.Default.Type = FieldListOptionType.SelectOption; 966 } 967 968 <div class="form__field-group u-full-width dw-mod"> 969 @if (!String.IsNullOrEmpty(settings.Label)) 970 { 971 <label for="@settings.Id">@settings.Label</label> 972 } 973 974 <div class="form__field-combi u-no-margin dw-mod"> 975 <select id="@settings.Id" class="u-full-width @settings.CssClass dw-mod" onchange="@settings.OnChange" @ComponentMethods.AddAttributes(settings.ExtraAttributes) > 976 @if (settings.Default.Value != null) 977 { 978 @RenderFieldListOption(settings.Default) 979 } 980 981 @foreach (var item in settings.Options) 982 { 983 item.Type = FieldListOptionType.SelectOption; 984 @RenderFieldListOption(item) 985 } 986 </select> 987 @if (settings.ActionButton.Link != null || settings.ActionButton.OnClick != null) { 988 settings.ActionButton.CssClass += " btn--condensed u-no-margin"; 989 @RenderButton(settings.ActionButton); 990 } 991 </div> 992 993 @RenderNotificationMessage(new NotificationMessage { Message = settings.ErrorMessage }) 994 </div> 995 } 996 } 997 @using System.Reflection 998 @using Dynamicweb.Rapido.Blocks.Components.General 999 @using Dynamicweb.Rapido.Blocks.Components 1000 1001 1002 @* Component *@ 1003 1004 @helper RenderRadioButtonField(RadioButtonField settings) { 1005 dynamic[] methodParameters = new dynamic[1]; 1006 methodParameters[0] = settings; 1007 MethodInfo customMethod = this.GetType().GetMethod("RenderRadioButtonFieldCustom"); 1008 1009 if (customMethod != null) 1010 { 1011 @customMethod.Invoke(this, methodParameters).ToString(); 1012 } else { 1013 string disabled = settings.Disabled ? "disabled" : ""; 1014 1015 <div class="form__field-group @settings.CssClass u-margin-bottom @disabled" @disabled @ComponentMethods.AddAttributes(settings.ExtraAttributes)> 1016 @if (!String.IsNullOrEmpty(settings.Label)) 1017 { 1018 <div class="u-bold u-margin-bottom">@settings.Label</div> 1019 } 1020 1021 @foreach (var item in settings.Options) 1022 { 1023 item.Type = FieldListOptionType.RadioButton; 1024 1025 if (settings.Name != null) 1026 { 1027 item.Name = settings.Name; 1028 } 1029 1030 if (settings.RenderOptionsInline) 1031 { 1032 @RenderFieldListOption(item) 1033 } 1034 else 1035 { 1036 <div> 1037 @RenderFieldListOption(item) 1038 </div> 1039 } 1040 } 1041 1042 @RenderNotificationMessage(new NotificationMessage { Message = settings.ErrorMessage }) 1043 </div> 1044 } 1045 } 1046 @using System.Reflection 1047 @using Dynamicweb.Rapido.Blocks.Components.General 1048 @using Dynamicweb.Rapido.Blocks.Components 1049 1050 1051 @* Component *@ 1052 1053 @helper RenderNotificationMessage(NotificationMessage settings) { 1054 dynamic[] methodParameters = new dynamic[1]; 1055 methodParameters[0] = settings; 1056 MethodInfo customMethod = this.GetType().GetMethod("RenderNotificationMessageCustom"); 1057 1058 if (customMethod != null) 1059 { 1060 @customMethod.Invoke(this, methodParameters).ToString(); 1061 } else { 1062 if (!String.IsNullOrEmpty(settings.Message)) 1063 { 1064 string messageTypeClass = settings.MessageType.ToString().ToLower(); 1065 <div class="field-@messageTypeClass @settings.CssClass u-full-width dw-mod">@settings.Message</div> 1066 } 1067 } 1068 } 1069 @using System.Reflection 1070 @using Dynamicweb.Rapido.Blocks.Components.General 1071 1072 1073 @* Component *@ 1074 1075 @helper RenderHandlebarsRoot(HandlebarsRoot settings) { 1076 dynamic[] methodParameters = new dynamic[1]; 1077 methodParameters[0] = settings; 1078 MethodInfo customMethod = this.GetType().GetMethod("RenderHandlebarsRootCustom"); 1079 1080 if (customMethod != null) 1081 { 1082 @customMethod.Invoke(this, methodParameters).ToString(); 1083 } else { 1084 string preRender = !String.IsNullOrEmpty(settings.PreRenderScriptTemplate) ? "data-pre-render-template=\"" + settings.PreRenderScriptTemplate + "\"" : ""; 1085 1086 <div class="@settings.CssClass dw-mod js-handlebars-root" id="@settings.Id" data-template="@settings.ScriptTemplate" data-json-feed="@settings.FeedUrl" data-init-onload="@settings.InitOnLoad.ToString()" data-preloader="@settings.Preloader" @preRender> 1087 @if (settings.SubBlocks != null) { 1088 @RenderBlockList(settings.SubBlocks) 1089 } 1090 </div> 1091 } 1092 } 1093 @using System.Reflection 1094 @using Dynamicweb.Rapido.Blocks.Components.General 1095 @using Dynamicweb.Rapido.Blocks.Components 1096 @using System.Text.RegularExpressions 1097 1098 1099 @* Component *@ 1100 1101 @helper RenderSticker(Sticker settings) { 1102 dynamic[] methodParameters = new dynamic[1]; 1103 methodParameters[0] = settings; 1104 MethodInfo customMethod = this.GetType().GetMethod("RenderStickerCustom"); 1105 1106 if (customMethod != null) 1107 { 1108 @customMethod.Invoke(this, methodParameters).ToString(); 1109 } 1110 else 1111 { 1112 if (!String.IsNullOrEmpty(settings.Title)) { 1113 string size = settings.Size.ToString() != "None" ? "" + "stickers-container__tag--" + settings.Size.ToString().ToLower() : ""; 1114 string style = settings.Style.ToString() != "None" ? "" + "stickers-container__tag--" + settings.Style.ToString().ToLower() : ""; 1115 1116 Dictionary<String, String> optionalAttributes = new Dictionary<string, string>(); 1117 if (!String.IsNullOrEmpty(settings.Color) || !String.IsNullOrEmpty(settings.BackgroundColor)) { 1118 string styleTag = !String.IsNullOrEmpty(settings.Color) ? "color: " + settings.Color + "; " : ""; 1119 styleTag += !String.IsNullOrEmpty(settings.BackgroundColor) ? "background-color: " + settings.BackgroundColor + "; " : ""; 1120 optionalAttributes.Add("style", styleTag); 1121 } 1122 1123 <div class="stickers-container__tag @size @style @settings.CssClass dw-mod" @ComponentMethods.AddAttributes(optionalAttributes) @ComponentMethods.AddAttributes(settings.ExtraAttributes)>@settings.Title</div> 1124 } 1125 } 1126 } 1127 1128 @using System.Reflection 1129 @using Dynamicweb.Rapido.Blocks.Components.General 1130 @using Dynamicweb.Rapido.Blocks.Components 1131 1132 1133 @* Component *@ 1134 1135 @helper RenderStickersCollection(StickersCollection settings) { 1136 dynamic[] methodParameters = new dynamic[1]; 1137 methodParameters[0] = settings; 1138 MethodInfo customMethod = this.GetType().GetMethod("RenderStickersCollectionCustom"); 1139 1140 if (customMethod != null) 1141 { 1142 @customMethod.Invoke(this, methodParameters).ToString(); 1143 } 1144 else 1145 { 1146 if (settings.Stickers.Count > 0) { 1147 string position = settings.Position != null ? "" + "stickers-container--" + Regex.Replace(settings.Position.ToString(), "([a-z])([A-Z])", "$1-$2").ToLower() : ""; 1148 1149 <div class="stickers-container @position @settings.CssClass dw-mod" @ComponentMethods.AddAttributes(settings.ExtraAttributes)> 1150 @foreach (Sticker sticker in settings.Stickers) 1151 { 1152 @RenderSticker(sticker) 1153 } 1154 </div> 1155 } 1156 } 1157 } 1158 1159 @using System.Reflection 1160 @using Dynamicweb.Rapido.Blocks.Components.General 1161 @using Dynamicweb.Rapido.Blocks.Components 1162 1163 1164 1165 @* Component *@ 1166 1167 @helper RenderField(Field settings) { 1168 dynamic[] methodParameters = new dynamic[1]; 1169 methodParameters[0] = settings; 1170 MethodInfo customMethod = this.GetType().GetMethod("RenderFieldCustom"); 1171 1172 if (customMethod != null) 1173 { 1174 @customMethod.Invoke(this, methodParameters).ToString(); 1175 } else { 1176 switch (settings.FieldType) 1177 { 1178 case FieldType.Checkbox: 1179 CheckboxField checkbox = new CheckboxField 1180 { 1181 Label = settings.Label, 1182 Id = settings.Id, 1183 Name = settings.Label.Replace(" ", ""), 1184 Value = settings.Value, 1185 Checked = Convert.ToBoolean(settings.Placeholder), 1186 OnClick = settings.OnClick, 1187 Disabled = settings.Disabled, 1188 Required = settings.Required, 1189 CssClass = settings.CssClass, 1190 ExtraAttributes = settings.ExtraAttributes, 1191 ErrorMessage = settings.ErrorMessage 1192 }; 1193 1194 @RenderCheckboxField(checkbox) 1195 break; 1196 case FieldType.Email: 1197 TextField emailField = new TextField 1198 { 1199 Label = settings.Label != null ? settings.Label : Translate("Email"), 1200 Id = settings.Id, 1201 Value = settings.Value, 1202 OnClick = settings.OnClick, 1203 Disabled = settings.Disabled, 1204 Required = settings.Required, 1205 CssClass = settings.CssClass, 1206 ExtraAttributes = settings.ExtraAttributes, 1207 ErrorMessage = settings.ErrorMessage, 1208 Placeholder = settings.Placeholder, 1209 Type = TextFieldType.Email 1210 }; 1211 1212 @RenderTextField(emailField) 1213 break; 1214 case FieldType.Hidden: 1215 HiddenField hiddenField = new HiddenField 1216 { 1217 Label = settings.Label, 1218 Id = settings.Id, 1219 Value = settings.Value, 1220 Disabled = settings.Disabled, 1221 Required = settings.Required, 1222 CssClass = settings.CssClass, 1223 ExtraAttributes = settings.ExtraAttributes, 1224 ErrorMessage = settings.ErrorMessage 1225 }; 1226 1227 @RenderHiddenField(hiddenField) 1228 break; 1229 case FieldType.Integer: 1230 NumberField numberField = new NumberField 1231 { 1232 Label = settings.Label, 1233 Id = settings.Id, 1234 Value = settings.Value.GetType() == typeof(int) ? Convert.ToInt32(settings.Value) : 1, 1235 OnClick = settings.OnClick, 1236 Disabled = settings.Disabled, 1237 Required = settings.Required, 1238 CssClass = settings.CssClass, 1239 ExtraAttributes = settings.ExtraAttributes, 1240 ErrorMessage = settings.ErrorMessage, 1241 Step = 1 1242 }; 1243 1244 @RenderNumberField(numberField) 1245 break; 1246 case FieldType.Password: 1247 TextField passwordField = new TextField 1248 { 1249 Label = settings.Label != null ? settings.Label : Translate("Password"), 1250 Id = settings.Id, 1251 Value = settings.Value, 1252 OnClick = settings.OnClick, 1253 Disabled = settings.Disabled, 1254 Required = settings.Required, 1255 CssClass = settings.CssClass, 1256 ExtraAttributes = settings.ExtraAttributes, 1257 ErrorMessage = settings.ErrorMessage, 1258 Placeholder = settings.Placeholder, 1259 Type = TextFieldType.Password 1260 }; 1261 1262 @RenderTextField(passwordField) 1263 break; 1264 case FieldType.Reset: 1265 Button resetField = new Button 1266 { 1267 Title = settings.Label != null ? settings.Label : Translate("Reset"), 1268 Id = settings.Id, 1269 OnClick = settings.OnClick, 1270 Disabled = settings.Disabled, 1271 CssClass = settings.CssClass, 1272 ExtraAttributes = settings.ExtraAttributes, 1273 ButtonLayout = ButtonLayout.Secondary, 1274 ButtonType = ButtonType.Reset 1275 }; 1276 1277 @RenderButton(resetField) 1278 break; 1279 case FieldType.Submit: 1280 Button submitField = new Button 1281 { 1282 Title = settings.Label != null ? settings.Label : Translate("Submit"), 1283 Id = settings.Id, 1284 OnClick = settings.OnClick, 1285 Disabled = settings.Disabled, 1286 CssClass = settings.CssClass, 1287 ExtraAttributes = settings.ExtraAttributes, 1288 ButtonLayout = ButtonLayout.Primary, 1289 ButtonType = ButtonType.Submit 1290 }; 1291 1292 @RenderButton(submitField) 1293 break; 1294 case FieldType.Tel: 1295 TextField telField = new TextField 1296 { 1297 Label = settings.Label != null ? settings.Label : Translate("Phone"), 1298 Id = settings.Id, 1299 Value = settings.Value, 1300 OnClick = settings.OnClick, 1301 Disabled = settings.Disabled, 1302 Required = settings.Required, 1303 CssClass = settings.CssClass, 1304 ExtraAttributes = settings.ExtraAttributes, 1305 ErrorMessage = settings.ErrorMessage, 1306 Placeholder = settings.Placeholder, 1307 Type = TextFieldType.Tel 1308 }; 1309 1310 @RenderTextField(telField) 1311 break; 1312 case FieldType.Text: 1313 TextField textField = new TextField 1314 { 1315 Label = settings.Label, 1316 Id = settings.Id, 1317 Value = settings.Value, 1318 OnClick = settings.OnClick, 1319 Disabled = settings.Disabled, 1320 Required = settings.Required, 1321 CssClass = settings.CssClass, 1322 ExtraAttributes = settings.ExtraAttributes, 1323 ErrorMessage = settings.ErrorMessage, 1324 Placeholder = settings.Placeholder, 1325 Type = TextFieldType.Text 1326 }; 1327 1328 @RenderTextField(textField) 1329 break; 1330 case FieldType.Textarea: 1331 TextareaField textareaField = new TextareaField 1332 { 1333 Label = settings.Label, 1334 Id = settings.Id, 1335 Value = settings.Value, 1336 OnClick = settings.OnClick, 1337 Disabled = settings.Disabled, 1338 Required = settings.Required, 1339 CssClass = settings.CssClass, 1340 ExtraAttributes = settings.ExtraAttributes, 1341 ErrorMessage = settings.ErrorMessage, 1342 Placeholder = settings.Placeholder 1343 }; 1344 1345 @RenderTextareaField(textareaField) 1346 break; 1347 default: 1348 TextField defaultField = new TextField 1349 { 1350 Label = settings.Label, 1351 Id = settings.Id, 1352 Value = settings.Value, 1353 OnClick = settings.OnClick, 1354 Disabled = settings.Disabled, 1355 Required = settings.Required, 1356 CssClass = settings.CssClass, 1357 ExtraAttributes = settings.ExtraAttributes, 1358 ErrorMessage = settings.ErrorMessage, 1359 Placeholder = settings.Placeholder, 1360 Type = TextFieldType.Text 1361 }; 1362 1363 @RenderTextField(defaultField) 1364 break; 1365 } 1366 } 1367 } 1368 1369 1370 @using Dynamicweb.Frontend 1371 @using System.Reflection 1372 @using Dynamicweb.Content.Items 1373 @using System.Web.UI.HtmlControls 1374 @using Dynamicweb.Rapido.Blocks.Components 1375 @using Dynamicweb.Rapido.Blocks 1376 1377 1378 @* Components for the articles *@ 1379 @using System.Reflection 1380 @using Dynamicweb.Rapido.Blocks.Components.Articles 1381 1382 1383 @* Component for the articles *@ 1384 1385 @helper RenderArticleBanner(dynamic settings) { 1386 dynamic[] methodParameters = new dynamic[1]; 1387 methodParameters[0] = settings; 1388 MethodInfo customMethod = this.GetType().GetMethod("RenderArticleBannerCustom"); 1389 1390 if (customMethod != null) 1391 { 1392 @customMethod.Invoke(this, methodParameters).ToString(); 1393 } else { 1394 string filterClasses = "image-filter image-filter--darken"; 1395 settings.Layout = ArticleHeaderLayout.Banner; 1396 1397 if (settings.Image != null) 1398 { 1399 if (settings.Image.Path != null) 1400 { 1401 <section class="multiple-paragraphs-container u-color-light paragraph-container--full-width"> 1402 <div class="background-image @filterClasses dw-mod"> 1403 <div class="background-image__wrapper @filterClasses dw-mod"> 1404 @{ 1405 settings.Image.CssClass += "background-image__cover dw-mod"; 1406 } 1407 @RenderImage(settings.Image) 1408 </div> 1409 </div> 1410 <div class="center-container dw-mod"> 1411 <div class="grid"> 1412 <div class="grid__col-md-8 grid__col-xs-12 paragraph-container paragraph-container--height-lg"> 1413 <div class="u-left-middle"> 1414 <div> 1415 @if (!String.IsNullOrEmpty(settings.Heading)) 1416 { 1417 <h1 class="article__header article__header--giant dw-mod" style="color: @settings.TextColor">@settings.Heading</h1> 1418 } 1419 @if (!String.IsNullOrEmpty(settings.Subheading)) 1420 { 1421 <div class="article__leadtext dw-mod" style="color: @settings.TextColor">@settings.Subheading</div> 1422 } 1423 @if (!String.IsNullOrEmpty(settings.Author) || !String.IsNullOrEmpty(settings.Date)) 1424 { 1425 <small class="article__post-info u-margin-bottom--lg dw-mod" style="color: @settings.TextColor">@settings.Author @settings.Date</small> 1426 } 1427 @if (!String.IsNullOrEmpty(settings.Link)) { 1428 <div class="grid__cell"> 1429 @RenderButton(new Button { Link= settings.Link, Title= settings.LinkText, ButtonLayout= settings.ButtonLayout }) 1430 </div> 1431 } 1432 </div> 1433 </div> 1434 </div> 1435 @if (settings.ExternalParagraphId != 0) 1436 { 1437 <div class="grid__col-md-4 grid__col-sm-12 grid__col-xs-12 paragraph-container paragraph-container--height-auto dw-mod"> 1438 <div class="u-color-light-gray--bg u-color-dark dw-mod"> 1439 @RenderParagraphContent(settings.ExternalParagraphId) 1440 </div> 1441 </div> 1442 } 1443 </div> 1444 </div> 1445 </section> 1446 } 1447 else 1448 { 1449 settings.Layout = ArticleHeaderLayout.Clean; 1450 @RenderArticleCleanHeader(settings); 1451 } 1452 } 1453 else 1454 { 1455 settings.Layout = ArticleHeaderLayout.Clean; 1456 @RenderArticleCleanHeader(settings); 1457 } 1458 } 1459 } 1460 @using System.Reflection 1461 @using Dynamicweb.Rapido.Blocks.Components 1462 @using Dynamicweb.Rapido.Blocks.Components.General 1463 @using Dynamicweb.Rapido.Blocks.Components.Articles 1464 @using Dynamicweb.Rapido.Blocks 1465 1466 1467 @* Component for the articles *@ 1468 1469 @helper RenderArticleHeader(ArticleHeader settings) { 1470 dynamic[] methodParameters = new dynamic[1]; 1471 methodParameters[0] = settings; 1472 MethodInfo customMethod = this.GetType().GetMethod("RenderArticleHeaderCustom"); 1473 1474 if (customMethod != null) 1475 { 1476 @customMethod.Invoke(this, methodParameters).ToString(); 1477 } else { 1478 switch (settings.Layout) 1479 { 1480 case ArticleHeaderLayout.Clean: 1481 @RenderArticleCleanHeader(settings); 1482 break; 1483 case ArticleHeaderLayout.Split: 1484 @RenderArticleSplitHeader(settings); 1485 break; 1486 case ArticleHeaderLayout.Banner: 1487 @RenderArticleBannerHeader(settings); 1488 break; 1489 case ArticleHeaderLayout.Overlay: 1490 @RenderArticleOverlayHeader(settings); 1491 break; 1492 default: 1493 @RenderArticleCleanHeader(settings); 1494 break; 1495 } 1496 } 1497 } 1498 1499 @helper RenderArticleCleanHeader(ArticleHeader settings) { 1500 dynamic[] methodParameters = new dynamic[1]; 1501 methodParameters[0] = settings; 1502 MethodInfo customMethod = this.GetType().GetMethod("RenderArticleCleanHeaderCustom"); 1503 1504 if (customMethod != null) 1505 { 1506 @customMethod.Invoke(this, methodParameters).ToString(); 1507 } 1508 else 1509 { 1510 string contentColumns = settings.TextLayout != ArticleHeaderTextLayout.Full ? "8" : "12"; 1511 1512 <div class="grid grid--align-content-start grid--justify-start"> 1513 <div class="grid__col-md-@contentColumns grid__col-sm-12 u-padding--lg dw-mod"> 1514 @if (!String.IsNullOrEmpty(settings.Category) || !String.IsNullOrEmpty(settings.Author) || !String.IsNullOrEmpty(settings.Date) || settings.RatingOutOf != 0) 1515 { 1516 <div class="u-border-bottom u-padding-bottom"> 1517 @if (!String.IsNullOrEmpty(settings.Category)) 1518 { 1519 <div class="u-pull--left"> 1520 <div class="article__category dw-mod" style="color: @settings.CategoryColor">@settings.Category</div> 1521 </div> 1522 } 1523 <div class="u-pull--right"> 1524 @if (!String.IsNullOrEmpty(settings.Author) || !String.IsNullOrEmpty(settings.Date)) 1525 { 1526 <small class="article__post-info dw-mod">@settings.Author @settings.Date</small> 1527 } 1528 @if (settings.RatingOutOf != 0) 1529 { 1530 @RenderRating(new Rating { Score = settings.RatingScore, OutOf = settings.RatingOutOf }) 1531 } 1532 </div> 1533 </div> 1534 } 1535 1536 <div class="grid__cell"> 1537 @if (!String.IsNullOrEmpty(settings.Heading)) 1538 { 1539 <h1 class="article__header article__header--giant dw-mod">@settings.Heading</h1> 1540 } 1541 @if (settings.Image != null) 1542 { 1543 if (settings.Image.Path != null) 1544 { 1545 <div class="u-padding-bottom--lg"> 1546 @RenderImage(settings.Image) 1547 </div> 1548 } 1549 } 1550 @if (!String.IsNullOrEmpty(settings.Subheading)) 1551 { 1552 <div class="article__leadtext dw-mod">@settings.Subheading</div> 1553 } 1554 @if (!String.IsNullOrEmpty(settings.Link)) 1555 { 1556 <div class="grid__cell"> 1557 @RenderButton(new Button { Link = settings.Link, Title = settings.LinkText, ButtonLayout = settings.ButtonLayout }) 1558 </div> 1559 } 1560 </div> 1561 </div> 1562 @if (settings.ExternalParagraphId != 0) 1563 { 1564 <div class="grid__col-md-4 grid__col-sm-12 u-padding--lg u-color-light-gray--bg dw-mod"> 1565 @RenderParagraphContent(settings.ExternalParagraphId) 1566 </div> 1567 } 1568 </div> 1569 } 1570 } 1571 1572 @helper RenderArticleSplitHeader(ArticleHeader settings) { 1573 dynamic[] methodParameters = new dynamic[1]; 1574 methodParameters[0] = settings; 1575 MethodInfo customMethod = this.GetType().GetMethod("RenderArticleSplitHeaderCustom"); 1576 1577 if (customMethod != null) 1578 { 1579 @customMethod.Invoke(this, methodParameters).ToString(); 1580 } 1581 else 1582 { 1583 string headerColumnWidth = settings.ExternalParagraphId != 0 ? "4" : "6"; 1584 1585 if (settings.Image != null) 1586 { 1587 if (settings.Image.Path != null) 1588 { 1589 <section class="multiple-paragraphs-container paragraph-container--full-width"> 1590 <div class="grid"> 1591 <div class="grid__col-md-@headerColumnWidth grid__col-sm-12 grid__col-xs-12 paragraph-container paragraph-container--height-xl dw-mod"> 1592 <div class="u-left-middle u-padding--lg"> 1593 <div> 1594 @if (!String.IsNullOrEmpty(settings.Category)) 1595 { 1596 <div class="article__category dw-mod" style="color: @settings.CategoryColor">@settings.Category</div> 1597 } 1598 @if (!String.IsNullOrEmpty(settings.Heading)) 1599 { 1600 <h1 class="article__header article__header--giant dw-mod">@settings.Heading</h1> 1601 } 1602 @if (!String.IsNullOrEmpty(settings.Subheading)) 1603 { 1604 <div class="article__leadtext dw-mod">@settings.Subheading</div> 1605 } 1606 @if (!String.IsNullOrEmpty(settings.Author) || !String.IsNullOrEmpty(settings.Date)) 1607 { 1608 <small class="article__post-info u-pull--left dw-mod">@settings.Author @settings.Date</small> 1609 } 1610 @if (settings.RatingOutOf != 0) 1611 { 1612 <div class="u-pull--right"> 1613 @RenderRating(new Rating { Score = settings.RatingScore, OutOf = settings.RatingOutOf }) 1614 </div> 1615 } 1616 @if (!String.IsNullOrEmpty(settings.Link)) { 1617 @RenderButton(new Button { Link = settings.Link, Title = settings.LinkText, ButtonLayout = settings.ButtonLayout }) 1618 } 1619 </div> 1620 </div> 1621 </div> 1622 <div class="grid__col-md-@headerColumnWidth grid__col-sm-12 grid__col-xs-12 paragraph-container paragraph-container--height-auto dw-mod" style="background-image:url(/Admin/Public/GetImage.ashx?width=1800&amp;height=1100&amp;crop=0&amp;Compression=85&amp;DoNotUpscale=true&amp;image=@settings.Image.Path); background-position: center center; background-size: cover;"></div> 1623 @if (settings.ExternalParagraphId != 0) 1624 { 1625 <div class="grid__col-md-4 grid__col-sm-12 grid__col-xs-12 paragraph-container paragraph-container--height-auto u-color-light-gray--bg dw-mod"> 1626 @RenderParagraphContent(settings.ExternalParagraphId) 1627 </div> 1628 } 1629 </div> 1630 </section> 1631 } 1632 } 1633 else 1634 { 1635 @RenderArticleCleanHeader(settings); 1636 } 1637 } 1638 } 1639 1640 @helper RenderArticleOverlayHeader(ArticleHeader settings) { 1641 dynamic[] methodParameters = new dynamic[1]; 1642 methodParameters[0] = settings; 1643 MethodInfo customMethod = this.GetType().GetMethod("RenderArticleOverlayHeaderCustom"); 1644 1645 if (customMethod != null) 1646 { 1647 @customMethod.Invoke(this, methodParameters).ToString(); 1648 } 1649 else 1650 { 1651 string contentColumns = settings.TextLayout != ArticleHeaderTextLayout.Full ? "8" : "12"; 1652 string contentAlignment = settings.TextLayout == ArticleHeaderTextLayout.Center ? "grid--justify-center" : ""; 1653 1654 if (settings.Image != null) 1655 { 1656 if (settings.Image.Path != null) 1657 { 1658 if (settings.ExternalParagraphId == 0) 1659 { 1660 <section class="multiple-paragraphs-container u-color-light paragraph-container--full-width"> 1661 <div class="background-image image-filter image-filter--darken dw-mod"> 1662 <div class="background-image__wrapper image-filter image-filter--darken dw-mod"> 1663 @{ 1664 settings.Image.CssClass += "background-image__cover dw-mod"; 1665 } 1666 @RenderImage(settings.Image) 1667 </div> 1668 </div> 1669 <div class="center-container dw-mod"> 1670 <div class="grid @contentAlignment"> 1671 <div class="grid__col-md-@contentColumns grid__col-xs-12 paragraph-container paragraph-container--height-xl u-no-padding dw-mod"> 1672 @if (!String.IsNullOrEmpty(settings.Heading)) 1673 { 1674 <h1 class="article__header article__header--giant u-padding-top--lg dw-mod" style="color: @settings.TextColor">@settings.Heading</h1> 1675 } 1676 @if (!String.IsNullOrEmpty(settings.Subheading)) 1677 { 1678 <div class="article__leadtext dw-mod" style="color: @settings.TextColor">@settings.Subheading</div> 1679 } 1680 <div class="u-margin-top"> 1681 @if (!String.IsNullOrEmpty(settings.Author) || !String.IsNullOrEmpty(settings.Date)) 1682 { 1683 <small class="article__post-info u-pull--left dw-mod" style="color: @settings.TextColor">@settings.Author @settings.Date</small> 1684 } 1685 @if (settings.RatingOutOf != 0) 1686 { 1687 <div class="u-pull--right"> 1688 @RenderRating(new Rating { Score = settings.RatingScore, OutOf = settings.RatingOutOf }) 1689 </div> 1690 } 1691 </div> 1692 @if (!String.IsNullOrEmpty(settings.Link)) 1693 { 1694 <div class="grid__cell"> 1695 @RenderButton(new Button { Link= settings.Link, Title= settings.LinkText, ButtonLayout= settings.ButtonLayout }) 1696 </div> 1697 } 1698 </div> 1699 </div> 1700 </div> 1701 </section> 1702 } 1703 else 1704 { 1705 @RenderArticleBanner(settings); 1706 } 1707 } 1708 } 1709 else 1710 { 1711 @RenderArticleCleanHeader(settings); 1712 } 1713 } 1714 } 1715 1716 @helper RenderArticleBannerHeader(dynamic settings) { 1717 dynamic[] methodParameters = new dynamic[1]; 1718 methodParameters[0] = settings; 1719 MethodInfo customMethod = this.GetType().GetMethod("RenderArticleBannerHeaderCustom"); 1720 1721 if (customMethod != null) 1722 { 1723 @customMethod.Invoke(this, methodParameters).ToString(); 1724 } 1725 else 1726 { 1727 @RenderArticleBanner(settings); 1728 } 1729 } 1730 @using System.Reflection 1731 @using System.Text.RegularExpressions; 1732 @using Dynamicweb.Frontend 1733 @using Dynamicweb.Content.Items 1734 @using Dynamicweb.Rapido.Blocks.Components 1735 @using Dynamicweb.Rapido.Blocks.Components.Articles 1736 @using Dynamicweb.Rapido.Blocks 1737 1738 @* Component for the articles *@ 1739 1740 @helper RenderArticleBodyRow(ArticleBodyRow settings) 1741 { 1742 dynamic[] methodParameters = new dynamic[1]; 1743 methodParameters[0] = settings; 1744 MethodInfo customMethod = this.GetType().GetMethod("RenderArticleBodyRowCustom"); 1745 1746 if (customMethod != null) 1747 { 1748 @customMethod.Invoke(this, methodParameters).ToString(); 1749 } else { 1750 string position = settings.TopLayout == "overlay" ? "article__overlay-offset" : ""; 1751 string contentAlignment = settings.TextLayout == "center" ? "grid--justify-center" : ""; 1752 1753 <div class="grid grid--align-content-start @contentAlignment @position dw-mod"> 1754 @RenderBlockList(settings.SubBlocks) 1755 </div> 1756 } 1757 } 1758 @using System.Reflection 1759 @using Dynamicweb.Rapido.Blocks.Components 1760 @using Dynamicweb.Rapido.Blocks.Components.General 1761 @using Dynamicweb.Rapido.Blocks.Components.Articles 1762 @using Dynamicweb.Rapido.Blocks 1763 1764 @* Component for the articles *@ 1765 1766 @helper RenderArticleImage(ArticleImage settings) 1767 { 1768 dynamic[] methodParameters = new dynamic[1]; 1769 methodParameters[0] = settings; 1770 MethodInfo customMethod = this.GetType().GetMethod("RenderArticleImageCustom"); 1771 1772 if (customMethod != null) 1773 { 1774 @customMethod.Invoke(this, methodParameters).ToString(); 1775 } 1776 else 1777 { 1778 if (settings.Image != null) 1779 { 1780 if (settings.Image.Path != null) 1781 { 1782 <div class="u-margin-bottom--lg"> 1783 @RenderImage(settings.Image) 1784 </div> 1785 } 1786 } 1787 } 1788 } 1789 @using System.Reflection 1790 @using Dynamicweb.Rapido.Blocks.Components 1791 @using Dynamicweb.Rapido.Blocks.Components.Articles 1792 1793 1794 @* Component for the articles *@ 1795 1796 @helper RenderArticleSubHeader(ArticleSubHeader settings) 1797 { 1798 dynamic[] methodParameters = new dynamic[1]; 1799 methodParameters[0] = settings; 1800 MethodInfo customMethod = this.GetType().GetMethod("RenderArticleSubHeaderCustom"); 1801 1802 if (customMethod != null) 1803 { 1804 @customMethod.Invoke(this, methodParameters).ToString(); 1805 } else { 1806 if (!String.IsNullOrEmpty(settings.Title)) 1807 { 1808 <h2 class="article__header">@settings.Title</h2> 1809 } 1810 } 1811 } 1812 @using System.Reflection 1813 @using Dynamicweb.Rapido.Blocks.Components 1814 @using Dynamicweb.Rapido.Blocks.Components.Articles 1815 @using Dynamicweb.Rapido.Blocks 1816 1817 1818 @* Component for the articles *@ 1819 1820 @helper RenderArticleText(ArticleText settings) 1821 { 1822 dynamic[] methodParameters = new dynamic[1]; 1823 methodParameters[0] = settings; 1824 MethodInfo customMethod = this.GetType().GetMethod("RenderArticleTextCustom"); 1825 1826 if (customMethod != null) 1827 { 1828 @customMethod.Invoke(this, methodParameters).ToString(); 1829 } else { 1830 if (!String.IsNullOrEmpty(settings.Text)) 1831 { 1832 string greatTextClass = settings.EnableLargeText == true ? "article__paragraph--great-text" : ""; 1833 1834 <div class="article__paragraph @greatTextClass"> 1835 @settings.Text 1836 </div> 1837 } 1838 } 1839 } 1840 @using System.Reflection 1841 @using Dynamicweb.Rapido.Blocks.Components 1842 @using Dynamicweb.Rapido.Blocks.Components.Articles 1843 @using Dynamicweb.Rapido.Blocks 1844 1845 1846 @* Component for the articles *@ 1847 1848 @helper RenderArticleQuote(ArticleQuote settings) 1849 { 1850 dynamic[] methodParameters = new dynamic[1]; 1851 methodParameters[0] = settings; 1852 MethodInfo customMethod = this.GetType().GetMethod("RenderArticleQuoteCustom"); 1853 1854 if (customMethod != null) 1855 { 1856 @customMethod.Invoke(this, methodParameters).ToString(); 1857 } else { 1858 string text = Regex.Replace(settings.Text, "<.*?>", String.Empty); 1859 1860 <div class="grid u-padding-bottom--lg"> 1861 @if (settings.Image != null) 1862 { 1863 if (settings.Image.Path != null) { 1864 <div class="grid__col-3"> 1865 <div class="grid__cell-img"> 1866 @{ 1867 settings.Image.Title = !String.IsNullOrEmpty(settings.Image.Title) ? settings.Image.Title : settings.Author; 1868 settings.Image.CssClass += " article__image article__image--ball"; 1869 settings.Image.ImageDefault.Width = 200; 1870 settings.Image.ImageDefault.Height = 200; 1871 } 1872 @RenderImage(settings.Image) 1873 </div> 1874 </div> 1875 } 1876 } 1877 <div class="grid__col-auto"> 1878 @if (!String.IsNullOrEmpty(settings.Text)) 1879 { 1880 <div class="article__quote dw-mod"> 1881 <i class="fas fa-quote-right u-margin-bottom--lg"></i> 1882 @settings.Text 1883 <i class="fas fa-quote-right"></i> 1884 </div> 1885 } 1886 @if (!String.IsNullOrEmpty(settings.Author)) 1887 { 1888 <div class="article__quote-author dw-mod"> 1889 - @settings.Author 1890 </div> 1891 } 1892 </div> 1893 </div> 1894 } 1895 } 1896 @using System.Reflection 1897 @using Dynamicweb.Rapido.Blocks.Components 1898 @using Dynamicweb.Rapido.Blocks.Components.Articles 1899 @using Dynamicweb.Rapido.Blocks 1900 1901 @* Component for the articles *@ 1902 1903 @helper RenderArticleInfoTable(ArticleInfoTable settings) 1904 { 1905 dynamic[] methodParameters = new dynamic[1]; 1906 methodParameters[0] = settings; 1907 MethodInfo customMethod = this.GetType().GetMethod("RenderArticleInfoTableCustom"); 1908 1909 if (customMethod != null) 1910 { 1911 @customMethod.Invoke(this, methodParameters).ToString(); 1912 } else { 1913 <table class="table table--clean"> 1914 @foreach (var row in settings.Rows) 1915 { 1916 string iconColor = row.IconColor != null ? row.IconColor : "u-brand-color-two"; 1917 1918 <tr> 1919 @if (!String.IsNullOrEmpty(row.Icon)) 1920 { 1921 <td class="u-w32px"><i class="@row.Icon fa-2x @row.IconColor"></i></td> 1922 } 1923 <td class="u-no-margin-on-p-elements"> 1924 <div class="u-bold">@row.Title</div> 1925 @if (!String.IsNullOrEmpty(row.SubTitle)) 1926 { 1927 if (row.Link == null) 1928 { 1929 <div>@row.SubTitle</div> 1930 } 1931 else 1932 { 1933 <a href="@row.Link" class="u-color-inherit">@row.SubTitle</a> 1934 } 1935 } 1936 </td> 1937 </tr> 1938 } 1939 </table> 1940 } 1941 } 1942 @using System.Reflection 1943 @using Dynamicweb.Rapido.Blocks.Components 1944 @using Dynamicweb.Rapido.Blocks.Components.Articles 1945 @using Dynamicweb.Rapido.Blocks 1946 1947 @* Component for the articles *@ 1948 1949 @helper RenderArticleGalleryModal(ArticleGalleryModal settings) 1950 { 1951 dynamic[] methodParameters = new dynamic[1]; 1952 methodParameters[0] = settings; 1953 MethodInfo customMethod = this.GetType().GetMethod(settings.HelperName + "Custom"); 1954 1955 if (customMethod != null) 1956 { 1957 @customMethod.Invoke(this, methodParameters).ToString(); 1958 } 1959 else 1960 { 1961 <input type="checkbox" id="ParagraphGalleryTrigger" class="modal-trigger" /> 1962 <div class="modal-container"> 1963 <label for="ParagraphGalleryTrigger" id="ParagraphGalleryOverlay" class="modal-overlay"></label> 1964 <div class="modal modal--full" id="ParagraphGallery"> 1965 <div class="modal__body modal__body--full"> 1966 <img src="/Files/Images/placeholder.gif" alt="" id="ParagraphGalleryModalImage" style="margin: 0 auto;" /> 1967 <div class="u-padding u-ta-center" id="ParagraphGalleryModalCaption"></div> 1968 <label class="modal__close-btn dw-mod" for="ParagraphGalleryTrigger"></label> 1969 </div> 1970 </div> 1971 </div> 1972 <script> 1973 function showImageInModal(image) { 1974 let imageNode = document.getElementById('ParagraphGalleryModalImage'); 1975 let captionNode = document.getElementById('ParagraphGalleryModalCaption'); 1976 let trigger = document.getElementById('ParagraphGalleryTrigger'); 1977 imageNode.src = image.src; 1978 if (image.alt != "") { 1979 captionNode.innerText = image.alt; 1980 imageNode.alt = image.alt; 1981 captionNode.style.display = "block"; 1982 } else { 1983 captionNode.style.display = "none"; 1984 } 1985 trigger.checked = true; 1986 } 1987 </script> 1988 } 1989 } 1990 @using System.Reflection 1991 @using Dynamicweb.Rapido.Blocks.Components 1992 @using Dynamicweb.Rapido.Blocks.Components.Articles 1993 @using Dynamicweb.Rapido.Blocks 1994 1995 1996 @* Component for the articles *@ 1997 1998 @helper RenderArticleRelated(ArticleRelated settings) 1999 { 2000 string cardClass = Pageview.Device.ToString() != "Tablet" ? "card u-color-light--bg u-full-height" : ""; 2001 string cardFooterClass = Pageview.Device.ToString() != "Tablet" ? "card-footer u-color-light--bg" : ""; 2002 2003 <section class="multiple-paragraphs-container u-color-light-gray--bg paragraph-container--full-width"> 2004 <div class="center-container dw-mod"> 2005 <div class="grid u-padding"> 2006 <div class="grid__col-md-12 grid__col-xs-12"> 2007 <h2 class="article__header u-no-margin u-margin-top">@settings.Title</h2> 2008 </div> 2009 </div> 2010 2011 <div class="js-handlebars-root u-padding" id="@settings.Title.Replace(" ", String.Empty)" data-template="RelatedSimpleTemplate" data-json-feed="/Default.aspx?ID=@settings.FeedPageId&@settings.Query&ExcludeItemID=@settings.CurrentPageId&PageSize=@settings.PageSize"></div> 2012 2013 <script id="RelatedSimpleTemplate" type="text/x-template"> 2014 {{#.}} 2015 <div class="grid u-padding-bottom--lg"> 2016 {{#Cases}} 2017 <div class="grid__col-3 image-hover--zoom dw-mod"> 2018 <a href="{{link}}" class="u-full-height u-color-light--bg"> 2019 {{#if image}} 2020 <div class="u-color-light--bg u-no-padding dw-mod"> 2021 <div class="flex-img image-hover__wrapper"> 2022 <img class="b-lazy" src="/Files/Images/placeholder.gif" data-src="/Admin/Public/GetImage.ashx?width=680&height=314&amp;crop=1&amp;DoNotUpscale=True&amp;Compression=75&amp;image={{image}}" alt="{{title}}" /> 2023 </div> 2024 </div> 2025 {{/if}} 2026 2027 <div class="card u-color-light--bg dw-mod"> 2028 <h3 class="article-list__item-header u-truncate-text dw-mod">{{title}}</h3> 2029 <p class="article__short-summary dw-mod">{{summary}}</p> 2030 </div> 2031 </a> 2032 </div> 2033 {{/Cases}} 2034 </div> 2035 {{/.}} 2036 </script> 2037 </div> 2038 </section> 2039 } 2040 @using System.Reflection 2041 @using Dynamicweb.Rapido.Blocks.Components 2042 @using Dynamicweb.Rapido.Blocks.Components.Articles 2043 @using Dynamicweb.Rapido.Blocks 2044 2045 2046 @* Component for the articles *@ 2047 2048 @helper RenderArticleMenu(ArticleMenu settings) 2049 { 2050 dynamic[] methodParameters = new dynamic[1]; 2051 methodParameters[0] = settings; 2052 MethodInfo customMethod = this.GetType().GetMethod("RenderArticleMenuCustom"); 2053 2054 if (customMethod != null) 2055 { 2056 @customMethod.Invoke(this, methodParameters).ToString(); 2057 } else { 2058 if (!String.IsNullOrEmpty(settings.Title)) { 2059 <div class="u-margin u-border-bottom"> 2060 <h3 class="u-no-margin">@settings.Title</h3> 2061 </div> 2062 } 2063 2064 <ul class="menu-left u-margin-bottom dw-mod"> 2065 @foreach (var item in settings.Items) 2066 { 2067 @RenderArticleMenuItem(item) 2068 } 2069 </ul> 2070 } 2071 } 2072 2073 @helper RenderArticleMenuItem(ArticleMenuItem settings) 2074 { 2075 dynamic[] methodParameters = new dynamic[1]; 2076 methodParameters[0] = settings; 2077 MethodInfo customMethod = this.GetType().GetMethod("RenderArticleMenuItemCustom"); 2078 2079 if (customMethod != null) 2080 { 2081 @customMethod.Invoke(this, methodParameters).ToString(); 2082 } else { 2083 string link = !String.IsNullOrEmpty(settings.Link) ? settings.Link : "#"; 2084 2085 if (!String.IsNullOrEmpty(settings.Title)) { 2086 <li class="menu-left__item dw-mod"> 2087 <a href="@link" onclick="@settings.OnClick" class="menu-left__link dw-mod">@settings.Title</a> 2088 </li> 2089 } 2090 } 2091 } 2092 @using System.Reflection 2093 @using Dynamicweb.Rapido.Blocks.Components 2094 @using Dynamicweb.Rapido.Blocks.Components.Articles 2095 @using Dynamicweb.Rapido.Blocks 2096 2097 @* Component for the articles *@ 2098 2099 @helper RenderArticleList(ArticleList settings) 2100 { 2101 dynamic[] methodParameters = new dynamic[1]; 2102 methodParameters[0] = settings; 2103 MethodInfo customMethod = this.GetType().GetMethod("RenderArticleListCustom"); 2104 2105 if (customMethod != null) 2106 { 2107 @customMethod.Invoke(this, methodParameters).ToString(); 2108 } else { 2109 if (Pageview != null) 2110 { 2111 bool isParagraph = Pageview.CurrentParagraph != null ? true : false; 2112 string[] sortArticlesListBy = new string[2]; 2113 2114 if (isParagraph) { 2115 sortArticlesListBy = Pageview.CurrentParagraph.Item["SortArticlesListBy"] != null && !string.IsNullOrEmpty(Pageview.CurrentParagraph.Item["SortArticlesListBy"].ToString()) ? Pageview.CurrentParagraph.Item["SortArticlesListBy"].ToString().Split('+') : new string[] { "Date", "ASC" }; 2116 } 2117 else { 2118 sortArticlesListBy = Pageview.Item["SortArticlesListBy"] != null && !string.IsNullOrEmpty(Pageview.Item["SortArticlesListBy"].ToString()) ? Pageview.Item["SortArticlesListBy"].ToString().Split('+') : new string[] { "Date", "ASC" }; 2119 } 2120 2121 string sourcePage = settings.SourcePage != null ? settings.SourcePage : Pageview.ID.ToString(); 2122 2123 @RenderItemList(new 2124 { 2125 ItemType = !String.IsNullOrEmpty(settings.ItemType) ? settings.ItemType : "DynamicArticle", 2126 ListSourceType = settings.SourceType, 2127 ListSourcePage = sourcePage, 2128 ItemFieldsList = "*", 2129 Filter = settings.Filter, 2130 ListOrderBy = sortArticlesListBy[0], 2131 ListOrderByDirection = sortArticlesListBy[1], 2132 ListSecondOrderBy = sortArticlesListBy[0] == "Date" ? "InFocusSortId" : "Date", 2133 ListSecondOrderByDirection = "ASC", 2134 IncludeAllChildItems = true, 2135 ListTemplate = settings.Template, 2136 ListPageSize = settings.PageSize.ToString() 2137 }); 2138 } 2139 } 2140 } 2141 @using System.Reflection 2142 @using Dynamicweb.Rapido.Blocks.Components.Articles 2143 2144 2145 @* Component for the articles *@ 2146 2147 @helper RenderArticleSummary(ArticleSummary settings) 2148 { 2149 dynamic[] methodParameters = new dynamic[1]; 2150 methodParameters[0] = settings; 2151 MethodInfo customMethod = this.GetType().GetMethod("RenderArticleSummaryCustom"); 2152 2153 if (customMethod != null) 2154 { 2155 @customMethod.Invoke(this, methodParameters).ToString(); 2156 } else { 2157 if (!String.IsNullOrEmpty(settings.Text)) 2158 { 2159 <div class="article__summary dw-mod">@settings.Text</div> 2160 } 2161 } 2162 } 2163 @using System.Reflection 2164 @using Dynamicweb.Rapido.Blocks.Components 2165 @using Dynamicweb.Rapido.Blocks.Components.Articles 2166 @using Dynamicweb.Rapido.Blocks 2167 2168 @* Component for the articles *@ 2169 2170 @helper RenderArticleListCategoryFilter(ArticleListCategoryFilter settings) 2171 { 2172 dynamic[] methodParameters = new dynamic[1]; 2173 methodParameters[0] = settings; 2174 MethodInfo customMethod = this.GetType().GetMethod("RenderArticleListCategoryFilterCustom"); 2175 2176 if (customMethod != null) 2177 { 2178 @customMethod.Invoke(this, methodParameters).ToString(); 2179 } else { 2180 string pageId = Pageview.ID.ToString(); 2181 string selectedFilter = !String.IsNullOrEmpty(HttpContext.Current.Request.QueryString.Get("sourcePage")) ? HttpContext.Current.Request.QueryString.Get("sourcePage") : Translate("All"); 2182 var query = HttpUtility.ParseQueryString(HttpContext.Current.Request.QueryString.ToString()); 2183 2184 foreach (var option in settings.Categories) 2185 { 2186 selectedFilter = selectedFilter == option.Value ? option.Key : selectedFilter; 2187 } 2188 2189 if (selectedFilter == pageId) 2190 { 2191 selectedFilter = Translate("All"); 2192 } 2193 2194 if (Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet") 2195 { 2196 <div class="u-pull--right u-margin-left"> 2197 <div class="collection u-no-margin"> 2198 <h5>@Translate("Category")</h5> 2199 <input type="checkbox" id="CategorySelector" class="dropdown-trigger" /> 2200 <div class="dropdown u-w180px dw-mod"> 2201 <label class="dropdown__header dropdown__btn dw-mod" for="CategorySelector">@Translate(selectedFilter)</label> 2202 <div class="dropdown__content dw-mod"> 2203 @foreach (var option in settings.Categories) 2204 { 2205 <div class="dropdown__item" onclick="QueryArray.setParametersInCurrentURL({ sourceType: 'Page', sourcePage: '@(option.Key.ToLower() == "all" ? pageId : option.Value)' })">@Translate(option.Key)</div> 2206 } 2207 </div> 2208 <label class="dropdown-trigger-off" for="CategorySelector"></label> 2209 </div> 2210 </div> 2211 </div> 2212 } 2213 else 2214 { 2215 <div class="u-full-width u-margin-bottom"> 2216 <h5 class="u-no-margin">@Translate("Category")</h5> 2217 <input type="checkbox" id="CategorySelector" class="dropdown-trigger" /> 2218 <div class="dropdown u-full-width dw-mod"> 2219 <label class="dropdown__header dropdown__btn dw-mod" for="CategorySelector">@Translate(selectedFilter)</label> 2220 <div class="dropdown__content dw-mod"> 2221 @foreach (var option in settings.Categories) 2222 { 2223 <div class="dropdown__item" onclick="QueryArray.setParametersInCurrentURL({ sourceType: 'Page', sourcePage: '@(option.Key.ToLower() == "all" ? pageId : option.Value)' })">@Translate(option.Key)</div> 2224 } 2225 </div> 2226 <label class="dropdown-trigger-off" for="CategorySelector"></label> 2227 </div> 2228 </div> 2229 } 2230 } 2231 } 2232 @using System.Reflection 2233 @using Dynamicweb.Rapido.Blocks.Components 2234 @using Dynamicweb.Rapido.Blocks.Components.Articles 2235 @using Dynamicweb.Rapido.Blocks 2236 2237 @* Component for the articles *@ 2238 2239 @helper RenderArticleListFilter(ArticleListFilter settings) 2240 { 2241 string selectedFilter = !String.IsNullOrEmpty(HttpContext.Current.Request.QueryString.Get(settings.SystemName)) ? HttpContext.Current.Request.QueryString.Get(settings.SystemName) : Translate("All"); 2242 var query = HttpUtility.ParseQueryString(HttpContext.Current.Request.QueryString.ToString()); 2243 2244 if (settings.Options != null) 2245 { 2246 foreach (var option in settings.Options) 2247 { 2248 selectedFilter = selectedFilter == option.Value ? option.Name : selectedFilter; 2249 } 2250 2251 if (Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet") 2252 { 2253 <div class="u-pull--right u-margin-left"> 2254 <div class="collection u-no-margin"> 2255 <h5>@settings.Label</h5> 2256 <input type="checkbox" id="@(settings.SystemName)Selector" class="dropdown-trigger" /> 2257 <div class="dropdown u-w180px dw-mod"> 2258 <label class="dropdown__header dropdown__btn dw-mod" for="@(settings.SystemName)Selector">@Translate(selectedFilter)</label> 2259 <div class="dropdown__content dw-mod"> 2260 <div class="dropdown__item" onclick="QueryArray.setParameterInCurrentURL('@settings.SystemName', '')">@Translate("All")</div> 2261 @foreach (var option in settings.Options) 2262 { 2263 <div class="dropdown__item" onclick="QueryArray.setParameterInCurrentURL('@settings.SystemName', '@option.Value')">@Translate(option.Name)</div> 2264 } 2265 </div> 2266 <label class="dropdown-trigger-off" for="@(settings.SystemName)Selector"></label> 2267 </div> 2268 </div> 2269 </div> 2270 } 2271 else 2272 { 2273 <div class="u-full-width u-margin-bottom"> 2274 <h5 class="u-no-margin">@settings.Label</h5> 2275 <input type="checkbox" id="@(settings.SystemName)Selector" class="dropdown-trigger" /> 2276 <div class="dropdown u-full-width w-mod"> 2277 <label class="dropdown__header dropdown__btn dw-mod" for="@(settings.SystemName)Selector">@Translate(selectedFilter)</label> 2278 <div class="dropdown__content dw-mod"> 2279 <div class="dropdown__item" onclick="QueryArray.setParameterInCurrentURL('@settings.SystemName', '')">@Translate("All")</div> 2280 @foreach (var option in settings.Options) 2281 { 2282 <div class="dropdown__item" onclick="QueryArray.setParameterInCurrentURL('@settings.SystemName', '@option.Value')">@Translate(option.Name)</div> 2283 } 2284 </div> 2285 <label class="dropdown-trigger-off" for="@(settings.SystemName)Selector"></label> 2286 </div> 2287 </div> 2288 } 2289 } 2290 } 2291 @using System.Reflection 2292 @using Dynamicweb.Rapido.Blocks.Components 2293 @using Dynamicweb.Rapido.Blocks.Components.Articles 2294 @using Dynamicweb.Rapido.Blocks 2295 2296 @* Component for the articles *@ 2297 2298 @helper RenderArticleListSearch(ArticleListSearch settings) 2299 { 2300 dynamic[] methodParameters = new dynamic[1]; 2301 methodParameters[0] = settings; 2302 MethodInfo customMethod = this.GetType().GetMethod("RenderArticleListSearchCustom"); 2303 2304 if (customMethod != null) 2305 { 2306 @customMethod.Invoke(this, methodParameters).ToString(); 2307 } else { 2308 string searchString = !string.IsNullOrEmpty(HttpContext.Current.Request.QueryString.Get("Title")) ? HttpContext.Current.Request.QueryString.Get("Title").Trim('*') : ""; 2309 string className = "u-w340px u-pull--right u-margin-left"; 2310 2311 if (Pageview.Device.ToString() == "Mobile" || Pageview.Device.ToString() == "Tablet") 2312 { 2313 className = "u-full-width"; 2314 } 2315 2316 <div class="typeahead u-color-inherit u-margin-bottom dw-mod @className"> 2317 <input type="text" class="typeahead-search-field u-no-margin dw-mod" placeholder="@Translate("Search in list")" value="@searchString" id="ArticleListSearchInput" onchange="QueryArray.setParameterInCurrentURL('Title', '*' + document.getElementById('ArticleListSearchInput').value + '*')"> 2318 <button type="button" class="btn btn--condensed btn--primary u-no-margin dw-mod"><i class="fas fa-search"></i></button> 2319 </div> 2320 } 2321 } 2322 @using System.Reflection 2323 @using Dynamicweb.Rapido.Blocks.Components 2324 @using Dynamicweb.Rapido.Blocks.Components.Articles 2325 @using Dynamicweb.Rapido.Blocks 2326 2327 @* Component for the articles *@ 2328 2329 @helper RenderArticleListNoResultsInfo(ArticleListNoResultsInfo settings) 2330 { 2331 dynamic[] methodParameters = new dynamic[1]; 2332 methodParameters[0] = settings; 2333 MethodInfo customMethod = this.GetType().GetMethod("RenderArticleListNoResultsInfoCustom"); 2334 2335 if (customMethod != null) 2336 { 2337 @customMethod.Invoke(this, methodParameters).ToString(); 2338 } else { 2339 <div class="u-margin-top--lg u-bold u-ta-center u-bold">@Translate(settings.Message)</div> 2340 } 2341 } 2342 @using System.Reflection 2343 @using Dynamicweb.Rapido.Blocks.Components 2344 @using Dynamicweb.Rapido.Blocks.Components.General 2345 @using Dynamicweb.Rapido.Blocks.Components.Articles 2346 @using Dynamicweb.Rapido.Blocks 2347 @using System.Text.RegularExpressions 2348 2349 @* Component for the articles *@ 2350 2351 @helper RenderArticleListItem(ArticleListItem settings) 2352 { 2353 switch (settings.Type) { 2354 case ArticleListItemType.Card: 2355 @RenderArticleListItemCard(settings); 2356 break; 2357 case ArticleListItemType.List: 2358 @RenderArticleListItemList(settings); 2359 break; 2360 case ArticleListItemType.Simple: 2361 @RenderArticleListItemSimple(settings); 2362 break; 2363 default: 2364 @RenderArticleListItemCard(settings); 2365 break; 2366 } 2367 } 2368 2369 @helper RenderArticleListItemCard(ArticleListItem settings) { 2370 <a href="@settings.Link" class="u-full-height u-color-light--bg"> 2371 <div class="u-color-light--bg u-no-padding dw-mod"> 2372 @if (settings.Logo != null) 2373 { 2374 string backgroundImage = settings.Image != null ? "background-image:url(/Admin/Public/GetImage.ashx?width=992&amp;height=760&amp;crop=0&amp;Compression=75&amp;DoNotUpscale=True&amp;image=" + settings.Image.Path + "); background-size: cover;" : ""; 2375 settings.Logo.ImageDefault.Crop = 5; 2376 settings.Logo.ImageDefault.Width = settings.Logo.ImageDefault.Width == 1920 ? 240 : settings.Logo.ImageDefault.Width; 2377 settings.Logo.ImageDefault.Height = settings.Logo.ImageDefault.Height == 1080 ? 200 : settings.Logo.ImageDefault.Height; 2378 <div class="image-hover__wrapper layered-image layered-image--tinted dw-mod" style="@backgroundImage"> 2379 @if (settings.Stickers != null) 2380 { 2381 if (settings.Stickers.Position != StickersListPosition.Custom) 2382 { 2383 @RenderStickersCollection(settings.Stickers); 2384 } 2385 } 2386 @RenderImage(settings.Logo) 2387 </div> 2388 } else if (settings.Image != null) 2389 { 2390 <div class="flex-img image-hover__wrapper u-position-relative dw-mod"> 2391 @if (settings.Stickers != null) 2392 { 2393 if (settings.Stickers.Position != StickersListPosition.Custom) 2394 { 2395 @RenderStickersCollection(settings.Stickers); 2396 } 2397 } 2398 @RenderImage(settings.Image) 2399 </div> 2400 } 2401 </div> 2402 2403 @if (!String.IsNullOrEmpty(settings.Title) || !String.IsNullOrEmpty(settings.Summary)) 2404 { 2405 <div class="card u-color-light--bg dw-mod"> 2406 @if (settings.Stickers != null) 2407 { 2408 if (settings.Stickers.Position == StickersListPosition.Custom) 2409 { 2410 @RenderStickersCollection(settings.Stickers); 2411 } 2412 } 2413 @if (!String.IsNullOrEmpty(settings.Title)) 2414 { 2415 <h3 class="article-list__item-header u-truncate-text dw-mod">@settings.Title</h3> 2416 } 2417 @if (!String.IsNullOrEmpty(settings.SubTitle)) 2418 { 2419 <div class="article-list__item-micro-info u-truncate-text dw-mod">@settings.SubTitle</div> 2420 } 2421 @if (!String.IsNullOrEmpty(settings.Summary)) 2422 { 2423 <p class="article__short-summary dw-mod">@settings.Summary</p> 2424 } 2425 </div> 2426 } 2427 </a> 2428 } 2429 2430 @helper RenderArticleListItemList(ArticleListItem settings) { 2431 <a href="@settings.Link"> 2432 <div class="grid u-color-light--bg u-no-padding dw-mod"> 2433 <div class="grid__col-md-3"> 2434 <div class="u-color-light--bg u-no-padding dw-mod"> 2435 @if (settings.Logo != null) 2436 { 2437 string backgroundImage = settings.Image != null ? "background-image:url(/Admin/Public/GetImage.ashx?width=992&amp;height=760&amp;crop=0&amp;Compression=75&amp;DoNotUpscale=True&amp;image=" + settings.Image.Path + "); background-size: cover;" : ""; 2438 settings.Logo.ImageDefault.Crop = 5; 2439 settings.Logo.ImageDefault.Width = settings.Logo.ImageDefault.Width == 1920 ? 240 : settings.Logo.ImageDefault.Width; 2440 settings.Logo.ImageDefault.Height = settings.Logo.ImageDefault.Height == 1080 ? 200 : settings.Logo.ImageDefault.Height; 2441 <div class="image-hover__wrapper layered-image layered-image--tinted dw-mod" style="@backgroundImage"> 2442 @if (settings.Stickers != null) 2443 { 2444 if (settings.Stickers.Position != StickersListPosition.Custom) 2445 { 2446 @RenderStickersCollection(settings.Stickers); 2447 } 2448 } 2449 @RenderImage(settings.Logo) 2450 </div> 2451 } else if (settings.Image != null) 2452 { 2453 <div class="flex-img image-hover__wrapper dw-mod"> 2454 @if (settings.Stickers != null) 2455 { 2456 if (settings.Stickers.Position != StickersListPosition.Custom) 2457 { 2458 @RenderStickersCollection(settings.Stickers); 2459 } 2460 } 2461 @RenderImage(settings.Image) 2462 </div> 2463 } 2464 </div> 2465 </div> 2466 2467 @if (!String.IsNullOrEmpty(settings.Title) || !String.IsNullOrEmpty(settings.Summary)) 2468 { 2469 <div class="grid__col-md-9"> 2470 @if (!String.IsNullOrEmpty(settings.Title)) 2471 { 2472 <h3 class="article-list__item-header u-truncate-text dw-mod">@settings.Title</h3> 2473 } 2474 @if (settings.Stickers != null) 2475 { 2476 if (settings.Stickers.Position == StickersListPosition.Custom) 2477 { 2478 @RenderStickersCollection(settings.Stickers); 2479 } 2480 } 2481 @if (!String.IsNullOrEmpty(settings.SubTitle)) 2482 { 2483 <div class="article-list__item-micro-info u-truncate-text dw-mod">@settings.SubTitle</div> 2484 } 2485 @if (!String.IsNullOrEmpty(settings.Summary)) 2486 { 2487 <p class="article__short-summary dw-mod">@settings.Summary</p> 2488 } 2489 </div> 2490 } 2491 </div> 2492 </a> 2493 } 2494 2495 @helper RenderArticleListItemSimple(ArticleListItem settings) { 2496 <a href="@settings.Link" class="u-color-inherit"> 2497 <div class="grid u-color-light--bg u-no-padding dw-mod"> 2498 <div class="grid__col-md-12"> 2499 @if (!String.IsNullOrEmpty(settings.Title)) 2500 { 2501 <div class="article-list-item__header u-truncate-text u-no-margin dw-mod">@settings.Title</div> 2502 } 2503 @if (!String.IsNullOrEmpty(settings.SubTitle)) 2504 { 2505 <div class="article-list__item-micro-info u-truncate-text dw-mod">@settings.SubTitle</div> 2506 } 2507 </div> 2508 </div> 2509 </a> 2510 } 2511 @using System.Reflection 2512 @using Dynamicweb.Rapido.Blocks.Components.Articles 2513 2514 2515 @* Component for the articles *@ 2516 2517 @helper RenderArticleAuthorAndDate(ArticleAuthorAndDate settings) 2518 { 2519 dynamic[] methodParameters = new dynamic[1]; 2520 methodParameters[0] = settings; 2521 MethodInfo customMethod = this.GetType().GetMethod("RenderArticleAuthorAndDateCustom"); 2522 2523 if (customMethod != null) 2524 { 2525 @customMethod.Invoke(this, methodParameters).ToString(); 2526 } else { 2527 <small class="article__subscription"> 2528 @if (!(string.IsNullOrWhiteSpace(settings.Author) && string.IsNullOrWhiteSpace(settings.Date))) 2529 { 2530 <text>@Translate("Written")</text> 2531 } 2532 @if (!string.IsNullOrWhiteSpace(settings.Author)) 2533 { 2534 <text>@Translate("by") @settings.Author</text> 2535 } 2536 @if (!string.IsNullOrWhiteSpace(settings.Date)) 2537 { 2538 <text>@Translate("on") @settings.Date</text> 2539 } 2540 </small> 2541 } 2542 } 2543 @using System.Reflection 2544 @using Dynamicweb.Rapido.Blocks.Components.Articles 2545 2546 2547 @* Component for the articles *@ 2548 2549 @helper RenderArticleLink(ArticleLink settings) 2550 { 2551 dynamic[] methodParameters = new dynamic[1]; 2552 methodParameters[0] = settings; 2553 MethodInfo customMethod = this.GetType().GetMethod("RenderArticleLinkCustom"); 2554 2555 if (customMethod != null) 2556 { 2557 @customMethod.Invoke(this, methodParameters).ToString(); 2558 } else { 2559 if (!String.IsNullOrEmpty(settings.Title)) 2560 { 2561 <div class="grid__cell"> 2562 @RenderButton(settings) 2563 </div> 2564 } 2565 } 2566 } 2567 @using System.Reflection 2568 @using Dynamicweb.Rapido.Blocks 2569 @using Dynamicweb.Rapido.Blocks.Components.Articles 2570 @using Dynamicweb.Rapido.Blocks.Components.General 2571 2572 2573 @* Component for the articles *@ 2574 2575 @helper RenderArticleCarousel(ArticleCarousel settings) 2576 { 2577 dynamic[] methodParameters = new dynamic[1]; 2578 methodParameters[0] = settings; 2579 MethodInfo customMethod = this.GetType().GetMethod(settings.HelperName + "Custom"); 2580 2581 if (customMethod != null) 2582 { 2583 @customMethod.Invoke(this, methodParameters).ToString(); 2584 } else { 2585 <div class="grid"> 2586 <div class="grid__col-12"> 2587 <div class="carousel" id="carousel_@settings.Id"> 2588 <div class="carousel__container js-carousel-slides dw-mod"> 2589 @RenderBlockList(settings.SubBlocks) 2590 </div> 2591 </div> 2592 </div> 2593 </div> 2594 2595 <script> 2596 document.addEventListener("DOMContentLoaded", function () { 2597 new CarouselModule("#carousel_@settings.Id", { 2598 slideTime: 0, 2599 dots: true 2600 }); 2601 }); 2602 </script> 2603 } 2604 } 2605 2606 @helper RenderArticleCarouselSlide(ArticleCarouselSlide settings) 2607 { 2608 dynamic[] methodParameters = new dynamic[1]; 2609 methodParameters[0] = settings; 2610 MethodInfo customMethod = this.GetType().GetMethod(settings.HelperName + "Custom"); 2611 2612 if (customMethod != null) 2613 { 2614 @customMethod.Invoke(this, methodParameters).ToString(); 2615 } 2616 else 2617 { 2618 string imageEngine = "/Admin/Public/GetImage.ashx?"; 2619 2620 string defaultImage = settings.ImageSettings != null ? imageEngine : settings.Image; 2621 if (settings.ImageSettings != null) 2622 { 2623 defaultImage += settings.ImageSettings.Width != 0 ? "Width=" + settings.ImageSettings.Width + "&" : ""; 2624 defaultImage += settings.ImageSettings.Height != 0 ? "Height=" + settings.ImageSettings.Height + "&" : ""; 2625 defaultImage += "Crop=" + settings.ImageSettings.Crop + "&"; 2626 defaultImage += "Compression=" + settings.ImageSettings.Compression + "&"; 2627 defaultImage += "DoNotUpscale=" + settings.ImageSettings.DoNotUpscale.ToString() + "&"; 2628 defaultImage += "FillCanvas=" + settings.ImageSettings.FillCanvas.ToString() + "&"; 2629 } 2630 defaultImage += "&Image=" + settings.Image; 2631 2632 <div class="carousel__slide u-min-h300px u-flex dw-mod" style="background-size:cover; background-image:url('@defaultImage')"> 2633 <a class="article-carousel-item__wrap" href="@settings.Link" title="@settings.Title"> 2634 <h2 class="article-list__item-header u-truncate-text u-color-light dw-mod">@settings.Title</h2> 2635 <div class="article-list__item-info"> 2636 @if (settings.Stickers != null) 2637 { 2638 settings.Stickers.Position = StickersListPosition.Custom; 2639 @RenderStickersCollection(settings.Stickers); 2640 } 2641 2642 <small class="u-margin-top--lg u-color-light"> 2643 @if (!(string.IsNullOrWhiteSpace(settings.Author) && string.IsNullOrWhiteSpace(settings.Date))) 2644 { 2645 <text>@Translate("Written")</text> 2646 } 2647 @if (!string.IsNullOrWhiteSpace(settings.Author)) 2648 { 2649 <text>@Translate("by") @settings.Author</text> 2650 } 2651 @if (!string.IsNullOrWhiteSpace(settings.Date)) 2652 { 2653 <text>@Translate("on") @settings.Date</text> 2654 } 2655 </small> 2656 </div> 2657 2658 <h3 class="article__short-summary u-color-light">@settings.Summary</h3> 2659 </a> 2660 @if (settings.UseFilters == true) 2661 { 2662 <div class="background-image image-filter image-filter--darken dw-mod"></div> 2663 } 2664 </div> 2665 } 2666 } 2667 @using System.Text.RegularExpressions 2668 @using Dynamicweb.Rapido.Blocks.Components 2669 @using Dynamicweb.Rapido.Blocks.Components.General 2670 @using Dynamicweb.Rapido.Blocks.Components.Articles 2671 @using Dynamicweb.Rapido.Blocks 2672 2673 @* Component for the articles *@ 2674 2675 @helper RenderArticleVideo(ArticleVideo settings) 2676 { 2677 dynamic[] methodParameters = new dynamic[1]; 2678 methodParameters[0] = settings; 2679 MethodInfo customMethod = this.GetType().GetMethod("RenderArticleTextCustom"); 2680 2681 if (customMethod != null) 2682 { 2683 @customMethod.Invoke(this, methodParameters).ToString(); 2684 } else { 2685 if (settings.Url != null) 2686 { 2687 //getting video ID from youtube URL 2688 string videoCode = settings.Url; 2689 Regex regex = new Regex(@".be\/(.[^?]*)"); 2690 Match match = regex.Match(videoCode); 2691 string videoId = ""; 2692 if (match.Success) 2693 { 2694 videoId = match.Groups[1].Value; 2695 } 2696 else 2697 { 2698 regex = new Regex(@"v=([^&]+)"); 2699 match = regex.Match(videoCode); 2700 if (match.Success) 2701 { 2702 videoId = match.Groups[1].Value; 2703 } 2704 } 2705 2706 int autoPlay = settings.AutoPlay == "true" ? 1 : 0; 2707 2708 <div class="video-wrapper"> 2709 <div class="js-youtube-video" data-video="@videoId" id="ytPlayer@(Guid.NewGuid().ToString("N"))" data-auto-play="@autoPlay" data-enable-controls="1"></div> 2710 </div> 2711 } 2712 } 2713 } 2714 2715 2716 2717 @* Simple helpers *@ 2718 2719 @*Requires the Gallery ItemType that comes with Rapido*@ 2720 @helper RenderArticleItemGallery(IList<ItemViewModel> gallery) { 2721 if (gallery != null && gallery.Count > 0) 2722 { 2723 int count = 1; 2724 2725 foreach (var item in gallery) 2726 { 2727 if (item.GetFile("ImagePath") != null) 2728 { 2729 string image = item.GetFile("ImagePath").PathUrlEncoded; 2730 string imagePrefix = "/Admin/Public/GetImage.ashx?width=1200&amp;height=820&amp;crop=5&amp;Compression=75&amp;DoNotUpscale=1&amp;image="; 2731 int imagesCount = gallery.Count; 2732 2733 if (count == 1) 2734 { 2735 <label class="gallery" for="GalleryModalTrigger" onclick="Gallery.openImage(this.querySelector('.js-gallery'))"> 2736 <span class="gallery__main-image"> 2737 <img src="/Files/Images/placeholder.gif" data-src="/Admin/Public/GetImage.ashx?width=992&amp;height=760&amp;crop=0&amp;Compression=75&amp;DoNotUpscale=1&amp;image=@image" class="b-lazy flex-img js-gallery" alt="" data-for="FullImage" data-image="@imagePrefix@image" /> 2738 </span> 2739 <span class="gallery__image-counter"> 2740 <i class="fas fa-camera fa-2x"></i> <span class="gallery__image-counter__number">@imagesCount</span> 2741 <span class="gallery__image-counter__text">@Translate("See all") <i class="fas fa-angle-right"></i></span> 2742 </span> 2743 </label> 2744 } 2745 else 2746 { 2747 <div class="u-hidden js-gallery" data-for="FullImage" data-image="@imagePrefix@image"></div> 2748 } 2749 2750 count++; 2751 } 2752 } 2753 } 2754 } 2755 2756 @helper RenderArticleItemGalleryModal() { 2757 <!-- Trigger for the gallery modal --> 2758 <input type="checkbox" id="GalleryModalTrigger" class="modal-trigger" /> 2759 2760 <!-- Gallery modal --> 2761 <div class="modal-container"> 2762 <label for="GalleryModalTrigger" id="GalleryModalOverlay" class="modal-overlay"></label> 2763 <div class="modal modal--full" id="GalleryModal"> 2764 <div class="modal__body modal__body--full"> 2765 <div class="gallery-slider"> 2766 <div class="gallery-slider__image"> 2767 <img src="#" alt="" class="modal--full__img" id="FullImage" /> 2768 </div> 2769 <div class="gallery-slider__image-counter" id="FullImage_counter"></div> 2770 <label class="gallery-slider__close-btn" for="GalleryModalTrigger"></label> 2771 <button class="gallery-slider__previous-btn" id="FullImage_prev" onclick="Gallery.prevImage('FullImage')"></button> 2772 <button class="gallery-slider__next-btn" id="FullImage_next" onclick="Gallery.nextImage('FullImage')"></button> 2773 </div> 2774 </div> 2775 </div> 2776 </div> 2777 } 2778 2779 2780 @helper RenderMobileFilters(List<Block> subBlocks) 2781 { 2782 if (subBlocks.Count > 0) 2783 { 2784 <div class="grid__col-12"> 2785 <input type="checkbox" id="CheckFilters" class="js-remember-state u-hidden" data-expand="CheckFilters" /> 2786 <div class="grid u-margin-bottom dw-mod" data-trigger="CheckFilters"> 2787 @RenderBlockList(subBlocks) 2788 </div> 2789 <label for="CheckFilters" class="btn btn--secondary btn--full dw-mod js-expand-hide" data-trigger="CheckFilters">@Translate("Select filters")</label> 2790 <label for="CheckFilters" class="btn btn--secondary btn--full dw-mod expandable--collapsed" data-trigger="CheckFilters">@Translate("Close filters")</label> 2791 </div> 2792 } 2793 } 2794 2795 @if (File.Exists(HttpContext.Current.Server.MapPath("/Components/Custom/Custom__Components.cshtml"))) 2796 { 2797 <text>@using Dynamicweb.Rapido.Blocks.Components.General 2798 </text> 2799 } 2800 2801 2802 @* Include the Blocks for the page *@ 2803 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 2804 2805 @using System 2806 @using System.Web 2807 @using System.Collections.Generic 2808 @using Dynamicweb.Rapido.Blocks.Extensibility 2809 @using Dynamicweb.Rapido.Blocks 2810 2811 @{ 2812 BlocksPage topSnippetsBlocksPage = BlocksPage.GetBlockPage("Master"); 2813 2814 Block tagManager = new Block() 2815 { 2816 Id = "TagManager", 2817 SortId = 1, 2818 Template = RenderGoogleTagManager() 2819 }; 2820 2821 Block facebookPixel = new Block() 2822 { 2823 Id = "FacebookPixel", 2824 SortId = 2, 2825 Template = RenderFacebookPixel() 2826 }; 2827 2828 topSnippetsBlocksPage.Add(MasterBlockId.MasterTopSnippets, tagManager); 2829 topSnippetsBlocksPage.Add(MasterBlockId.MasterTopSnippets, facebookPixel); 2830 } 2831 2832 @helper RenderGoogleTagManager() { 2833 string GoogleTagManagerID = Model.Area.Item.GetItem("Settings").GetString("GoogleTagManagerID"); 2834 2835 if (!string.IsNullOrWhiteSpace(GoogleTagManagerID)) 2836 { 2837 <script> 2838 (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': 2839 new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], 2840 j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= 2841 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); 2842 })(window,document,'script','dataLayer','@GoogleTagManagerID'); 2843 </script> 2844 <!-- Google Tag Manager (noscript) --> 2845 <noscript> 2846 <iframe src="https://www.googletagmanager.com/ns.html?id=@GoogleTagManagerID" 2847 height="0" width="0" style="display:none;visibility:hidden"></iframe> 2848 </noscript> 2849 <!-- End Google Tag Manager (noscript) --> 2850 } 2851 } 2852 2853 @helper RenderFacebookPixel() { 2854 string FacebookPixelID = Model.Area.Item.GetItem("Settings").GetString("FacebookPixelID"); 2855 2856 if (!string.IsNullOrWhiteSpace(FacebookPixelID)) 2857 { 2858 <!-- Facebook Pixel Code --> 2859 <script> 2860 !function(f,b,e,v,n,t,s) 2861 {if(f.fbq)return;n=f.fbq=function(){n.callMethod? 2862 n.callMethod.apply(n,arguments):n.queue.push(arguments)}; 2863 if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0'; 2864 n.queue=[];t=b.createElement(e);t.async=!0; 2865 t.src=v;s=b.getElementsByTagName(e)[0]; 2866 s.parentNode.insertBefore(t,s)}(window, document,'script', 2867 'https://connect.facebook.net/en_US/fbevents.js'); 2868 fbq('init', '@FacebookPixelID'); 2869 fbq('track', 'PageView'); 2870 </script> 2871 <noscript><img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=@FacebookPixelID&ev=PageView&noscript=1" alt="" /></noscript> 2872 } 2873 } 2874 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 2875 2876 @using System 2877 @using System.Web 2878 @using System.Collections.Generic 2879 @using Dynamicweb.Rapido.Blocks 2880 @using Dynamicweb.Rapido.Blocks.Extensibility 2881 @using Dynamicweb.Security.UserManagement 2882 @using Dynamicweb.Security.UserManagement.ExternalAuthentication 2883 @{ 2884 BlocksPage loginBlocksPage = BlocksPage.GetBlockPage("Master"); 2885 2886 Block loginModal = new Block() 2887 { 2888 Id = "LoginModal", 2889 SortId = 10, 2890 Template = LoginModal() 2891 }; 2892 2893 loginBlocksPage.Add(MasterBlockId.MasterTopSnippets, loginModal); 2894 } 2895 2896 @helper LoginModal() { 2897 int pageId = Model.TopPage.ID; 2898 string userSignedInError = !Model.LogOnFailed ? "" : "checked"; 2899 string userSignedInErrorText = ""; 2900 int signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); 2901 string forgotPasswordPageLink = "/Default.aspx?ID=" + signInProfilePageId + "&LoginAction=Recovery"; 2902 int createAccountPageId = GetPageIdByNavigationTag("CreateAccount"); 2903 2904 if (Model.LogOnFailed) { 2905 switch (Model.LogOnFailedReason) 2906 { 2907 case LogOnFailedReason.PasswordLengthInvalid: 2908 userSignedInErrorText = Translate("Password length is invalid"); 2909 break; 2910 case LogOnFailedReason.IncorrectLogin: 2911 userSignedInErrorText = Translate("Invalid email or password"); 2912 break; 2913 case LogOnFailedReason.ExceededFailedLogOnLimit: 2914 userSignedInErrorText = Translate("You have exceeded the limit of allowed login attempts. The user account is temporarily locked"); 2915 break; 2916 case LogOnFailedReason.LoginLocked: 2917 userSignedInErrorText = Translate("The user account is temporarily locked"); 2918 break; 2919 case LogOnFailedReason.PasswordExpired: 2920 userSignedInErrorText = Translate("The password has expired and needs to be renewed"); 2921 break; 2922 default: 2923 userSignedInErrorText = Translate("An unknown error occured"); 2924 break; 2925 } 2926 } 2927 2928 <!-- Trigger for the login modal --> 2929 <input type="checkbox" id="SignInModalTrigger" class="modal-trigger" @userSignedInError /> 2930 2931 <!-- Login modal --> 2932 <div class="modal-container"> 2933 <label for="SignInModalTrigger" id="SignInModalOverlay" class="modal-overlay"></label> 2934 <div class="modal modal--xs" id="SignInModal"> 2935 <div class="modal__header"> 2936 <h2>@Translate("Sign in")</h2> 2937 </div> 2938 <div class="modal__body"> 2939 <form method="post" id="LoginForm" class="u-no-margin"> 2940 <input type="hidden" name="ID" value="@pageId" /> 2941 <input type="hidden" name="DWExtranetUsernameRemember" value="True" /> 2942 <input type="hidden" name="DWExtranetPasswordRemember" value="True" /> 2943 <input type="text" class="u-full-width" id="LoginUsername" name="username" placeholder="@Translate("Email")" /> 2944 <input type="password" class="u-full-width" id="LoginPassword" name="password" placeholder="@Translate("Password")" /> 2945 <div class="field-error dw-mod">@userSignedInErrorText</div> 2946 2947 <div class="form__field-group dw-mod"> 2948 <input type="checkbox" id="LoginRememberMe" name="Autologin" checked="checked" value="True" class="form__control"> 2949 <label for="LoginRememberMe"> 2950 @Translate("Remember me", "Remember me") 2951 </label> 2952 </div> 2953 2954 <button type="submit" class="btn btn--primary btn--full dw-mod" name="LoginAction" value="Login" onclick="Buttons.LockButton(event)">@Translate("Sign in")</button> 2955 @{ 2956 ProviderCollection providers = Provider.GetActiveProviders(); 2957 } 2958 2959 @foreach(Provider LoginProvider in providers) 2960 { 2961 var ProviderName = LoginProvider.Name.ToLower(); 2962 <a href="/Admin/Public/Social/ExternalLogin.aspx?action=login&providerID=@LoginProvider.ID" title="@LoginProvider.Name" class="btn btn--clean btn--condensed u-color-@ProviderName dw-mod"><i class="fab fa-@ProviderName fa-1_5x"></i></a> 2963 } 2964 2965 <a class="btn btn--link-clean dw-mod" href="@forgotPasswordPageLink">@Translate("Forgot your password?", "Forgot your password?")</a> 2966 2967 <a class="btn btn--link-clean dw-mod" href="/default.aspx?ID=@createAccountPageId">@Translate("Create account")?</a> 2968 </form> 2969 </div> 2970 </div> 2971 </div> 2972 } 2973 2974 @if (Pageview.Device.ToString() == "Mobile" || Pageview.Device.ToString() == "Tablet") 2975 { 2976 <text>@inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 2977 2978 @using System 2979 @using System.Web 2980 @using System.Collections.Generic 2981 @using Dynamicweb.Rapido.Blocks.Extensibility 2982 @using Dynamicweb.Rapido.Blocks 2983 2984 2985 @functions { 2986 BlocksPage mobileHeaderBlocksPage = BlocksPage.GetBlockPage("Master"); 2987 } 2988 2989 @{ 2990 var mobileTopLayout = !String.IsNullOrEmpty(Model.Area.Item.GetItem("Layout").GetItem("MobileTop").GetString("Design")) ? Model.Area.Item.GetItem("Layout").GetItem("MobileTop").GetList("Design").SelectedValue : "nav-left"; 2991 bool hideSearch = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("HideSearch"); 2992 bool hideCart = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("HideCart"); 2993 bool hideSignIn = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("HideSignIn"); 2994 2995 2996 Block mobileHeader = new Block() 2997 { 2998 Id = "MobileTop", 2999 SortId = 10, 3000 Template = RenderMobileTop(), 3001 SkipRenderBlocksList = true 3002 }; 3003 mobileHeaderBlocksPage.Add(MasterBlockId.MasterHeader, mobileHeader); 3004 3005 Block mobileHeaderNavigation = new Block() 3006 { 3007 Id = "MobileHeaderNavigation", 3008 SortId = 10, 3009 Template = RenderMobileHeaderNavigation(), 3010 SkipRenderBlocksList = true, 3011 BlocksList = new List<Block> { 3012 new Block { 3013 Id = "MobileHeaderNavigationTrigger", 3014 SortId = 10, 3015 Template = RenderMobileHeaderNavigationTrigger() 3016 } 3017 } 3018 }; 3019 mobileHeaderBlocksPage.Add("MobileTop", mobileHeaderNavigation); 3020 3021 3022 Block mobileHeaderLogo = new Block() 3023 { 3024 Id = "MobileHeaderLogo", 3025 SortId = 20, 3026 Template = RenderMobileHeaderLogo(), 3027 SkipRenderBlocksList = true 3028 }; 3029 mobileHeaderBlocksPage.Add("MobileTop", mobileHeaderLogo); 3030 3031 Block mobileHeaderActions = new Block() 3032 { 3033 Id = "MobileHeaderActions", 3034 SortId = 30, 3035 Template = RenderMobileTopActions(), 3036 SkipRenderBlocksList = true 3037 }; 3038 mobileHeaderBlocksPage.Add("MobileTop", mobileHeaderActions); 3039 3040 if (hideSearch == false) 3041 { 3042 Block mobileHeaderSearch = new Block 3043 { 3044 Id = "MobileHeaderSearch", 3045 SortId = 10, 3046 Template = RenderMobileTopSearch() 3047 }; 3048 mobileHeaderBlocksPage.Add("MobileHeaderActions", mobileHeaderSearch); 3049 } 3050 3051 Block mobileHeaderMiniCart; 3052 3053 if (!hideCart) 3054 { 3055 mobileHeaderMiniCart = new Block 3056 { 3057 Id = "MobileHeaderMiniCart", 3058 SortId = 20, 3059 Template = RenderMobileTopMiniCart() 3060 }; 3061 3062 Block miniCartCounterScriptTemplate = new Block 3063 { 3064 Id = "MiniCartCounterScriptTemplate", 3065 Template = RenderMobileMiniCartCounterContent() 3066 }; 3067 BlocksPage.GetBlockPage("Master").Add("MasterBottomSnippets", miniCartCounterScriptTemplate); 3068 } else { 3069 mobileHeaderMiniCart = new Block 3070 { 3071 Id = "MobileHeaderMiniCart", 3072 SortId = 20 3073 }; 3074 } 3075 3076 if (!hideSearch) { 3077 Block mobileHeaderSearchBar = new Block() 3078 { 3079 Id = "MobileHeaderSearchBar", 3080 SortId = 30, 3081 Template = RenderMobileTopSearchBar() 3082 }; 3083 mobileHeaderBlocksPage.Add(MasterBlockId.MasterHeader, mobileHeaderSearchBar); 3084 } 3085 3086 switch (mobileTopLayout) 3087 { 3088 case "nav-left": 3089 mobileHeaderNavigation.SortId = 10; 3090 mobileHeaderLogo.SortId = 20; 3091 mobileHeaderActions.SortId = 30; 3092 mobileHeaderBlocksPage.Add("MobileHeaderActions", mobileHeaderMiniCart); 3093 break; 3094 case "nav-right": 3095 mobileHeaderLogo.SortId = 10; 3096 mobileHeaderActions.SortId = 20; 3097 mobileHeaderNavigation.SortId = 30; 3098 mobileHeaderBlocksPage.Add("MobileHeaderActions", mobileHeaderMiniCart); 3099 break; 3100 case "nav-search-left": 3101 mobileHeaderNavigation.SortId = 10; 3102 mobileHeaderLogo.SortId = 20; 3103 mobileHeaderActions.SortId = 30; 3104 mobileHeaderBlocksPage.Add("MobileHeaderNavigation", mobileHeaderMiniCart); 3105 break; 3106 case "search-left": 3107 mobileHeaderActions.SortId = 10; 3108 mobileHeaderLogo.SortId = 20; 3109 mobileHeaderNavigation.SortId = 30; 3110 mobileHeaderMiniCart.SortId = 0; 3111 mobileHeaderBlocksPage.Add("MobileHeaderNavigation", mobileHeaderMiniCart); 3112 break; 3113 } 3114 } 3115 3116 3117 @helper RenderMobileTop() { 3118 List<Block> subBlocks = this.mobileHeaderBlocksPage.GetBlockListById("MobileTop").OrderBy(item => item.SortId).ToList(); 3119 3120 <nav class="main-navigation-mobile dw-mod"> 3121 <div class="center-container top-container__center-container dw-mod"> 3122 <div class="grid grid--align-center"> 3123 @RenderBlockList(subBlocks) 3124 </div> 3125 </div> 3126 </nav> 3127 } 3128 3129 @helper RenderMobileHeaderNavigation() { 3130 List<Block> subBlocks = this.mobileHeaderBlocksPage.GetBlockListById("MobileHeaderNavigation").OrderBy(item => item.SortId).ToList(); 3131 3132 <div class="grid__col-auto-width"> 3133 <ul class="menu dw-mod"> 3134 @RenderBlockList(subBlocks) 3135 </ul> 3136 </div> 3137 } 3138 3139 @helper RenderMobileHeaderNavigationTrigger() { 3140 <li class="menu__item menu__item--horizontal menu__item--top-level dw-mod"> 3141 <label for="MobileNavTrigger" class="mobile-nav-trigger-button menu__link menu__link--icon menu__link--mobile dw-mod"></label> 3142 </li> 3143 } 3144 3145 @helper RenderMobileHeaderLogo() { 3146 List<Block> subBlocks = this.mobileHeaderBlocksPage.GetBlockListById("MobileHeaderLogo").OrderBy(item => item.SortId).ToList(); 3147 3148 var mobileTopLayout = !String.IsNullOrEmpty(Model.Area.Item.GetItem("Layout").GetItem("MobileTop").GetString("Design")) ? Model.Area.Item.GetItem("Layout").GetItem("MobileTop").GetList("Design").SelectedValue : "nav-left"; 3149 string centeredLogo = mobileTopLayout != "nav-right" ? "u-ta-center" : ""; 3150 string firstPageId = Model.Area.FirstActivePage.ID.ToString(); 3151 string businessName = Model.Area.Item.GetItem("Settings").GetString("BusinessName"); 3152 3153 string mobileLogo = "/Files/Images/logo-dynamicweb.png"; 3154 if (Model.Area.Item.GetItem("Layout").GetItem("MobileTop") != null && Model.Area.Item.GetItem("Layout").GetItem("MobileTop").GetFile("Logo") != null) 3155 { 3156 mobileLogo = Model.Area.Item.GetItem("Layout").GetItem("MobileTop").GetFile("Logo").PathUrlEncoded; 3157 } 3158 3159 if (Path.GetExtension(mobileLogo).ToLower() != ".svg") 3160 { 3161 mobileLogo = "/Admin/Public/GetImage.ashx?height=40&amp;crop=5&amp;Compression=75&amp;image=" + mobileLogo; 3162 } 3163 else 3164 { 3165 mobileLogo = HttpUtility.UrlDecode(mobileLogo); 3166 } 3167 3168 <div class="grid__col-auto grid__col--bleed"> 3169 <div class="grid__cell @centeredLogo"> 3170 <a href="/" class="logo logo--mobile u-inline-block dw-mod"> 3171 <img class="grid__cell-img logo__img logo__img--mobile dw-mod" src="@mobileLogo" alt="@businessName" /> 3172 </a> 3173 <div id="div-mobile-header" class="grid__cell-img logo__img logo__img--mobile dw-mod" style="margin-right:30px;float:right;">Superhome Center</div> 3174 </div> 3175 3176 @RenderBlockList(subBlocks) 3177 </div> 3178 } 3179 3180 @helper RenderMobileTopActions() { 3181 List<Block> subBlocks = this.mobileHeaderBlocksPage.GetBlockListById("MobileHeaderActions").OrderBy(item => item.SortId).ToList(); 3182 3183 <div class="grid__col-auto-width"> 3184 <ul class="menu dw-mod"> 3185 @RenderBlockList(subBlocks) 3186 </ul> 3187 </div> 3188 } 3189 3190 @helper RenderMobileTopSearch() { 3191 <li class="menu__item menu__item--horizontal menu__item--top-level dw-mod"> 3192 <label for="MobileSearchTrigger" class="menu__link menu__link--icon menu__link--mobile dw-mod"> 3193 <i class="@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SearchIcon").SelectedValue fa-1_5x"></i> 3194 </label> 3195 </li> 3196 } 3197 3198 @helper RenderMobileTopMiniCart() { 3199 int miniCartFeedPageId = GetPageIdByNavigationTag("MiniCartFeed"); 3200 int cartPageId = GetPageIdByNavigationTag("CartPage"); 3201 double cartProductsCount = Model.Cart.TotalProductsCount; 3202 3203 <li class="menu__item menu__item--horizontal menu__item--top-level dw-mod" id="miniCartWrapper" onmouseenter="Cart.UpdateMiniCart('miniCartWrapper', 'miniCart', 'cartCounter', '/Default.aspx?ID=@miniCartFeedPageId&feedType=MiniCart')"> 3204 <div class="mini-cart dw-mod"> 3205 <a href="/Default.aspx?ID=@cartPageId&Purge=True" id="miniCartCounterWrap" class="menu__link menu__link--icon menu__link--mobile dw-mod js-mini-cart-button"> 3206 <div class="u-inline u-position-relative"> 3207 <i class="@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("CartIcon").SelectedValue fa-1_5x"></i> 3208 <div class="mini-cart__counter dw-mod"> 3209 <div class="js-handlebars-root js-mini-cart-counter" id="cartCounter" data-template="MiniCartCounterContent" data-json-feed="/Default.aspx?ID=@miniCartFeedPageId&feedType=Counter" data-init-onload="false" data-preloader="false"> 3210 <div class="js-mini-cart-counter-content"> 3211 @cartProductsCount 3212 </div> 3213 </div> 3214 </div> 3215 </div> 3216 </a> 3217 @if (Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet") 3218 { 3219 <div class="mini-cart-dropdown js-handlebars-root js-mini-cart dw-mod" id="miniCart" data-template="MiniCartContent" data-cart-id="@miniCartFeedPageId" data-json-feed="/Default.aspx?ID=@miniCartFeedPageId&feedType=MiniCart" data-init-onload="false"></div> 3220 } 3221 </div> 3222 </li> 3223 } 3224 3225 @helper RenderMobileTopSearchBar() 3226 { 3227 string searchFeedId = ""; 3228 string searchSecondFeedId = ""; 3229 int groupsFeedId; 3230 int productsPageId = GetPageIdByNavigationTag("ProductsPage"); 3231 string contentSearchPageLink = GetPageIdByNavigationTag("ContentSearchResults") + "&Areaid=" + Model.Area.ID; 3232 string resultPageLink; 3233 string searchPlaceholder; 3234 string searchType = "product-search"; 3235 string searchTemplate; 3236 string searchContentTemplate = ""; 3237 string searchValue = HttpContext.Current.Request.QueryString.Get("Search") ?? ""; 3238 bool showGroups = true; 3239 3240 if (Model.Area.Item.GetItem("Layout").GetList("TopSearch").SelectedValue == "contentSearch") 3241 { 3242 searchFeedId = GetPageIdByNavigationTag("ContentSearchFeed") + "&Areaid=" + Model.Area.ID + "&pagesOnly=true"; 3243 resultPageLink = contentSearchPageLink; 3244 searchPlaceholder = Translate("Search page"); 3245 groupsFeedId = 0; 3246 searchType = "content-search"; 3247 searchTemplate = "SearchPagesTemplate"; 3248 showGroups = false; 3249 } 3250 else if (Model.Area.Item.GetItem("Layout").GetList("TopSearch").SelectedValue == "combinedSearch") 3251 { 3252 searchFeedId = productsPageId + "&feed=true"; 3253 searchSecondFeedId = GetPageIdByNavigationTag("ContentSearchFeed") + "&Areaid=" + Model.Area.ID + "&pagesOnly=true"; 3254 resultPageLink = Converter.ToString(productsPageId); 3255 searchPlaceholder = Translate("Search products or pages"); 3256 groupsFeedId = GetPageIdByNavigationTag("ProductGroupsFeed"); 3257 searchType = "combined-search"; 3258 searchTemplate = "SearchProductsTemplateWrap"; 3259 searchContentTemplate = "SearchPagesTemplateWrap"; 3260 showGroups = Model.Area.Item.GetItem("Layout").GetBoolean("ShowGroupsSelector"); 3261 } 3262 else 3263 { 3264 resultPageLink = Converter.ToString(productsPageId); 3265 searchFeedId = productsPageId + "&feed=true"; 3266 groupsFeedId = GetPageIdByNavigationTag("ProductGroupsFeed"); 3267 searchPlaceholder = Translate("Search products"); 3268 searchTemplate = "SearchProductsTemplate"; 3269 searchType = "product-search"; 3270 showGroups = Model.Area.Item.GetItem("Layout").GetBoolean("ShowGroupsSelector"); 3271 } 3272 3273 3274 <input type="checkbox" id="MobileSearchTrigger" class="mobile-search-trigger" /> 3275 3276 <div class="main-navigation-mobile typeahead-mobile dw-mod"> 3277 <div class="center-container top-container__center-container dw-mod"> 3278 <div class="grid"> 3279 <div class="grid__col-auto"> 3280 <div class="typeahead-mobile__search-field dw-mod js-typeahead" data-page-size="@(searchType == "combined-search" ? 4 : 8)" id="MobileProductSearch" data-search-feed-id="@searchFeedId" data-search-second-feed-id="@searchSecondFeedId" data-result-page-id="@resultPageLink" data-search-type="@searchType"> 3281 <input type="text" class="js-typeahead-search-field u-w160px u-no-margin" placeholder="@searchPlaceholder" value="@searchValue"> 3282 @if (string.IsNullOrEmpty(searchSecondFeedId)) 3283 { 3284 <ul class="dropdown dropdown--absolute-position u-min-w220px u-full-width js-handlebars-root js-typeahead-search-content dw-mod" id="MobileProductSearchBarContent" data-template="@searchTemplate" data-json-feed="/Default.aspx?ID=@searchFeedId&feedType=productsOnly" data-init-onload="false"></ul> 3285 } 3286 else 3287 { 3288 <div class="dropdown dropdown--absolute-position dropdown--combined grid dropdown--combined-mobile grid"> 3289 <div class="js-handlebars-root js-typeahead-search-content grid__col-sm-7 grid__col--bleed-y" id="MobileProductSearchBarContent" data-template="@searchTemplate" data-json-feed="/Default.aspx?ID=@searchFeedId&feedType=productsOnly" data-init-onload="false"></div> 3290 <div class="js-handlebars-root js-typeahead-additional-search-content grid__col-sm-5 grid__col--bleed-y" id="MobileContentSearchBarContent" data-template="@searchContentTemplate" data-json-feed="/Default.aspx?ID=@searchSecondFeedId" data-init-onload="false"></div> 3291 </div> 3292 } 3293 <button type="button" class="btn btn--condensed btn--primary u-no-margin dw-mod js-typeahead-enter-btn"><i class="@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SearchIcon").SelectedValue"></i></button> 3294 </div> 3295 </div> 3296 <div class="grid__col-auto-width"> 3297 <ul class="menu dw-mod"> 3298 <li class="menu__item menu__item--horizontal menu__item--top-level dw-mod"> 3299 <label for="MobileSearchTrigger" class="menu__link menu__link--icon menu__link--mobile dw-mod"> 3300 <i class="fas fa-times fa-1_5x"></i> 3301 </label> 3302 </li> 3303 </ul> 3304 </div> 3305 </div> 3306 </div> 3307 </div> 3308 } 3309 3310 @helper RenderMobileMiniCartCounterContent() 3311 { 3312 bool showPrice = Model.Area.Item.GetItem("Ecommerce").GetItem("MiniCart").GetBoolean("ShowPrice"); 3313 string counterPosition = Model.Area.Item.GetItem("Ecommerce").GetItem("MiniCart").GetList("CounterPosition") != null ? Model.Area.Item.GetItem("Ecommerce").GetItem("MiniCart").GetList("CounterPosition").SelectedValue : "right"; 3314 bool showPriceInMiniCartCounter = Pageview.Device.ToString() != "Mobile" && counterPosition == "right" && showPrice; 3315 3316 <script id="MiniCartCounterContent" type="text/x-template"> 3317 {{#.}} 3318 <div class="js-mini-cart-counter-content dw-mod"> 3319 @if (showPriceInMiniCartCounter) 3320 { 3321 @Translate("Cart")<text>({{numberofproducts}}) {{totalprice}}</text> 3322 } 3323 else 3324 { 3325 <text>{{numberofproducts}}</text> 3326 } 3327 </div> 3328 {{/.}} 3329 </script> 3330 } 3331 </text> 3332 <text>@inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 3333 3334 @using System 3335 @using System.Web 3336 @using System.Collections.Generic 3337 @using Dynamicweb.Rapido.Blocks.Extensibility 3338 @using Dynamicweb.Rapido.Blocks 3339 3340 @functions { 3341 BlocksPage mobileNavigationBlocksPage = BlocksPage.GetBlockPage("Master"); 3342 } 3343 3344 @{ 3345 bool navigationItemsHideSignIn = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("HideSignIn"); 3346 bool hideCreateAccountLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideCreateAccount"); 3347 bool hideMyProfileLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideProfile"); 3348 bool hideMyOrdersLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideOrders"); 3349 bool hideMySavedCardsLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideSavedCards"); 3350 bool hideMyFavoritesLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideFavorites"); 3351 3352 Block mobileNavigation = new Block() 3353 { 3354 Id = "MobileNavigation", 3355 SortId = 10, 3356 Template = MobileNavigation(), 3357 SkipRenderBlocksList = true 3358 }; 3359 mobileNavigationBlocksPage.Add(MasterBlockId.MasterTopSnippets, mobileNavigation); 3360 3361 if (Model.CurrentUser.ID > 0 && !hideMyProfileLink) 3362 { 3363 Block mobileNavigationSignIn = new Block 3364 { 3365 Id = "MobileNavigationSignIn", 3366 SortId = 10, 3367 Template = RenderMobileNavigationSignIn() 3368 }; 3369 mobileNavigationBlocksPage.Add("MobileNavigation", mobileNavigationSignIn); 3370 } 3371 3372 Block mobileNavigationMenu = new Block 3373 { 3374 Id = "MobileNavigationMenu", 3375 SortId = 20, 3376 Template = RenderMobileNavigationMenu() 3377 }; 3378 mobileNavigationBlocksPage.Add("MobileNavigation", mobileNavigationMenu); 3379 3380 Block mobileNavigationActions = new Block 3381 { 3382 Id = "MobileNavigationActions", 3383 SortId = 30, 3384 Template = RenderMobileNavigationActions(), 3385 SkipRenderBlocksList = true 3386 }; 3387 mobileNavigationBlocksPage.Add("MobileNavigation", mobileNavigationActions); 3388 3389 if (!navigationItemsHideSignIn) 3390 { 3391 if (Model.CurrentUser.ID <= 0) 3392 { 3393 Block mobileNavigationSignInAction = new Block 3394 { 3395 Id = "MobileNavigationSignInAction", 3396 SortId = 10, 3397 Template = RenderMobileNavigationSignInAction() 3398 }; 3399 mobileNavigationBlocksPage.Add("MobileNavigationActions", mobileNavigationSignInAction); 3400 3401 if (!hideCreateAccountLink) 3402 { 3403 Block mobileNavigationCreateAccountAction = new Block 3404 { 3405 Id = "MobileNavigationCreateAccountAction", 3406 SortId = 20, 3407 Template = RenderMobileNavigationCreateAccountAction() 3408 }; 3409 mobileNavigationBlocksPage.Add("MobileNavigationActions", mobileNavigationCreateAccountAction); 3410 } 3411 } 3412 else 3413 { 3414 if (!hideMyOrdersLink) 3415 { 3416 Block mobileNavigationOrdersAction = new Block 3417 { 3418 Id = "MobileNavigationOrdersAction", 3419 SortId = 20, 3420 Template = RenderMobileNavigationOrdersAction() 3421 }; 3422 mobileNavigationBlocksPage.Add("MobileNavigationActions", mobileNavigationOrdersAction); 3423 } 3424 if (!hideMyFavoritesLink) 3425 { 3426 Block mobileNavigationFavoritesAction = new Block 3427 { 3428 Id = "MobileNavigationFavoritesAction", 3429 SortId = 30, 3430 Template = RenderMobileNavigationFavoritesAction() 3431 }; 3432 mobileNavigationBlocksPage.Add("MobileNavigationActions", mobileNavigationFavoritesAction); 3433 } 3434 if (!hideMySavedCardsLink) 3435 { 3436 Block mobileNavigationSavedCardsAction = new Block 3437 { 3438 Id = "MobileNavigationFavoritesAction", 3439 SortId = 30, 3440 Template = RenderMobileNavigationSavedCardsAction() 3441 }; 3442 mobileNavigationBlocksPage.Add("MobileNavigationActions", mobileNavigationSavedCardsAction); 3443 } 3444 3445 Block mobileNavigationSignOutAction = new Block 3446 { 3447 Id = "MobileNavigationSignOutAction", 3448 SortId = 40, 3449 Template = RenderMobileNavigationSignOutAction() 3450 }; 3451 mobileNavigationBlocksPage.Add("MobileNavigationActions", mobileNavigationSignOutAction); 3452 } 3453 } 3454 3455 if (Model.Languages.Count > 1) 3456 { 3457 Block mobileNavigationLanguagesAction = new Block 3458 { 3459 Id = "MobileNavigationLanguagesAction", 3460 SortId = 50, 3461 Template = RenderMobileNavigationLanguagesAction() 3462 }; 3463 mobileNavigationBlocksPage.Add("MobileNavigationActions", mobileNavigationLanguagesAction); 3464 } 3465 } 3466 3467 3468 @helper MobileNavigation() 3469 { 3470 List<Block> subBlocks = this.mobileNavigationBlocksPage.GetBlockListById("MobileNavigation").OrderBy(item => item.SortId).ToList(); 3471 3472 bool onlyPreview = Model.Area.Item.GetItem("Ecommerce").GetBoolean("OnlyPreviewForAnonymous") && Model.CurrentUser.ID == 0; 3473 int miniCartFeedPageId = GetPageIdByNavigationTag("MiniCartFeed"); 3474 int cartFeedPageId = GetPageIdByNavigationTag("CartOrderlinesFeed"); 3475 string mobileTopDesign = Model.Area.Item.GetItem("Layout").GetItem("MobileTop").GetList("Design") != null ? Model.Area.Item.GetItem("Layout").GetItem("MobileTop").GetList("Design").SelectedValue : "nav-left"; 3476 string position = mobileTopDesign == "nav-left" || mobileTopDesign == "nav-search-left" ? "left" : "right"; 3477 3478 <!-- Trigger for mobile navigation --> 3479 <input type="checkbox" id="MobileNavTrigger" class="mobile-nav-trigger mobile-nav-trigger--@position" autocomplete="off" /> 3480 3481 <!-- Mobile navigation --> 3482 <nav class="mobile-navigation mobile-navigation--@position dw-mod"> 3483 <div class="mobile-navigation__wrapper" id="mobileNavigationWrapper"> 3484 @RenderBlockList(subBlocks) 3485 </div> 3486 </nav> 3487 3488 <label class="mobile-nav-trigger-off" for="MobileNavTrigger"></label> 3489 3490 if (!onlyPreview) 3491 { 3492 <div class="u-visually-hidden js-handlebars-root js-mini-cart" id="miniCart" data-template="MiniCartContent" data-cart-id="@cartFeedPageId" data-json-feed="/Default.aspx?ID=@miniCartFeedPageId&feedType=MiniCart" data-init-onload="false"></div> 3493 } 3494 } 3495 3496 @helper RenderMobileNavigationSignIn() 3497 { 3498 int signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); 3499 int myProfilePageId = GetPageIdByNavigationTag("CustomerProfile"); 3500 string linkStart = Model.CurrentUser.ID <= 0 ? "/Default.aspx?ID=" + signInProfilePageId + "&RedirectPageId=" : "/Default.aspx?ID="; 3501 string myProfilePageLink = linkStart + myProfilePageId; 3502 string userName = Model.CurrentUser.FirstName ?? ""; 3503 userName += " " + (Model.CurrentUser.LastName ?? ""); 3504 userName += userName == "" && Model.CurrentUser.UserName != null ? Model.CurrentUser.UserName : ""; 3505 3506 <ul class="menu menu-mobile"> 3507 <li class="menu-mobile__item"> 3508 <a href="@myProfilePageLink" class="menu-mobile__link dw-mod"><i class="@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SignInProfileIcon").SelectedValue menu-mobile__link-icon"></i> @userName</a> 3509 </li> 3510 </ul> 3511 } 3512 3513 @helper RenderMobileNavigationMenu() 3514 { 3515 bool isSlidesDesign = Model.Area.Item.GetItem("Layout").GetItem("MobileNavigation").GetList("Design").SelectedValue == "Slides"; 3516 string menuTemplate = isSlidesDesign ? "BaseMenuForMobileSlides.xslt" : "BaseMenuForMobileExpandable.xslt"; 3517 string levels = !String.IsNullOrEmpty(Model.Area.Item.GetItem("Layout").GetItem("MobileNavigation").GetString("Levels")) ? Model.Area.Item.GetItem("Layout").GetItem("MobileNavigation").GetString("Levels") : "3"; 3518 bool renderPagesInToolBar = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("RenderPagesInToolBar"); 3519 int startLevel = renderPagesInToolBar ? 1 : 0; 3520 3521 @RenderNavigation(new 3522 { 3523 id = "mobilenavigation", 3524 cssclass = "menu menu-mobile dwnavigation", 3525 startLevel = @startLevel, 3526 ecomStartLevel = @startLevel + 1, 3527 endlevel = @levels, 3528 expandmode = "all", 3529 template = @menuTemplate 3530 }) 3531 3532 if (isSlidesDesign) 3533 { 3534 <script> 3535 function goToLevel(level) { 3536 document.getElementById('mobileNavigationWrapper').style.left = -(level * 100) + "%"; 3537 } 3538 3539 document.addEventListener('DOMContentLoaded', function () { 3540 goToLevel(document.getElementById('mobileNavigationWrapper').querySelectorAll('input[type=radio]:checked').length); 3541 }); 3542 </script> 3543 } 3544 3545 if (renderPagesInToolBar) 3546 { 3547 @RenderNavigation(new 3548 { 3549 id = "topToolsMobileNavigation", 3550 cssclass = "menu menu-mobile dwnavigation", 3551 template = "ToolsMenuForMobile.xslt" 3552 }) 3553 } 3554 } 3555 3556 @helper RenderMobileNavigationActions() 3557 { 3558 List<Block> subBlocks = this.mobileNavigationBlocksPage.GetBlockListById("MobileNavigationActions").OrderBy(item => item.SortId).ToList(); ; 3559 3560 <ul class="menu menu-mobile"> 3561 @RenderBlockList(subBlocks) 3562 </ul> 3563 } 3564 3565 @helper RenderMobileNavigationSignInAction() 3566 { 3567 <li class="menu-mobile__item"> 3568 <label for="SignInModalTrigger" onclick="document.getElementById('MobileNavTrigger').checked = false;" class="menu-mobile__link dw-mod menu-mobile__link--highlighted"><i class="@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SignInProfileIcon").SelectedValue menu-mobile__link-icon"></i> @Translate("Sign in")</label> 3569 </li> 3570 } 3571 3572 @helper RenderMobileNavigationCreateAccountAction() 3573 { 3574 int createAccountPageId = GetPageIdByNavigationTag("CreateAccount"); 3575 3576 <li class="menu-mobile__item"> 3577 <a class="menu-mobile__link menu-mobile__link--highlighted dw-mod" href="/Default.aspx?ID=@createAccountPageId"><i class="@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SignInProfileIcon").SelectedValue menu-mobile__link-icon"></i> @Translate("Create account")</a> 3578 </li> 3579 } 3580 3581 @helper RenderMobileNavigationProfileAction() 3582 { 3583 int signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); 3584 string linkStart = Model.CurrentUser.ID <= 0 ? "/Default.aspx?ID=" + signInProfilePageId + "&RedirectPageId=" : "/Default.aspx?ID="; 3585 int myProfilePageId = GetPageIdByNavigationTag("CustomerProfile"); 3586 string myProfilePageLink = linkStart + myProfilePageId; 3587 3588 <li class="menu-mobile__item"> 3589 <a href="@myProfilePageLink" class="menu-mobile__link menu-mobile__link--highlighted dw-mod"><i class="@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SignInProfileIcon").SelectedValue menu-mobile__link-icon"></i> @Translate("My Profile")</a> 3590 </li> 3591 } 3592 3593 @helper RenderMobileNavigationOrdersAction() 3594 { 3595 int signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); 3596 string linkStart = Model.CurrentUser.ID <= 0 ? "/Default.aspx?ID=" + signInProfilePageId + "&RedirectPageId=" : "/Default.aspx?ID="; 3597 int myOrdersPageId = GetPageIdByNavigationTag("CustomerOrders"); 3598 string myOrdersPageLink = linkStart + myOrdersPageId; 3599 string ordersIcon = "fas fa-list"; 3600 3601 <li class="menu-mobile__item"> 3602 <a href="@myOrdersPageLink" class="menu-mobile__link menu-mobile__link--highlighted dw-mod"><i class="@ordersIcon menu-mobile__link-icon"></i> @Translate("My Orders")</a> 3603 </li> 3604 } 3605 3606 @helper RenderMobileNavigationFavoritesAction() 3607 { 3608 int signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); 3609 string linkStart = Model.CurrentUser.ID <= 0 ? "/Default.aspx?ID=" + signInProfilePageId + "&RedirectPageId=" : "/Default.aspx?ID="; 3610 int myFavoritesPageId = GetPageIdByNavigationTag("CustomerFavorites"); 3611 string myFavoritesPageLink = linkStart + myFavoritesPageId; 3612 string favoritesIcon = Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("FavoriteIcon") != null ? "fas fa-" + Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("FavoriteIcon").SelectedValue : "fa fa-star"; 3613 3614 3615 <li class="menu-mobile__item"> 3616 <a href="@myFavoritesPageLink" class="menu-mobile__link menu-mobile__link--highlighted dw-mod"><i class="@favoritesIcon menu-mobile__link-icon"></i> @Translate("My Favorites")</a> 3617 </li> 3618 } 3619 3620 @helper RenderMobileNavigationSavedCardsAction() 3621 { 3622 int signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); 3623 string linkStart = Model.CurrentUser.ID <= 0 ? "/Default.aspx?ID=" + signInProfilePageId + "&RedirectPageId=" : "/Default.aspx?ID="; 3624 int mySavedCardsPageId = GetPageIdByNavigationTag("SavedCards"); 3625 string mySavedCardsPageLink = linkStart + mySavedCardsPageId; 3626 string savedCardsIcon = Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SavedCards") != null ? "fas fa-" + Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SavedCards").SelectedValue : "fas fa-credit-card"; 3627 3628 <li class="menu-mobile__item"> 3629 <a href="@mySavedCardsPageLink" class="menu-mobile__link menu-mobile__link--highlighted dw-mod"><i class="@savedCardsIcon menu-mobile__link-icon"></i> @Translate("My Saved Cards")</a> 3630 </li> 3631 } 3632 3633 @helper RenderMobileNavigationSignOutAction() 3634 { 3635 int pageId = Model.TopPage.ID; 3636 string signOutIcon = Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SignOutIcon") != null ? "fas fa-" + Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SignOutIcon").SelectedValue : "far fa-sign-out-alt"; 3637 3638 <li class="menu-mobile__item"> 3639 <a class="menu-mobile__link menu-mobile__link--highlighted dw-mod" href="/Admin/Public/ExtranetLogoff.aspx?ID=@pageId"><i class="@signOutIcon menu-mobile__link-icon"></i> @Translate("Sign out")</a> 3640 </li> 3641 } 3642 3643 @helper RenderMobileNavigationLanguagesAction() 3644 { 3645 bool isSlidesDesign = Model.Area.Item.GetItem("Layout").GetItem("MobileNavigation").GetList("Design").SelectedValue == "Slides"; 3646 3647 string selectedLanguage = ""; 3648 foreach (var lang in Model.Languages) 3649 { 3650 if (lang.IsCurrent) 3651 { 3652 selectedLanguage = lang.Name; 3653 } 3654 } 3655 3656 <li class="menu-mobile__item dw-mod"> 3657 @if (isSlidesDesign) 3658 { 3659 <input id="MobileMenuCheck_Language" type="radio" class="expand-trigger" name="mobile-menu-level-1" onclick="goToLevel(1);"> 3660 } 3661 else 3662 { 3663 <input id="MobileMenuCheck_Language" type="checkbox" class="expand-trigger"> 3664 } 3665 <div class="menu-mobile__link__wrap"> 3666 <label for="MobileMenuCheck_Language" class="menu-mobile__link menu-mobile__link--highlighted dw-mod"><i class="@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("LanguageIcon").SelectedValue menu-mobile__link-icon"></i> @selectedLanguage</label> 3667 <label for="MobileMenuCheck_Language" class="menu-mobile__trigger"></label> 3668 </div> 3669 <ul class="menu-mobile menu-mobile__submenu expand-menu"> 3670 @if (isSlidesDesign) 3671 { 3672 <li class="menu-mobile__item dw-mod"> 3673 <div class="menu-mobile__link__wrap"> 3674 <input id="MobileMenuCheck_Language_back" type="radio" class="expand-trigger" name="mobile-menu-level-1" onclick="goToLevel(0);" /> 3675 <label for="MobileMenuCheck_Language_back" class="menu-mobile__trigger menu-mobile__trigger--back"></label> 3676 <label for="MobileMenuCheck_Language_back" class="menu-mobile__link dw-mod ">@Translate("Back")</label> 3677 </div> 3678 </li> 3679 } 3680 @foreach (var lang in Model.Languages) 3681 { 3682 string urlStr=""; 3683 string blog=""; 3684 if (Model.Path.Count >= 2) 3685 { 3686 blog=Model.Path.Reverse().Skip(1).First().Name; 3687 } 3688 if (Model.Name == "Superhome Center DIY") 3689 { 3690 if (lang.Name.ToUpper() == "GREEK") 3691 { 3692 urlStr="/Default.aspx?ID=3278"; 3693 } 3694 else 3695 { 3696 urlStr="/Default.aspx?ID=2165"; 3697 } 3698 <!--<a href="@urlStr" class="menu-dropdown__item menu-dropdown__item--link dw-mod">@lang.Name</a>--> 3699 <!--<a class="menu-mobile__link menu-mobile__link--highlighted dw-mod menu-mobile__link--level-1" href="@urlStr">@lang.Name</a> --> 3700 } 3701 else if (Model.Name == "Special Offers" || Model.Name == "Προσφορές") 3702 { 3703 if (lang.Name.ToUpper() == "GREEK") 3704 { 3705 urlStr="/Default.aspx?ID=3451"; 3706 } 3707 else 3708 { 3709 urlStr="/Default.aspx?ID=3450"; 3710 } 3711 } 3712 else if (Model.Name == "Departments" || Model.Name == "Τμήματα") 3713 { 3714 if (lang.Name.ToUpper() == "GREEK") 3715 { 3716 urlStr="/Default.aspx?ID=3477"; 3717 } 3718 else 3719 { 3720 urlStr="/Default.aspx?ID=3476"; 3721 } 3722 } 3723 else if (Model.Name == "Services" || Model.Name == "Υπηρεσίες") 3724 { 3725 if (lang.Name.ToUpper() == "GREEK") 3726 { 3727 urlStr="/Default.aspx?ID=3463"; 3728 } 3729 else 3730 { 3731 urlStr="/Default.aspx?ID=3462"; 3732 } 3733 } 3734 else if (Model.Name == "Company" || Model.Name == "Εταιρεία") 3735 { 3736 if (lang.Name.ToUpper() == "GREEK") 3737 { 3738 urlStr="/Default.aspx?ID=3449"; 3739 } 3740 else 3741 { 3742 urlStr="/Default.aspx?ID=3448"; 3743 } 3744 } 3745 else if (Model.Name == "Locations" || Model.Name == "Καταστήματα") 3746 { 3747 if (lang.Name.ToUpper() == "GREEK") 3748 { 3749 urlStr="/Default.aspx?ID=3453"; 3750 } 3751 else 3752 { 3753 urlStr="/Default.aspx?ID=3452"; 3754 } 3755 } 3756 else if (Model.Name == "Blog" || Model.Name == "DIY Videos" || Model.Name == "TV Spots" || blog == "Blog") 3757 { 3758 if (lang.Name.ToUpper() == "GREEK") 3759 { 3760 urlStr="/Default.aspx?ID=3467"; 3761 } 3762 else 3763 { 3764 urlStr="/Default.aspx?ID=3466"; 3765 } 3766 } 3767 else if (Model.Name == "Working Hours" || Model.Name == "Ώρες Λειτουργίας") 3768 { 3769 if (lang.Name.ToUpper() == "GREEK") 3770 { 3771 urlStr="/Default.aspx?ID=3491"; 3772 } 3773 else 3774 { 3775 urlStr="/Default.aspx?ID=3490"; 3776 } 3777 } 3778 else if (Model.Name == "Contact Us" || Model.Name == "Επικοινωνία") 3779 { 3780 if (lang.Name.ToUpper() == "GREEK") 3781 { 3782 urlStr="/Default.aspx?ID=3487"; 3783 } 3784 else 3785 { 3786 urlStr="/Default.aspx?ID=3486"; 3787 } 3788 } 3789 else if (Model.Name == "Career" || Model.Name == "Καριέρα") 3790 { 3791 if (lang.Name.ToUpper() == "GREEK") 3792 { 3793 urlStr="/Default.aspx?ID=3489"; 3794 } 3795 else 3796 { 3797 urlStr="/Default.aspx?ID=3488"; 3798 } 3799 } 3800 else 3801 { 3802 int queryCount=System.Web.HttpContext.Current.Request.QueryString.Count; 3803 3804 urlStr="/Default.aspx?"; 3805 if (lang.Name.ToUpper() == "GREEK") 3806 { 3807 urlStr+="ID=3280"; 3808 } 3809 else 3810 { 3811 urlStr+="ID=52"; 3812 } 3813 var gid=System.Web.HttpContext.Current.Request.QueryString["GroupId"]; 3814 if (gid != null) 3815 { 3816 urlStr+="&amp;GroupID="+@System.Web.HttpContext.Current.Request.QueryString["GroupId"]; 3817 } 3818 var pid=System.Web.HttpContext.Current.Request.QueryString["ProductId"]; 3819 if (pid != null) 3820 { 3821 urlStr+="&amp;ProductID="+@System.Web.HttpContext.Current.Request.QueryString["ProductId"]; 3822 } 3823 } 3824 urlStr+="&amp;Purge=True"; 3825 3826 <li class="menu-mobile__item dw-mod"> 3827 <!--<a class="menu-mobile__link menu-mobile__link--highlighted dw-mod menu-mobile__link--level-1" href="/Default.aspx?ID=@lang.Page.ID">@lang.Name</a>--> 3828 <a class="menu-mobile__link menu-mobile__link--highlighted dw-mod menu-mobile__link--level-1" href="@urlStr">@lang.Name</a> 3829 </li> 3830 } 3831 3832 3833 </ul> 3834 </li> 3835 }</text> 3836 } 3837 else 3838 { 3839 <text>@inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 3840 3841 @using System 3842 @using System.Web 3843 @using System.Collections.Generic 3844 @using Dynamicweb.Rapido.Blocks.Extensibility 3845 @using Dynamicweb.Rapido.Blocks 3846 3847 @functions { 3848 BlocksPage headerBlocksPage = BlocksPage.GetBlockPage("Master"); 3849 } 3850 3851 @{ 3852 if (Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet") 3853 { 3854 Block masterTools = new Block() 3855 { 3856 Id = "MasterDesktopTools", 3857 SortId = 10, 3858 Template = RenderDesktopTools(), 3859 SkipRenderBlocksList = true, 3860 BlocksList = new List<Block> 3861 { 3862 new Block { 3863 Id = "MasterDesktopToolsText", 3864 SortId = 10, 3865 Template = RenderDesktopToolsText(), 3866 Design = new Design 3867 { 3868 Size = "auto", 3869 HidePadding = true, 3870 RenderType = RenderType.Column 3871 } 3872 }, 3873 new Block { 3874 Id = "MasterDesktopToolsNavigation", 3875 SortId = 20, 3876 Template = RenderDesktopToolsNavigation(), 3877 Design = new Design 3878 { 3879 Size = "auto-width", 3880 HidePadding = true, 3881 RenderType = RenderType.Column 3882 } 3883 } 3884 } 3885 }; 3886 headerBlocksPage.Add("MasterHeader", masterTools); 3887 } 3888 3889 Block masterDesktopExtra = new Block() 3890 { 3891 Id = "MasterDesktopExtra", 3892 SortId = 10, 3893 Template = RenderDesktopExtra(), 3894 SkipRenderBlocksList = true 3895 }; 3896 headerBlocksPage.Add("MasterHeader", masterDesktopExtra); 3897 3898 Block masterDesktopNavigation = new Block() 3899 { 3900 Id = "MasterDesktopNavigation", 3901 SortId = 20, 3902 Template = RenderDesktopNavigation(), 3903 SkipRenderBlocksList = true 3904 }; 3905 headerBlocksPage.Add("MasterHeader", masterDesktopNavigation); 3906 } 3907 3908 3909 @*Include the Blocks for the page *@ 3910 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 3911 3912 @using System 3913 @using System.Web 3914 @using Dynamicweb.Rapido.Blocks.Extensibility 3915 @using Dynamicweb.Rapido.Blocks 3916 @using Dynamicweb.Environment 3917 3918 @{ 3919 Block masterDesktopLogo = new Block 3920 { 3921 Id = "MasterDesktopLogo", 3922 SortId = 10, 3923 Template = RenderDesktopLogo(), 3924 Design = new Design 3925 { 3926 Size = "auto-width", 3927 HidePadding = true, 3928 RenderType = RenderType.Column, 3929 CssClass = "grid--align-self-center" 3930 } 3931 }; 3932 3933 BlocksPage.GetBlockPage("Master").Add("MasterHeader", masterDesktopLogo); 3934 } 3935 3936 3937 @helper RenderDesktopLogo() 3938 { 3939 string currentLanguage = ExecutingContext.GetCulture(true).TwoLetterISOLanguageName.ToUpper(); //CS 3940 string firstPageId = Model.Area.FirstActivePage.ID.ToString(); 3941 string topLayout = Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout") != null ? Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout").SelectedValue : "normal"; 3942 string alignClass = topLayout == "two-lines-centered" || topLayout == "two-lines" ? "grid--align-self-center" : ""; 3943 string logo = Model.Area.Item.GetItem("Layout").GetFile("LogoImage") != null ? Model.Area.Item.GetItem("Layout").GetFile("LogoImage").PathUrlEncoded : "/Files/Images/logo-dynamicweb.png"; 3944 if (Path.GetExtension(logo).ToLower() != ".svg") 3945 { 3946 int logoHeight = Model.Area.Item.GetItem("Layout").GetInt32("LogoHeight"); 3947 logoHeight = logoHeight > 0 && Pageview.Device.ToString() != "Mobile" ? logoHeight : 40; 3948 logo = "/Admin/Public/GetImage.ashx?height=" + Converter.ToString(logoHeight) + "&amp;crop=5&amp;Compression=75&amp;image=" + logo; 3949 } 3950 else 3951 { 3952 logo = HttpUtility.UrlDecode(logo); 3953 } 3954 @*Barry fix for Safari Logo*@ 3955 string browser=HttpContext.Current.Request.UserAgent; 3956 string safariCSS=""; 3957 if (browser.Contains("Macintosh")) 3958 { 3959 if (browser.Contains("Safari")) 3960 { 3961 if (!browser.Contains("Chrome")) 3962 { 3963 safariCSS=" style=\"margin-top:4.5em\""; 3964 } 3965 } 3966 } 3967 3968 <div class="logo @alignClass dw-mod" "@safariCSS"> 3969 <!--<div class="logo @alignClass dw-mod">--> 3970 @*End of Barry Fix for Safari CSS logo*@ 3971 @if(currentLanguage == "EN") 3972 { 3973 <a href="/English" class="logo__img dw-mod u-block"> 3974 <img class="grid__cell-img logo__img dw-mod" src="@logo" alt="@Translate("Logo")" /> 3975 </a> 3976 } 3977 else 3978 { 3979 <a href="/Greek" class="logo__img dw-mod u-block"> 3980 <img class="grid__cell-img logo__img dw-mod" src="@logo" alt="@Translate("Logo")" /> 3981 </a> 3982 } 3983 <!--<a href="/" class="logo__img dw-mod u-block"> 3984 <img class="grid__cell-img logo__img dw-mod" src="@logo" alt="@Translate("Logo")" /> 3985 </a>--> 3986 </div> 3987 } 3988 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 3989 3990 @using System 3991 @using System.Web 3992 @using Dynamicweb.Rapido.Blocks.Extensibility 3993 @using Dynamicweb.Rapido.Blocks 3994 3995 @functions { 3996 bool isMegaMenu; 3997 } 3998 3999 @{ 4000 isMegaMenu = Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("NavigationMegaMenu") != null ? Converter.ToBoolean(Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("NavigationMegaMenu").SelectedValue) : false; 4001 Block masterDesktopMenu = new Block 4002 { 4003 Id = "MasterDesktopMenu", 4004 SortId = 10, 4005 Template = RenderDesktopMenu(), 4006 Design = new Design 4007 { 4008 Size = "auto", 4009 HidePadding = true, 4010 RenderType = RenderType.Column 4011 } 4012 }; 4013 4014 if (isMegaMenu) 4015 { 4016 masterDesktopMenu.Design.CssClass = "u-reset-position"; 4017 } 4018 4019 BlocksPage.GetBlockPage("Master").Add("MasterHeader", masterDesktopMenu); 4020 } 4021 4022 @helper RenderDesktopMenu() 4023 { 4024 string topLayout = Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout") != null ? Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout").SelectedValue : "normal"; 4025 string menuAlignment = topLayout == "minimal-right" ? "grid--align-self-end" : ""; 4026 string megamenuPromotionImage = Model.Area.Item.GetItem("Layout").GetItem("Header").GetFile("MegamenuPromotionImage") != null ? Model.Area.Item.GetItem("Layout").GetItem("Header").GetFile("MegamenuPromotionImage").PathUrlEncoded : ""; 4027 bool renderPagesInToolBar = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("RenderPagesInToolBar"); 4028 bool showOnlyHeaders = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("ShowOnlyHeaders"); 4029 int startLevel = renderPagesInToolBar ? 1 : 0; 4030 4031 string promotionLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetString("MegamenuPromotionLink"); 4032 4033 <div class="grid__cell u-flex @(isMegaMenu ? "u-reset-position" : "") @menuAlignment"> 4034 @if (!isMegaMenu) 4035 { 4036 @RenderNavigation(new 4037 { 4038 id = "topnavigation", 4039 cssclass = "menu dw-mod dwnavigation u-full-max-width u-flex grid--wrap", 4040 startLevel = startLevel, 4041 ecomStartLevel = startLevel + 1, 4042 endlevel = 5, 4043 expandmode = "all", 4044 template = "BaseMenuWithDropdown.xslt" 4045 }); 4046 } 4047 else 4048 { 4049 @RenderNavigation(new 4050 { 4051 id = "topnavigation", 4052 cssclass = "menu dw-mod dwnavigation u-full-max-width u-flex grid--wrap", 4053 startLevel = startLevel, 4054 ecomStartLevel = startLevel + 1, 4055 endlevel = 5, 4056 promotionImage = megamenuPromotionImage, 4057 promotionLink = promotionLink, 4058 expandmode = "all", 4059 showOnlyHeaders = showOnlyHeaders.ToString().ToLower(), 4060 template = "BaseMegaMenu.xslt" 4061 }); 4062 } 4063 </div> 4064 } 4065 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 4066 4067 @using System 4068 @using System.Web 4069 @using Dynamicweb.Rapido.Blocks.Extensibility 4070 @using Dynamicweb.Rapido.Blocks 4071 4072 @{ 4073 Block masterDesktopActionsMenu = new Block 4074 { 4075 Id = "MasterDesktopActionsMenu", 4076 SortId = 10, 4077 Template = RenderDesktopActionsMenu(), 4078 Design = new Design 4079 { 4080 CssClass = "u-flex" 4081 }, 4082 SkipRenderBlocksList = true 4083 4084 }; 4085 BlocksPage.GetBlockPage("Master").Add("MasterHeader", masterDesktopActionsMenu); 4086 4087 if (!string.IsNullOrWhiteSpace(Model.Area.Item.GetItem("Layout").GetItem("Header").GetString("HeaderButtonLink"))) 4088 { 4089 Block masterDesktopActionsHeaderButton = new Block 4090 { 4091 Id = "MasterDesktopActionsHeaderButton", 4092 SortId = 60, 4093 Template = RenderHeaderButton() 4094 }; 4095 masterDesktopActionsMenu.Add(masterDesktopActionsHeaderButton); 4096 } 4097 } 4098 4099 @helper RenderDesktopActionsMenu() 4100 { 4101 List<Block> subBlocks = this.headerBlocksPage.GetBlockListById("MasterDesktopActionsMenu").OrderBy(item => item.SortId).ToList(); 4102 4103 <ul class="menu u-flex dw-mod"> 4104 @RenderBlockList(subBlocks) 4105 </ul> 4106 } 4107 4108 @helper RenderHeaderButton() 4109 { 4110 string headerButtonText = Model.Area.Item.GetItem("Layout").GetItem("Header").GetString("HeaderButtonText"); 4111 string headerButtonLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetString("HeaderButtonLink"); 4112 string headerButtonType = Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("HeaderButtonType") != null ? "btn--" + Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("HeaderButtonType").SelectedName.ToLower() : ""; 4113 4114 <li class="menu__item menu__item--horizontal menu--clean dw-mod"> 4115 <a class="btn @headerButtonType dw-mod u-no-margin u-margin-top u-margin-left" href="@headerButtonLink">@headerButtonText</a> 4116 </li> 4117 } 4118 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 4119 4120 @using System 4121 @using System.Web 4122 @using Dynamicweb.Core; 4123 @using System.Text.RegularExpressions 4124 @using Dynamicweb.Rapido.Blocks.Extensibility 4125 @using Dynamicweb.Rapido.Blocks 4126 4127 4128 @{ 4129 Block masterDesktopActionsMenuLanguageSelector = new Block 4130 { 4131 Id = "MasterDesktopActionsMenuLanguageSelector", 4132 SortId = 40, 4133 Template = RenderLanguageSelector() 4134 }; 4135 4136 BlocksPage.GetBlockPage("Master").Add("MasterDesktopActionsMenu", masterDesktopActionsMenuLanguageSelector); 4137 } 4138 4139 4140 @helper RenderLanguageSelector() 4141 { 4142 string topLayout = Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout") != null ? Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout").SelectedValue : "normal"; 4143 string liClasses = topLayout != "normal" ? "menu__item--top-level u-hidden-xxs" : "menu--clean"; 4144 string menuLinkClass = topLayout != "normal" ? "menu__link menu__link--icon" : "header-menu__link header-menu__link--icon"; 4145 string languageViewType = !string.IsNullOrEmpty(Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("LanguageSelector").SelectedValue) ? Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("LanguageSelector").SelectedValue.ToLower() : ""; 4146 4147 int currentAreaID=Model.Area.ID; 4148 4149 if (Model.Languages.Count > 1) 4150 { 4151 <li class="menu__item menu__item--horizontal @liClasses menu__item--icon is-dropdown is-dropdown--no-icon dw-mod"> 4152 <div class="@menuLinkClass dw-mod"> 4153 <i class="@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("LanguageIcon").SelectedValue fa-1_5x"></i> 4154 </div> 4155 <div class="menu menu--dropdown menu--dropdown-right languages-dropdown dw-mod grid__cell"> 4156 4157 @foreach (var lang in Model.Languages) 4158 { 4159 string langInfo = "<span class=\"flag-icon flag-icon-" + Dynamicweb.Services.Areas.GetArea(lang.ID).EcomCountryCode.ToLower() + " u-margin-right\"></span>" + lang.Name; 4160 string cultureName = Regex.Replace(Dynamicweb.Services.Areas.GetArea(lang.ID).CultureInfo.NativeName, @" ?\(.*?\)", string.Empty); 4161 cultureName = char.ToUpper(cultureName[0]) + cultureName.Substring(1); 4162 string blog=""; 4163 if (Model.Path.Count >= 2) 4164 { 4165 blog=Model.Path.Reverse().Skip(1).First().Name; 4166 } 4167 if (languageViewType == "flag-culture") 4168 { 4169 langInfo = "<span class=\"flag-icon flag-icon-" + Dynamicweb.Services.Areas.GetArea(lang.ID).EcomCountryCode.ToLower() + " \"></span> " + cultureName; 4170 } 4171 4172 if (languageViewType == "flag") 4173 { 4174 langInfo = "<span class=\"flag-icon flag-icon-" + Dynamicweb.Services.Areas.GetArea(lang.ID).EcomCountryCode.ToLower() + " \"></span>"; 4175 } 4176 4177 if (languageViewType == "name") 4178 { 4179 langInfo = lang.Name; 4180 } 4181 4182 if (languageViewType == "culture") 4183 { 4184 langInfo = cultureName; 4185 } 4186 4187 <!--<a href="/Default.aspx?AreaID=@Dynamicweb.Services.Pages.GetPage(lang.Page.ID).Area.ID" class="menu-dropdown__item menu-dropdown__item--link dw-mod">@langInfo</a>--> 4188 string urlStr=""; 4189 if (Model.Name == "Superhome Center DIY") 4190 { 4191 if (lang.Name.ToUpper() == "GREEK") 4192 { 4193 urlStr="/Default.aspx?ID=3278"; 4194 } 4195 else 4196 { 4197 urlStr="/Default.aspx?ID=2165"; 4198 } 4199 <a href="@urlStr" class="menu-dropdown__item menu-dropdown__item--link dw-mod">@langInfo</a> 4200 } 4201 else if (Model.Name == "Special Offers" || Model.Name == "Προσφορές") 4202 { 4203 if (lang.Name.ToUpper() == "GREEK") 4204 { 4205 urlStr="/Default.aspx?ID=3451"; 4206 } 4207 else 4208 { 4209 urlStr="/Default.aspx?ID=3450"; 4210 } 4211 <a href="@urlStr" class="menu-dropdown__item menu-dropdown__item--link dw-mod">@langInfo</a> 4212 } 4213 else if (Model.Name == "Departments" || Model.Name == "Τμήματα") 4214 { 4215 if (lang.Name.ToUpper() == "GREEK") 4216 { 4217 urlStr="/Default.aspx?ID=3477"; 4218 } 4219 else 4220 { 4221 urlStr="/Default.aspx?ID=3476"; 4222 } 4223 <a href="@urlStr" class="menu-dropdown__item menu-dropdown__item--link dw-mod">@langInfo</a> 4224 } 4225 else if (Model.Name == "Services" || Model.Name == "Υπηρεσίες") 4226 { 4227 if (lang.Name.ToUpper() == "GREEK") 4228 { 4229 urlStr="/Default.aspx?ID=3463"; 4230 } 4231 else 4232 { 4233 urlStr="/Default.aspx?ID=3462"; 4234 } 4235 <a href="@urlStr" class="menu-dropdown__item menu-dropdown__item--link dw-mod">@langInfo</a> 4236 } 4237 else if (Model.Name == "Company" || Model.Name == "Εταιρεία") 4238 { 4239 if (lang.Name.ToUpper() == "GREEK") 4240 { 4241 urlStr="/Default.aspx?ID=3449"; 4242 } 4243 else 4244 { 4245 urlStr="/Default.aspx?ID=3448"; 4246 } 4247 <a href="@urlStr" class="menu-dropdown__item menu-dropdown__item--link dw-mod">@langInfo</a> 4248 } 4249 else if (Model.Name == "Locations" || Model.Name == "Καταστήματα") 4250 { 4251 if (lang.Name.ToUpper() == "GREEK") 4252 { 4253 urlStr="/Default.aspx?ID=3453"; 4254 } 4255 else 4256 { 4257 urlStr="/Default.aspx?ID=3452"; 4258 } 4259 <a href="@urlStr" class="menu-dropdown__item menu-dropdown__item--link dw-mod">@langInfo</a> 4260 } 4261 else if (Model.Name == "Blog" || Model.Name == "DIY Videos" || Model.Name == "TV Spots" || blog == "Blog") 4262 { 4263 if (lang.Name.ToUpper() == "GREEK") 4264 { 4265 urlStr="/Default.aspx?ID=3467"; 4266 } 4267 else 4268 { 4269 urlStr="/Default.aspx?ID=3466"; 4270 } 4271 <a href="@urlStr" class="menu-dropdown__item menu-dropdown__item--link dw-mod">@langInfo</a> 4272 } 4273 else if (Model.Name == "Working Hours" || Model.Name == "Ώρες Λειτουργίας") 4274 { 4275 if (lang.Name.ToUpper() == "GREEK") 4276 { 4277 urlStr="/Default.aspx?ID=3491"; 4278 } 4279 else 4280 { 4281 urlStr="/Default.aspx?ID=3490"; 4282 } 4283 <a href="@urlStr" class="menu-dropdown__item menu-dropdown__item--link dw-mod">@langInfo</a> 4284 } 4285 else if (Model.Name == "Contact Us" || Model.Name == "Επικοινωνία") 4286 { 4287 if (lang.Name.ToUpper() == "GREEK") 4288 { 4289 urlStr="/Default.aspx?ID=3487"; 4290 } 4291 else 4292 { 4293 urlStr="/Default.aspx?ID=3486"; 4294 } 4295 <a href="@urlStr" class="menu-dropdown__item menu-dropdown__item--link dw-mod">@langInfo</a> 4296 } 4297 else if (Model.Name == "Career" || Model.Name == "Καριέρα") 4298 { 4299 if (lang.Name.ToUpper() == "GREEK") 4300 { 4301 urlStr="/Default.aspx?ID=3489"; 4302 } 4303 else 4304 { 4305 urlStr="/Default.aspx?ID=3488"; 4306 } 4307 <a href="@urlStr" class="menu-dropdown__item menu-dropdown__item--link dw-mod">@langInfo</a> 4308 } 4309 else 4310 { 4311 int queryCount=System.Web.HttpContext.Current.Request.QueryString.Count; 4312 urlStr="/Default.aspx?"; 4313 if (lang.Name.ToUpper() == "GREEK") 4314 { 4315 urlStr+="ID=3280"; 4316 } 4317 else 4318 { 4319 urlStr+="ID=52"; 4320 } 4321 4322 var gid=HttpContext.Current.Request.QueryString["GroupID"]; 4323 if (gid != null) 4324 { 4325 urlStr+="&amp;GroupID="+@System.Web.HttpContext.Current.Request.QueryString["GroupID"]; 4326 } 4327 var pid=HttpContext.Current.Request.QueryString["ProductID"]; 4328 if (pid != null) 4329 { 4330 urlStr+="&amp;ProductID="+@System.Web.HttpContext.Current.Request.QueryString["ProductID"]; 4331 } 4332 @*urlStr+="&amp;Purge=True&amp;ScrollPos=0";*@ 4333 urlStr+="&amp;Purge=True"; 4334 4335 @*if (queryCount == 1 || queryCount == 0) 4336 { 4337 <a href="/Default.aspx?AreaID=@Dynamicweb.Services.Pages.GetPage(lang.Page.ID).Area.ID" class="menu-dropdown__item menu-dropdown__item--link dw-mod">@langInfo</a> 4338 } 4339 else 4340 { 4341 <a href="@urlStr" class="menu-dropdown__item menu-dropdown__item--link dw-mod">@langInfo</a> 4342 }*@ 4343 <a href="@urlStr" class="menu-dropdown__item menu-dropdown__item--link dw-mod">@langInfo</a> 4344 4345 } 4346 } 4347 </div> 4348 </li> 4349 } 4350 } 4351 4352 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 4353 4354 @using System 4355 @using System.Web 4356 @using Dynamicweb.Rapido.Blocks.Extensibility 4357 @using Dynamicweb.Rapido.Blocks 4358 4359 @{ 4360 Block masterDesktopActionsMenuSignIn = new Block 4361 { 4362 Id = "MasterDesktopActionsMenuSignIn", 4363 SortId = 20, 4364 Template = RenderSignIn() 4365 }; 4366 4367 BlocksPage.GetBlockPage("Master").Add("MasterDesktopActionsMenu", masterDesktopActionsMenuSignIn); 4368 } 4369 4370 @helper RenderSignIn() 4371 { 4372 bool navigationItemsHideSignIn = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("HideSignIn"); 4373 string userInitials = ""; 4374 int pageId = Model.TopPage.ID; 4375 int createAccountPageId = GetPageIdByNavigationTag("CreateAccount"); 4376 int myDashboardPageId = GetPageIdByNavigationTag("CustomerDashboard"); 4377 int myProfilePageId = GetPageIdByNavigationTag("CustomerProfile"); 4378 int myOrdersPageId = GetPageIdByNavigationTag("CustomerOrders"); 4379 int myFavoritesPageId = GetPageIdByNavigationTag("CustomerFavorites"); 4380 int mySavedCardsPageId = GetPageIdByNavigationTag("SavedCards"); 4381 int signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); 4382 bool hideCreateAccountLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideCreateAccount"); 4383 bool hideMyProfileLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideProfile"); 4384 bool hideMyOrdersLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideOrders"); 4385 bool hideMySavedCardsLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideSavedCards"); 4386 bool hideMyFavoritesLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideFavorites"); 4387 bool hideForgotPasswordLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideForgotPasswordLink"); 4388 4389 string linkStart = "/Default.aspx?ID="; 4390 if (Model.CurrentUser.ID <= 0) 4391 { 4392 linkStart += signInProfilePageId + "&RedirectPageId="; 4393 } 4394 4395 string forgotPasswordPageLink = "/Default.aspx?ID=" + signInProfilePageId + "&LoginAction=Recovery"; 4396 string myProfilePageLink = linkStart + myProfilePageId; 4397 string myOrdersPageLink = linkStart + myOrdersPageId; 4398 string myFavoritesPageLink = linkStart + myFavoritesPageId; 4399 string mySavedCardsPageLink = linkStart + mySavedCardsPageId; 4400 4401 string profileIcon = Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SignInProfileIcon") != null ? Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SignInProfileIcon").SelectedValue : "fa fa-user"; 4402 string favoritesIcon = Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("FavoriteIcon") != null ? "fas fa-" + Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("FavoriteIcon").SelectedValue : "fa fa-star"; 4403 4404 if (Model.CurrentUser.ID != 0) 4405 { 4406 if (!String.IsNullOrEmpty(Model.CurrentUser.Name)) 4407 { 4408 string[] names = Model.CurrentUser.Name.Split(' '); 4409 userInitials += Model.CurrentUser.Name.Substring(0, 1); 4410 4411 if (names.Length > 1) 4412 { 4413 userInitials += names[names.Length - 1].Substring(0, 1); 4414 } 4415 } 4416 else 4417 { 4418 userInitials += Model.CurrentUser.FirstName != null && Model.CurrentUser.FirstName != "" ? Model.CurrentUser.FirstName.Substring(0, 1) : ""; 4419 userInitials += Model.CurrentUser.LastName != null && Model.CurrentUser.LastName != "" ? Model.CurrentUser.LastName.Substring(0, 1) : ""; 4420 userInitials += userInitials.Length == 1 && Model.CurrentUser.FirstName != null && Model.CurrentUser.FirstName.Length > 1 ? Model.CurrentUser.FirstName.Substring(1, 2) : ""; 4421 userInitials += userInitials == "" && Model.CurrentUser.Email != null && Model.CurrentUser.Email.Length > 1 ? Model.CurrentUser.Email.Substring(0, 2) : ""; 4422 userInitials += userInitials == "" ? Model.CurrentUser.UserName.Substring(0, 2) : ""; 4423 } 4424 } 4425 4426 if (!navigationItemsHideSignIn) 4427 { 4428 string topLayout = Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout") != null ? Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout").SelectedValue : "normal"; 4429 string liClasses = topLayout != "normal" ? "menu__item--top-level u-hidden-xxs" : "menu__item--clean"; 4430 string menuLinkClass = topLayout != "normal" ? "menu__link menu__link--icon" : "header-menu__link header-menu__link--icon"; 4431 4432 <li class="menu__item menu__item--horizontal menu__item menu__item--icon @liClasses is-dropdown is-dropdown--no-icon dw-mod"> 4433 <div class="@menuLinkClass dw-mod"> 4434 @if (Model.CurrentUser.ID <= 0) 4435 { 4436 <i class="@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SignInProfileIcon").SelectedValue fa-1_5x"></i> 4437 } 4438 else 4439 { 4440 <a href="/default.aspx?ID=@myDashboardPageId" class="u-color-inherit"><div class="circle-icon-btn">@userInitials.ToUpper()</div></a> 4441 } 4442 </div> 4443 <div class="menu menu--dropdown menu--dropdown-right menu--sign-in grid__cell dw-mod"> 4444 <ul class="list list--clean dw-mod"> 4445 @if (Model.CurrentUser.ID <= 0) 4446 { 4447 <li> 4448 <label for="SignInModalTrigger" class="btn btn--primary btn--full u-no-margin sign-in-modal-trigger-button dw-mod" onclick="setTimeout(function () { document.getElementById('LoginUsername').focus() }, 10)">@Translate("Sign in")</label> 4449 </li> 4450 4451 if (!hideCreateAccountLink) 4452 { 4453 @RenderListItem("/default.aspx?ID=" + createAccountPageId, Translate("Create account")); 4454 } 4455 if (!hideForgotPasswordLink) 4456 { 4457 @RenderListItem(forgotPasswordPageLink, Translate("Forgot your password?")) 4458 } 4459 if (!hideMyProfileLink || !hideMyOrdersLink || !hideMyFavoritesLink || !hideMySavedCardsLink) 4460 { 4461 @RenderSeparator() 4462 } 4463 } 4464 @if (!hideMyProfileLink) 4465 { 4466 @RenderListItem(myProfilePageLink, Translate("My Profile"), profileIcon) 4467 } 4468 @if (!hideMyOrdersLink) 4469 { 4470 @RenderListItem(myOrdersPageLink, Translate("My Orders"), "fas fa-list") 4471 } 4472 @if (!hideMyFavoritesLink) 4473 { 4474 @RenderListItem(myFavoritesPageLink, Translate("My Favorites"), favoritesIcon) 4475 } 4476 @if (!hideMySavedCardsLink) 4477 { 4478 @RenderListItem(mySavedCardsPageLink, Translate("My Saved cards"), "fas fa-credit-card") 4479 } 4480 @if (Model.CurrentUser.ID > 0) 4481 { 4482 if (!hideMyProfileLink || !hideMyOrdersLink || !hideMyFavoritesLink || !hideMySavedCardsLink) 4483 { 4484 @RenderSeparator() 4485 } 4486 4487 @RenderListItem("/Admin/Public/ExtranetLogoff.aspx?ID=" + pageId, Translate("Sign out")) 4488 } 4489 </ul> 4490 </div> 4491 </li> 4492 } 4493 } 4494 4495 @helper RenderListItem(string link, string text, string icon = null) { 4496 <li> 4497 <a href="@link" class="list__link dw-mod"> 4498 @if (!string.IsNullOrEmpty(icon)) 4499 { 4500 <i class="@icon u-margin-right"></i> 4501 } 4502 @text 4503 </a> 4504 </li> 4505 } 4506 4507 @helper RenderSeparator() 4508 { 4509 <li class="list__seperator dw-mod"></li> 4510 } 4511 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 4512 4513 @using System 4514 @using System.Web 4515 @using Dynamicweb.Rapido.Blocks.Extensibility 4516 @using Dynamicweb.Rapido.Blocks 4517 4518 @{ 4519 bool hideMyFavoritesLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("HideFavorites"); 4520 4521 Block masterDesktopActionsMenuFavorites = new Block 4522 { 4523 Id = "MasterDesktopActionsMenuFavorites", 4524 SortId = 30, 4525 Template = RenderFavorites() 4526 }; 4527 4528 if (!hideMyFavoritesLink && Model.CurrentUser.ID > 0) 4529 { 4530 BlocksPage.GetBlockPage("Master").Add("MasterDesktopActionsMenu", masterDesktopActionsMenuFavorites); 4531 } 4532 } 4533 4534 @helper RenderFavorites() 4535 { 4536 int myFavoritesPageId = GetPageIdByNavigationTag("CustomerFavorites"); 4537 string myFavoritesPageLink = "/Default.aspx?ID=" + myFavoritesPageId; 4538 4539 string topLayout = Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout") != null ? Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout").SelectedValue : "normal"; 4540 string liClasses = topLayout != "normal" ? "menu__item--top-level u-hidden-xxs" : "menu--clean"; 4541 string menuLinkClass = topLayout != "normal" ? "menu__link menu__link--icon" : "header-menu__link header-menu__link--icon"; 4542 4543 <li class="menu__item menu__item--horizontal @liClasses menu__item--icon dw-mod"> 4544 <a href="@myFavoritesPageLink" class="@menuLinkClass dw-mod"> 4545 <i class="fas fa-@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("FavoriteIcon").SelectedValue fa-1_5x"></i> 4546 </a> 4547 </li> 4548 } 4549 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 4550 4551 @using System 4552 @using System.Web 4553 @using Dynamicweb.Rapido.Blocks.Extensibility 4554 @using Dynamicweb.Rapido.Blocks 4555 4556 @{ 4557 bool onlyPreview = Model.Area.Item.GetItem("Ecommerce").GetBoolean("OnlyPreviewForAnonymous") && Model.CurrentUser.ID == 0; 4558 bool hideCart = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("HideCart"); 4559 string miniCartLayout = Model.Area.Item.GetItem("Ecommerce").GetItem("MiniCart").GetList("Layout") != null ? Model.Area.Item.GetItem("Ecommerce").GetItem("MiniCart").GetList("Layout").SelectedValue : "dropdown"; 4560 4561 if (!onlyPreview && !hideCart) 4562 { 4563 Block masterDesktopActionsMenuMiniCart = new Block 4564 { 4565 Id = "MasterDesktopActionsMenuMiniCart", 4566 SortId = 50, 4567 Template = RenderMiniCart(miniCartLayout == "dropdown"), 4568 SkipRenderBlocksList = true, 4569 BlocksList = new List<Block>() 4570 }; 4571 4572 Block miniCartCounterScriptTemplate = new Block 4573 { 4574 Id = "MiniCartCounterScriptTemplate", 4575 Template = RenderMiniCartCounterContent() 4576 }; 4577 4578 //dropdown layout is default 4579 RazorEngine.Templating.TemplateWriter layoutTemplate = RenderMiniCartDropdownLayout(); 4580 RazorEngine.Templating.TemplateWriter miniCartTriggerTemplate = RenderMiniCartTriggerLink(); 4581 4582 switch (miniCartLayout) 4583 { 4584 case "panel": 4585 layoutTemplate = RenderMiniCartPanelLayout(); 4586 miniCartTriggerTemplate = RenderMiniCartTriggerLabel(); 4587 break; 4588 case "modal": 4589 layoutTemplate = RenderMiniCartModalLayout(); 4590 miniCartTriggerTemplate = RenderMiniCartTriggerLabel(); 4591 break; 4592 } 4593 4594 masterDesktopActionsMenuMiniCart.BlocksList.Add(new Block 4595 { 4596 Id = "MiniCartTrigger", 4597 Template = miniCartTriggerTemplate 4598 }); 4599 4600 if (Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet") 4601 { 4602 masterDesktopActionsMenuMiniCart.BlocksList.Add(new Block 4603 { 4604 Id = "MiniCartLayout", 4605 Template = layoutTemplate 4606 }); 4607 } 4608 4609 BlocksPage.GetBlockPage("Master").Add("MasterDesktopActionsMenu", masterDesktopActionsMenuMiniCart); 4610 BlocksPage.GetBlockPage("Master").Add("MasterBottomSnippets", miniCartCounterScriptTemplate); 4611 } 4612 } 4613 4614 @helper RenderMiniCart(bool hasMouseEnterEvent) 4615 { 4616 List<Block> subBlocks = this.masterPage.GetBlockListById("MasterDesktopActionsMenuMiniCart").OrderBy(item => item.SortId).ToList(); 4617 string topLayout = Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout") != null ? Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout").SelectedValue : "normal"; 4618 string liClasses = topLayout != "normal" ? "menu__item--top-level" : "menu--clean"; 4619 int miniCartFeedPageId = GetPageIdByNavigationTag("MiniCartFeed"); 4620 string mouseEvent = ""; 4621 string id = "MiniCart"; 4622 if (hasMouseEnterEvent) { 4623 mouseEvent = "onmouseenter=\"Cart.UpdateMiniCart('miniCartTrigger', 'miniCart', 'cartCounter', '/Default.aspx?ID=" + miniCartFeedPageId + "&feedType=MiniCart')\""; 4624 id = "miniCartTrigger"; 4625 } 4626 <li class="menu__item menu__item--horizontal menu__item--icon @liClasses dw-mod" id="@id" @mouseEvent> 4627 @RenderBlockList(subBlocks) 4628 </li> 4629 } 4630 4631 @helper RenderMiniCartTriggerLabel() 4632 { 4633 int cartPageId = GetPageIdByNavigationTag("CartPage"); 4634 string cartIcon = Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("CartIcon") != null ? Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("CartIcon").SelectedValue : "fa fa-cart"; 4635 string topLayout = Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout") != null ? Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout").SelectedValue : "normal"; 4636 string menuLinkClass = topLayout != "normal" ? "menu__link menu__link--icon" : "header-menu__link header-menu__link--icon"; 4637 int miniCartFeedPageId = GetPageIdByNavigationTag("MiniCartFeed"); 4638 4639 <div class="@menuLinkClass dw-mod js-mini-cart-button" onclick="Cart.UpdateMiniCart('miniCartTrigger', 'miniCart', 'cartCounter', '/Default.aspx?ID=@miniCartFeedPageId&feedType=MiniCart')"> 4640 <div class="u-inline u-position-relative"> 4641 <i class="@cartIcon fa-1_5x"></i> 4642 @RenderMiniCartCounter() 4643 </div> 4644 </div> 4645 } 4646 4647 @helper RenderMiniCartTriggerLink() 4648 { 4649 int cartPageId = GetPageIdByNavigationTag("CartPage"); 4650 string cartIcon = Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("CartIcon") != null ? Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("CartIcon").SelectedValue : "fa fa-cart"; 4651 string topLayout = Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout") != null ? Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout").SelectedValue : "normal"; 4652 string menuLinkClass = topLayout != "normal" ? "menu__link menu__link--icon" : "header-menu__link header-menu__link--icon"; 4653 4654 <a href="/Default.aspx?ID=@cartPageId&Purge=True" class="@menuLinkClass menu__item--icon dw-mod js-mini-cart-button"> 4655 <div class="u-inline u-position-relative"> 4656 <i class="@cartIcon fa-1_5x"></i> 4657 @RenderMiniCartCounter() 4658 </div> 4659 </a> 4660 } 4661 4662 @helper RenderMiniCartCounter() 4663 { 4664 int miniCartFeedPageId = GetPageIdByNavigationTag("MiniCartFeed"); 4665 string cartProductsCount = Model.Cart.TotalProductsCount.ToString(); 4666 string counterPosition = Model.Area.Item.GetItem("Ecommerce").GetItem("MiniCart").GetList("CounterPosition") != null ? Model.Area.Item.GetItem("Ecommerce").GetItem("MiniCart").GetList("CounterPosition").SelectedValue : "right"; 4667 bool showPrice = Model.Area.Item.GetItem("Ecommerce").GetItem("MiniCart").GetBoolean("ShowPrice"); 4668 string cartProductsTotalPrice = showPrice && Model.Cart.TotalPrice != null ? Model.Cart.TotalPrice.Price.Formatted : ""; 4669 cartProductsTotalPrice = counterPosition == "right" ? cartProductsTotalPrice : ""; 4670 4671 if (showPrice && counterPosition == "right") 4672 { 4673 cartProductsCount = Translate("Cart") + "(" + cartProductsCount + ")"; 4674 } 4675 4676 <div class="mini-cart__counter dw-mod"> 4677 <div class="js-handlebars-root js-mini-cart-counter" id="cartCounter" data-template="MiniCartCounterContent" data-json-feed="/Default.aspx?ID=@miniCartFeedPageId&feedType=Counter" data-init-onload="false" data-preloader="false"> 4678 <div class="js-mini-cart-counter-content" data-count="@Model.Cart.TotalProductsCount.ToString()"> 4679 @cartProductsCount 4680 @cartProductsTotalPrice 4681 </div> 4682 </div> 4683 </div> 4684 } 4685 4686 @helper RenderMiniCartCounterContent() 4687 { 4688 bool showPrice = Model.Area.Item.GetItem("Ecommerce").GetItem("MiniCart").GetBoolean("ShowPrice"); 4689 string counterPosition = Model.Area.Item.GetItem("Ecommerce").GetItem("MiniCart").GetList("CounterPosition") != null ? Model.Area.Item.GetItem("Ecommerce").GetItem("MiniCart").GetList("CounterPosition").SelectedValue : "right"; 4690 bool showPriceInMiniCartCounter = Pageview.Device.ToString() != "Mobile" && counterPosition == "right" && showPrice; 4691 4692 <script id="MiniCartCounterContent" type="text/x-template"> 4693 {{#.}} 4694 <div class="js-mini-cart-counter-content dw-mod" data-count="{{numberofproducts}}"> 4695 @if (showPriceInMiniCartCounter) 4696 { 4697 @Translate("Cart")<text>({{numberofproducts}}) {{totalprice}}</text> 4698 } 4699 else 4700 { 4701 <text>{{numberofproducts}}</text> 4702 } 4703 </div> 4704 {{/.}} 4705 </script> 4706 } 4707 4708 @helper RenderMiniCartDropdownLayout() 4709 { 4710 int miniCartFeedPageId = GetPageIdByNavigationTag("MiniCartFeed"); 4711 4712 <div class="mini-cart mini-cart-dropdown js-mini-cart grid__cell dw-mod" id="miniCart" data-cart-id="@miniCartFeedPageId" data-show-type="dropdown"> 4713 <div class="mini-cart-dropdown__inner dw-mod"> 4714 <h3 class="u-ta-center dw-mod">@Translate("Shopping cart")</h3> 4715 <div class="mini-cart-dropdown__body u-flex dw-mod"> 4716 <div class="js-handlebars-root u-flex grid--direction-column u-full-width dw-mod" id="miniCartContent" data-template="MiniCartContent" data-json-feed="/Default.aspx?ID=@miniCartFeedPageId&feedType=MiniCart" data-init-onload="false"></div> 4717 </div> 4718 </div> 4719 </div> 4720 } 4721 4722 @helper RenderMiniCartPanelLayout() 4723 { 4724 int miniCartFeedPageId = GetPageIdByNavigationTag("MiniCartFeed"); 4725 4726 <div class="mini-cart grid__cell dw-mod"> 4727 <input type="checkbox" id="miniCartTrigger" class="panel-trigger" /> 4728 <div class="panel panel--right panel--with-close-btn dw-mod js-mini-cart" id="miniCart" data-cart-id="@miniCartFeedPageId" data-show-type="block"> 4729 <label for="miniCartTrigger" class="panel__close-btn" title="@Translate("Close panel")"><i class="fas fa-times"></i></label> 4730 <div class="panel__content u-full-width dw-mod"> 4731 <h3 class="panel__header dw-mod u-margin-bottom u-ta-center">@Translate("Shopping cart")</h3> 4732 <div class="panel__content-body panel__content-body--cart dw-mod"> 4733 <div class="js-handlebars-root u-flex grid--direction-column u-full-height dw-mod" id="miniCartContent" data-template="MiniCartContent" data-json-feed="/Default.aspx?ID=@miniCartFeedPageId&feedType=MiniCart" data-init-onload="false"></div> 4734 </div> 4735 </div> 4736 </div> 4737 </div> 4738 } 4739 4740 @helper RenderMiniCartModalLayout() 4741 { 4742 int miniCartFeedPageId = GetPageIdByNavigationTag("MiniCartFeed"); 4743 <div class="mini-cart grid__cell dw-mod"> 4744 <input type="checkbox" id="miniCartTrigger" class="modal-trigger" autocomplete="off" /> 4745 <div class="modal-container dw-mod js-mini-cart" id="miniCart" data-cart-id="@miniCartFeedPageId" data-show-type="block"> 4746 <label for="miniCartTrigger" class="modal-overlay"></label> 4747 <div class="modal modal--top-right dw-mod"> 4748 <div class="modal__body u-flex grid--direction-column dw-mod"> 4749 <h3 class="dw-mod u-ta-center">@Translate("Shopping cart")</h3> 4750 <div class="js-handlebars-root u-flex grid--direction-column dw-mod" id="miniCartContent" data-template="MiniCartContent" data-json-feed="/Default.aspx?ID=@miniCartFeedPageId&feedType=MiniCart" data-init-onload="false"></div> 4751 </div> 4752 <label class="modal__close-btn modal__close-btn--clean dw-mod" for="miniCartTrigger" title="@Translate("Close modal")"></label> 4753 </div> 4754 </div> 4755 </div> 4756 } 4757 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 4758 4759 @using System 4760 @using System.Web 4761 @using Dynamicweb.Rapido.Blocks.Extensibility 4762 @using Dynamicweb.Rapido.Blocks 4763 4764 @{ 4765 bool showDownloadCartLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("ShowDownloadCart"); 4766 4767 Block masterDesktopActionsMenuDownloadCart = new Block 4768 { 4769 Id = "MasterDesktopActionsMenuDownloadCart", 4770 SortId = 35, 4771 Template = RenderDownloadCart() 4772 }; 4773 4774 if (showDownloadCartLink && Model.CurrentUser.ID > 0) 4775 { 4776 BlocksPage.GetBlockPage("Master").Add("MasterDesktopActionsMenu", masterDesktopActionsMenuDownloadCart); 4777 } 4778 } 4779 4780 @helper RenderDownloadCart() 4781 { 4782 int downloadCartPageId = GetPageIdByNavigationTag("DownloadCart"); 4783 string downloadCartPageLink = "/Default.aspx?ID=" + downloadCartPageId; 4784 4785 string topLayout = Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout") != null ? Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout").SelectedValue : "normal"; 4786 string liClasses = topLayout != "normal" ? "menu__item--top-level u-hidden-xxs" : "menu--clean"; 4787 string menuLinkClass = topLayout != "normal" ? "menu__link menu__link--icon" : "header-menu__link header-menu__link--icon"; 4788 4789 <li class="menu__item menu__item--horizontal @liClasses menu__item--icon dw-mod"> 4790 <a href="@downloadCartPageLink" class="@menuLinkClass dw-mod"> 4791 <i class="fas fa-cart-arrow-down fa-1_5x"></i> 4792 </a> 4793 </li> 4794 } 4795 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 4796 4797 @using System 4798 @using System.Web 4799 @using Dynamicweb.Rapido.Blocks.Extensibility 4800 @using Dynamicweb.Rapido.Blocks 4801 4802 @functions { 4803 public class SearchConfiguration 4804 { 4805 public string searchFeedId { get; set; } 4806 public string searchSecondFeedId { get; set; } 4807 public int groupsFeedId { get; set; } 4808 public string resultPageLink { get; set; } 4809 public string searchPlaceholder { get; set; } 4810 public string searchType { get; set; } 4811 public string searchTemplate { get; set; } 4812 public string searchContentTemplate { get; set; } 4813 public string searchValue { get; set; } 4814 public bool showGroups { get; set; } 4815 4816 public SearchConfiguration() 4817 { 4818 searchFeedId = ""; 4819 searchSecondFeedId = ""; 4820 searchType = "product-search"; 4821 searchContentTemplate = ""; 4822 showGroups = true; 4823 } 4824 } 4825 } 4826 @{ 4827 Block masterSearchBar = new Block 4828 { 4829 Id = "MasterSearchBar", 4830 SortId = 40, 4831 Template = RenderSearch("bar"), 4832 Design = new Design 4833 { 4834 Size = "auto", 4835 HidePadding = true, 4836 RenderType = RenderType.Column 4837 } 4838 }; 4839 4840 Block masterSearchAction = new Block 4841 { 4842 Id = "MasterDesktopActionsMenuSearch", 4843 SortId = 10, 4844 Template = RenderSearch() 4845 }; 4846 4847 BlocksPage.GetBlockPage("Master").Add("MasterHeader", masterSearchBar); 4848 BlocksPage.GetBlockPage("Master").Add("MasterDesktopActionsMenu", masterSearchAction); 4849 } 4850 4851 @helper RenderSearch(string type = "mini-search") 4852 { 4853 string productsPageId = Converter.ToString(GetPageIdByNavigationTag("ProductsPage")); 4854 string contentSearchPageLink = GetPageIdByNavigationTag("ContentSearchResults") + "&Areaid=" + Model.Area.ID; 4855 string searchType = Model.Area.Item.GetItem("Layout").GetList("TopSearch") != null ? Model.Area.Item.GetItem("Layout").GetList("TopSearch").SelectedValue : "productSearch"; 4856 4857 SearchConfiguration searchConfiguration = null; 4858 4859 switch (searchType) { 4860 case "contentSearch": 4861 searchConfiguration = new SearchConfiguration() { 4862 searchFeedId = GetPageIdByNavigationTag("ContentSearchFeed") + "&Areaid=" + Model.Area.ID + "&pagesOnly=true", 4863 resultPageLink = contentSearchPageLink, 4864 searchPlaceholder = Translate("Search page"), 4865 groupsFeedId = 0, 4866 searchType = "content-search", 4867 searchTemplate = "SearchPagesTemplate", 4868 showGroups = false 4869 }; 4870 break; 4871 case "combinedSearch": 4872 searchConfiguration = new SearchConfiguration() { 4873 searchFeedId = productsPageId + "&feed=true", 4874 searchSecondFeedId = GetPageIdByNavigationTag("ContentSearchFeed") + "&Areaid=" + Model.Area.ID + "&pagesOnly=true", 4875 resultPageLink = Converter.ToString(productsPageId), 4876 searchPlaceholder = Translate("Search products or pages"), 4877 groupsFeedId = GetPageIdByNavigationTag("ProductGroupsFeed"), 4878 searchType = "combined-search", 4879 searchTemplate = "SearchProductsTemplateWrap", 4880 searchContentTemplate = "SearchPagesTemplateWrap", 4881 showGroups = Model.Area.Item.GetItem("Layout").GetBoolean("ShowGroupsSelector") 4882 }; 4883 break; 4884 default: //productSearch 4885 searchConfiguration = new SearchConfiguration() { 4886 resultPageLink = Converter.ToString(productsPageId), 4887 searchFeedId = productsPageId + "&feed=true", 4888 groupsFeedId = GetPageIdByNavigationTag("ProductGroupsFeed"), 4889 searchPlaceholder = Translate("Search products"), 4890 searchTemplate = "SearchProductsTemplate", 4891 searchType = "product-search", 4892 showGroups = Model.Area.Item.GetItem("Layout").GetBoolean("ShowGroupsSelector") 4893 }; 4894 break; 4895 } 4896 searchConfiguration.searchValue = HttpContext.Current.Request.QueryString.Get("Search") ?? ""; 4897 4898 if (type == "mini-search") { 4899 @RenderMiniSearch(searchConfiguration) 4900 } else { 4901 @RenderSearchBar(searchConfiguration) 4902 } 4903 } 4904 4905 @helper RenderSearchBar(SearchConfiguration options) 4906 { 4907 <div class="typeahead typeahead--centered u-color-inherit js-typeahead dw-mod" id="ProductSearchBar" 4908 data-page-size="7" 4909 data-search-feed-id="@options.searchFeedId" 4910 data-search-second-feed-id="@options.searchSecondFeedId" 4911 data-result-page-id="@options.resultPageLink" 4912 data-groups-page-id="@options.groupsFeedId" 4913 data-search-type="@options.searchType"> 4914 @if (options.showGroups) 4915 { 4916 <button type="button" class="btn btn--condensed u-color-light-gray--bg typeahead-group-btn dw-mod js-typeahead-groups-btn" data-group-id="all">@Translate("All")</button> 4917 <ul class="dropdown dropdown--absolute-position u-min-w220px js-handlebars-root js-typeahead-groups-content dw-mod" id="ProductSearchBarGroupsContent" data-template="SearchGroupsTemplate" data-json-feed="/Default.aspx?ID=@options.groupsFeedId&feedType=productGroups" data-init-onload="false" data-preloader="minimal"></ul> 4918 } 4919 <div class="typeahead-search-field"> 4920 <input type="text" class="u-no-margin u-full-width u-full-height js-typeahead-search-field" placeholder="@options.searchPlaceholder" value="@options.searchValue"> 4921 @if (string.IsNullOrEmpty(options.searchSecondFeedId)) 4922 { 4923 <ul class="dropdown dropdown--absolute-position u-min-w220px u-full-width js-handlebars-root js-typeahead-search-content dw-mod" id="ProductSearchBarContent" data-template="@options.searchTemplate" data-json-feed="/Default.aspx?ID=@options.searchFeedId&feedType=productsOnly" data-init-onload="false"></ul> 4924 } 4925 else 4926 { 4927 <div class="dropdown dropdown--absolute-position dropdown--combined grid"> 4928 <div class="js-typeahead-search-content grid__col-sm-7 grid__col--bleed-y" id="ProductSearchBarContent" data-template="@options.searchTemplate" data-init-onload="false"></div> 4929 <div class="js-typeahead-additional-search-content grid__col-sm-5 grid__col--bleed-y" id="ContentSearchBarContent" data-template="@options.searchContentTemplate" data-init-onload="false"></div> 4930 </div> 4931 } 4932 </div> 4933 <button type="button" class="btn btn--condensed btn--primary u-no-margin dw-mod js-typeahead-enter-btn"><i class="@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SearchIcon").SelectedValue"></i></button> 4934 </div> 4935 } 4936 4937 @helper RenderMiniSearch(SearchConfiguration options) 4938 { 4939 <li class="menu__item menu__item--horizontal menu__item--top-level menu__item--icon u-hidden-xxs is-dropdown is-dropdown--no-icon dw-mod" onmouseover="document.getElementById('headerSearch').focus()"> 4940 <div class="menu__link menu__link--icon dw-mod"> 4941 <i class="@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SearchIcon").SelectedValue fa-1_5x"></i> 4942 </div> 4943 <div class="menu menu--dropdown menu--dropdown-right u-no-padding u-w380px grid__cell dw-mod"> 4944 <div class="typeahead js-typeahead" id="ProductSearchBar" 4945 data-page-size="7" 4946 data-search-feed-id="@options.searchFeedId" 4947 data-search-second-feed-id="@options.searchSecondFeedId" 4948 data-result-page-id="@options.resultPageLink" 4949 data-search-type="@options.searchType"> 4950 <div class="typeahead-search-field"> 4951 <input type="text" class="u-no-margin u-full-width js-typeahead-search-field" id="headerSearch" placeholder="@options.searchPlaceholder" value="@options.searchValue"> 4952 @if (string.IsNullOrEmpty(options.searchSecondFeedId)) 4953 { 4954 <ul class="dropdown dropdown--absolute-position u-min-w220px u-full-width js-handlebars-root js-typeahead-search-content dw-mod" id="ProductSearchBarContent" data-template="@options.searchTemplate" data-json-feed="/Default.aspx?ID=@options.searchFeedId&feedType=productsOnly" data-init-onload="false"></ul> 4955 } 4956 else 4957 { 4958 <div class="dropdown dropdown--absolute-position dropdown--combined grid dropdown--right-aligned"> 4959 <div class="js-handlebars-root js-typeahead-search-content grid__col-sm-7 grid__col--bleed-y" id="ProductSearchBarContent" data-template="@options.searchTemplate" data-json-feed="/Default.aspx?ID=@options.searchFeedId&feedType=productsOnly" data-init-onload="false"></div> 4960 <div class="js-handlebars-root js-typeahead-additional-search-content grid__col-sm-5 grid__col--bleed-y" id="ContentSearchBarContent" data-template="@options.searchContentTemplate" data-json-feed="/Default.aspx?ID=@options.searchSecondFeedId" data-init-onload="false"></div> 4961 </div> 4962 } 4963 </div> 4964 </div> 4965 </div> 4966 </li> 4967 } 4968 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 4969 4970 @using System 4971 @using System.Web 4972 @using Dynamicweb.Rapido.Blocks.Extensibility 4973 @using Dynamicweb.Rapido.Blocks 4974 4975 @{ 4976 string topLayout = Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout") != null ? Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout").SelectedValue : "normal"; 4977 bool hideSearch = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("HideSearch"); 4978 4979 BlocksPage headerConfigurationPage = BlocksPage.GetBlockPage("Master"); 4980 4981 Block configDesktopLogo = headerConfigurationPage.GetBlockById("MasterDesktopLogo"); 4982 headerConfigurationPage.RemoveBlock(configDesktopLogo); 4983 4984 Block configDesktopMenu = headerConfigurationPage.GetBlockById("MasterDesktopMenu"); 4985 headerConfigurationPage.RemoveBlock(configDesktopMenu); 4986 4987 Block configSearchBar = headerConfigurationPage.GetBlockById("MasterSearchBar"); 4988 headerConfigurationPage.RemoveBlock(configSearchBar); 4989 4990 Block configSearchAction = headerConfigurationPage.GetBlockById("MasterDesktopActionsMenuSearch"); 4991 headerConfigurationPage.RemoveBlock(configSearchAction); 4992 4993 Block configDesktopActionsMenu = headerConfigurationPage.GetBlockById("MasterDesktopActionsMenu"); 4994 headerConfigurationPage.RemoveBlock(configDesktopActionsMenu); 4995 4996 Block configDesktopExtra = headerConfigurationPage.GetBlockById("MasterDesktopExtra"); 4997 4998 switch (topLayout) 4999 { 5000 case "condensed": //2 5001 configDesktopLogo.Design.Size = "auto-width"; 5002 headerConfigurationPage.Add("MasterDesktopNavigation", configDesktopLogo); 5003 5004 configDesktopMenu.SortId = 20; 5005 configDesktopMenu.Design.Size = "auto"; 5006 headerConfigurationPage.Add("MasterDesktopNavigation", configDesktopMenu); 5007 5008 configDesktopActionsMenu.SortId = 30; 5009 configDesktopActionsMenu.Design.Size = "auto-width"; 5010 headerConfigurationPage.Add("MasterDesktopNavigation", configDesktopActionsMenu); 5011 5012 if (!hideSearch) 5013 { 5014 configSearchBar.SortId = 40; 5015 configSearchBar.Design.Size = "12"; 5016 configDesktopExtra.SortId = 50; 5017 headerConfigurationPage.Add("MasterDesktopExtra", configSearchBar); 5018 } 5019 break; 5020 case "splitted": //3 5021 configDesktopLogo.Design.Size = "auto"; 5022 headerConfigurationPage.Add("MasterDesktopExtra", configDesktopLogo); 5023 5024 if (!hideSearch) 5025 { 5026 configSearchBar.SortId = 20; 5027 configSearchBar.Design.Size = "auto"; 5028 headerConfigurationPage.Add("MasterDesktopExtra", configSearchBar); 5029 } 5030 5031 headerConfigurationPage.Add("MasterDesktopNavigation", configDesktopMenu); 5032 5033 configDesktopActionsMenu.SortId = 20; 5034 configDesktopActionsMenu.Design.Size = "auto-width"; 5035 headerConfigurationPage.Add("MasterDesktopNavigation", configDesktopActionsMenu); 5036 break; 5037 case "minimal": //4 5038 configDesktopLogo.Design.Size = "auto-width"; 5039 headerConfigurationPage.Add("MasterDesktopNavigation", configDesktopLogo); 5040 5041 configDesktopMenu.Design.Size = "auto"; 5042 headerConfigurationPage.Add("MasterDesktopNavigation", configDesktopMenu); 5043 5044 configDesktopActionsMenu.SortId = 20; 5045 configDesktopActionsMenu.Design.Size = "auto-width"; 5046 headerConfigurationPage.Add("MasterDesktopNavigation", configDesktopActionsMenu); 5047 5048 if (!hideSearch) 5049 { 5050 headerConfigurationPage.Add("MasterDesktopActionsMenu", configSearchAction); 5051 } 5052 break; 5053 case "minimal-right": //5 5054 configDesktopLogo.Design.Size = "auto-width"; 5055 headerConfigurationPage.Add("MasterDesktopNavigation", configDesktopLogo); 5056 5057 configDesktopMenu.Design.Size = "auto"; 5058 headerConfigurationPage.Add("MasterDesktopNavigation", configDesktopMenu); 5059 5060 configDesktopActionsMenu.SortId = 20; 5061 configDesktopActionsMenu.Design.Size = "auto-width"; 5062 headerConfigurationPage.Add("MasterDesktopNavigation", configDesktopActionsMenu); 5063 5064 if (!hideSearch) 5065 { 5066 headerConfigurationPage.Add("MasterDesktopActionsMenu", configSearchAction); 5067 } 5068 break; 5069 case "two-lines": //6 5070 configDesktopLogo.Design.Size = "auto"; 5071 headerConfigurationPage.Add("MasterDesktopExtra", configDesktopLogo); 5072 5073 headerConfigurationPage.Add("MasterDesktopNavigation", configDesktopMenu); 5074 5075 configDesktopActionsMenu.SortId = 20; 5076 configDesktopActionsMenu.Design.Size = "auto-width"; 5077 headerConfigurationPage.Add("MasterDesktopNavigation", configDesktopActionsMenu); 5078 5079 if (!hideSearch) 5080 { 5081 headerConfigurationPage.Add("MasterDesktopActionsMenu", configSearchAction); 5082 } 5083 break; 5084 case "two-lines-centered": //7 5085 configDesktopLogo.Design.Size = "auto"; 5086 headerConfigurationPage.Add("MasterDesktopExtra", configDesktopLogo); 5087 5088 configDesktopMenu.Design.Size = "auto-width"; 5089 headerConfigurationPage.Add("MasterDesktopNavigation", configDesktopMenu); 5090 5091 configDesktopActionsMenu.SortId = 20; 5092 headerConfigurationPage.Add("MasterDesktopNavigation", configDesktopActionsMenu); 5093 5094 if (!hideSearch) 5095 { 5096 headerConfigurationPage.Add("MasterDesktopActionsMenu", configSearchAction); 5097 } 5098 break; 5099 case "normal": //1 5100 default: 5101 headerConfigurationPage.Add("MasterDesktopExtra", configDesktopLogo); 5102 5103 if (!hideSearch) 5104 { 5105 configSearchBar.SortId = 20; 5106 headerConfigurationPage.Add("MasterDesktopExtra", configSearchBar); 5107 } 5108 5109 configDesktopActionsMenu.SortId = 30; 5110 headerConfigurationPage.Add("MasterDesktopExtra", configDesktopActionsMenu); 5111 5112 configDesktopActionsMenu.Design.Size = "auto-width"; 5113 headerConfigurationPage.Add("MasterDesktopNavigation", configDesktopMenu); 5114 break; 5115 } 5116 } 5117 @if (File.Exists(HttpContext.Current.Server.MapPath("/Files/Templates/Designs/Rapido/MasterBlocks/HeaderBlocks/Custom__Blocks.cshtml"))) 5118 { 5119 <text>@inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 5120 5121 @using System 5122 @using System.Web 5123 @using Dynamicweb.Rapido.Blocks.Extensibility 5124 @using Dynamicweb.Rapido.Blocks 5125 5126 @{ 5127 5128 }</text> 5129 } 5130 5131 5132 @helper RenderDesktopTools() 5133 { 5134 List<Block> subBlocks = headerBlocksPage.GetBlockListById("MasterDesktopTools").OrderBy(item => item.SortId).ToList(); 5135 5136 @*CS start Add red Nav small Bar*@ 5137 string newsletter="Newsletter Registration"; 5138 string newsletterURL="http://eepurl.com/duc565"; 5139 string career="Careers"; 5140 string careerURL="https://www.superhome.com.cy/english/career"; 5141 string workinghrs="Working Hours"; 5142 string workinghrsURL="https://www.superhome.com.cy/english/working-hours"; 5143 string unique="Unique by Ermes"; 5144 string uniqueURL="https://www.superhome.com.cy/english/unique-by-ermes"; 5145 if (Model.Area.Name=="Greek") 5146 { 5147 newsletter="Εγγραφή Newsletter"; 5148 newsletterURL="http://eepurl.com/duc565"; 5149 career="Καριέρα"; 5150 careerURL="https://www.superhome.com.cy/greek/καριερα"; 5151 workinghrs="Ώρες Λειτουργίας"; 5152 workinghrsURL="https://www.superhome.com.cy/greek/ωρες-λειτουργιας"; 5153 unique="Unique by Ermes"; 5154 uniqueURL="https://www.superhome.com.cy/greek/unique-by-ermes"; 5155 } 5156 5157 5158 <div class="top"> 5159 <div class="row cbp-spmenu cbp-spmenu-vertical cbp-spmenu-right" id="cbp-spmenu-s1"> 5160 <div class="moduletable tlmenu"> 5161 <ul class="nav menu mod-list"> 5162 <li class=""><a href="@newsletterURL" target="_blank" rel="noopener noreferrer">@newsletter</a></li> 5163 <li class=""><a href="@careerURL">@career</a></li> 5164 <li class=""><a href="@workinghrsURL">@workinghrs</a></li> 5165 <li class=""><a href="@uniqueURL">@unique</a></li> 5166 </ul> 5167 </div> 5168 5169 <div class="moduletable hsocial"> 5170 <div class="custom hsocial"> 5171 <ul class="social-icons"> 5172 <li class="link1"><a href="https://www.facebook.com/SuperhomeCenterCy" target="_blank" rel="noopener"><i class="fab fa-facebook-square" aria-hidden="true"></i></a></li> 5173 <li class="link2"><a href="https://www.linkedin.com/company/superhome-center" target="_blank" rel="noopener"><i class="fab fa-linkedin" aria-hidden="true"></i></a></li> 5174 <li class="link3"><a href="https://www.instagram.com/superhomecenter/" target="_blank"><i class="fab fa-instagram" aria-hidden="true"></i></a></li> 5175 <li class="link4"><a href="https://www.youtube.com/channel/UCcCTL9VwHJhYZSc0phv_HoQ" target="_blank" rel="noopener"><i class="fab fa-youtube" aria-hidden="true"></i></a></li> 5176 </ul> 5177 </div> 5178 </div> 5179 <div class="moduletable hphno"> 5180 <div class="custom hphno"><i class="fas fa-phone fa-flip-horizontal"></i> 5181 <a href="tel:77777545">7777 75 45</a></div> 5182 </div> 5183 <div class="clr"></div> 5184 </div> 5185 </div> 5186 @*CS end*@ 5187 5188 <div class="tools-navigation dw-mod"> 5189 <div class="center-container grid top-container__center-container dw-mod"> 5190 @RenderBlockList(subBlocks) 5191 </div> 5192 </div> 5193 } 5194 5195 @helper RenderDesktopToolsText() 5196 { 5197 string toolsText = Model.Area.Item.GetItem("Layout").GetItem("Header").GetString("ToolsText"); 5198 if (!string.IsNullOrEmpty(toolsText)) 5199 { 5200 <div class="u-margin-top u-margin-bottom">@toolsText</div> 5201 } 5202 } 5203 5204 @helper RenderDesktopToolsNavigation() 5205 { 5206 bool renderPagesInToolBar = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("RenderPagesInToolBar"); 5207 5208 if (renderPagesInToolBar) 5209 { 5210 @RenderNavigation(new 5211 { 5212 id = "topToolsNavigation", 5213 cssclass = "menu menu-tools dw-mod dwnavigation", 5214 template = "TopMenu.xslt" 5215 }) 5216 } 5217 } 5218 5219 @helper RenderDesktopNavigation() 5220 { 5221 List<Block> subBlocks = headerBlocksPage.GetBlockListById("MasterDesktopNavigation").OrderBy(item => item.SortId).ToList(); 5222 string topLayout = Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout") != null ? Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout").SelectedValue : "normal"; 5223 string alignClass = topLayout == "two-lines-centered" ? "grid--justify-center" : ""; 5224 <nav class="main-navigation dw-mod"> 5225 <div class="center-container top-container__center-container grid @alignClass dw-mod"> 5226 @RenderBlockList(subBlocks) 5227 5228 </div> 5229 </nav> 5230 } 5231 5232 @helper RenderDesktopExtra() 5233 { 5234 List<Block> subBlocks = headerBlocksPage.GetBlockListById("MasterDesktopExtra").OrderBy(item => item.SortId).ToList(); 5235 5236 if (subBlocks.Count > 0) 5237 { 5238 <div class="header header-top dw-mod"> 5239 <div class="center-container top-container__center-container grid--justify-space-between grid grid--align-center dw-mod"> 5240 @RenderBlockList(subBlocks) 5241 </div> 5242 </div> 5243 } 5244 }</text> 5245 } 5246 5247 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 5248 5249 @using System 5250 @using System.Web 5251 @using Dynamicweb.Rapido.Blocks.Extensibility 5252 @using Dynamicweb.Rapido.Blocks 5253 5254 @{ 5255 Block impersonationBar = new Block 5256 { 5257 Id = "ImpersonationBar", 5258 SortId = 50, 5259 Template = RenderImpersonationBar(), 5260 Design = new Design 5261 { 5262 Size = "auto-width", 5263 HidePadding = true, 5264 RenderType = RenderType.Column 5265 } 5266 }; 5267 5268 if (Model.CurrentUser.ID > 0 && Model.SecondaryUsers.Count > 0) 5269 { 5270 BlocksPage.GetBlockPage("Master").Add("MasterHeader", impersonationBar); 5271 } 5272 } 5273 5274 @helper RenderImpersonationBar() 5275 { 5276 int impersonationPageId = GetPageIdByNavigationTag("Impersonation"); 5277 5278 <div class="u-color-warning--bg"> 5279 <div class="center-container top-container__center-container dw-mod"> 5280 @*Impersonation*@ 5281 <div class="grid"> 5282 <div class="grid--align-self-center grid__col-x"> 5283 @if (Model.CurrentSecondaryUser != null && Model.CurrentSecondaryUser.ID > 0) 5284 { 5285 string stopImpersonateTranslation = Translate("Stop impersonation"); 5286 string username = ""; 5287 if (!string.IsNullOrEmpty(Model.CurrentSecondaryUser.FirstName) && !string.IsNullOrEmpty(Model.CurrentSecondaryUser.LastName)) 5288 { 5289 username = Model.CurrentSecondaryUser.FirstName + " " + Model.CurrentSecondaryUser.LastName; 5290 } 5291 else if (!string.IsNullOrEmpty(Model.CurrentSecondaryUser.Name)) 5292 { 5293 username = Model.CurrentSecondaryUser.Name; 5294 } 5295 else if (!string.IsNullOrEmpty(Model.CurrentSecondaryUser.Email)) 5296 { 5297 username = Model.CurrentSecondaryUser.Email; 5298 } 5299 else 5300 { 5301 username = Model.CurrentSecondaryUser.UserName; 5302 } 5303 <div class="grid-cell"> 5304 <div class="u-pull--left u-bold u-margin-top"> 5305 <i class="fas fa-user-secret"></i> 5306 @Pageview.User.UserName<text>&nbsp;</text>@Translate("is impersonating")<text>&nbsp;</text>@username 5307 </div> 5308 <form method="post" class="u-pull--right u-no-margin"> 5309 <input type="submit" class="btn btn--secondary dw-mod u-no-margin" name="DwExtranetRemoveSecondaryUser" value="@stopImpersonateTranslation"> 5310 </form> 5311 </div> 5312 } 5313 else 5314 { 5315 string viewListTranslation = Translate("View the list of users you can impersonate"); 5316 <div class="grid-cell u-bold"> 5317 <i class="fas fa-user-secret"></i> 5318 <a href="/Default.aspx?ID=@impersonationPageId" title="@viewListTranslation" class="u-color-font-black">@viewListTranslation</a> 5319 </div> 5320 } 5321 </div> 5322 </div> 5323 </div> 5324 </div> 5325 } 5326 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 5327 5328 @using System 5329 @using System.Web 5330 @using System.Collections.Generic 5331 @using Dynamicweb.Rapido.Blocks.Extensibility 5332 @using Dynamicweb.Rapido.Blocks 5333 5334 @{ 5335 BlocksPage miniCartBlocksPage = BlocksPage.GetBlockPage("Master"); 5336 string orderlinesView = Model.Area.Item.GetItem("Ecommerce").GetItem("MiniCart").GetList("OrderlinesView") != null ? Model.Area.Item.GetItem("Ecommerce").GetItem("MiniCart").GetList("OrderlinesView").SelectedValue : "table"; 5337 5338 Block orderLines = new Block 5339 { 5340 Id = "MiniCartOrderLines", 5341 SkipRenderBlocksList = true, 5342 BlocksList = new List<Block> 5343 { 5344 new Block { 5345 Id = "MiniCartOrderLinesList", 5346 SortId = 20, 5347 Template = RenderMiniCartOrderLinesList() 5348 } 5349 } 5350 }; 5351 5352 Block orderlinesScriptTemplates = new Block 5353 { 5354 Id = "OrderlinesScriptTemplates" 5355 }; 5356 5357 if (orderlinesView == "table") 5358 { 5359 orderLines.Template = RenderMiniCartOrderLinesTable(); 5360 orderLines.BlocksList.Add( 5361 new Block { 5362 Id = "MiniCartOrderlinesTableHeader", 5363 SortId = 10, 5364 Template = RenderMiniCartOrderLinesHeader() 5365 } 5366 ); 5367 5368 orderlinesScriptTemplates.Template = RenderMiniCartScriptsTableTemplates(); 5369 } 5370 else 5371 { 5372 orderLines.Template = RenderMiniCartOrderLinesBlocks(); 5373 orderlinesScriptTemplates.Template = RenderMiniCartScriptsListTemplates(); 5374 } 5375 5376 miniCartBlocksPage.Add("MasterBottomSnippets", orderlinesScriptTemplates); 5377 5378 Block miniCartScriptTemplates = new Block() 5379 { 5380 Id = "MasterMiniCartTemplates", 5381 SortId = 1, 5382 Template = RenderMiniCartScriptTemplates(), 5383 SkipRenderBlocksList = true, 5384 BlocksList = new List<Block> 5385 { 5386 orderLines, 5387 new Block { 5388 Id = "MiniCartFooter", 5389 Template = RenderMiniCartFooter(), 5390 SortId = 50, 5391 SkipRenderBlocksList = true, 5392 BlocksList = new List<Block> 5393 { 5394 new Block { 5395 Id = "MiniCartFees", 5396 Template = RenderMiniCartFees(), 5397 SortId = 30 5398 }, 5399 new Block { 5400 Id = "MiniCartPoints", 5401 Template = RenderMiniCartPoints(), 5402 SortId = 40 5403 }, 5404 new Block { 5405 Id = "MiniCartTotal", 5406 Template = RenderMiniCartTotal(), 5407 SortId = 50 5408 }, 5409 new Block { 5410 Id = "MiniCartActions", 5411 Template = RenderMiniCartActions(), 5412 SortId = 60 5413 } 5414 } 5415 } 5416 } 5417 }; 5418 5419 miniCartBlocksPage.Add("MasterBottomSnippets", miniCartScriptTemplates); 5420 } 5421 5422 @helper RenderMiniCartScriptsTableTemplates() 5423 { 5424 <script id="MiniCartOrderline" type="text/x-template"> 5425 {{#unless isEmpty}} 5426 <tr> 5427 <td class="u-w60px"><a href="{{link}}" class="{{hideimage}}"><img class="b-lazy" src="/Files/Images/placeholder.gif" data-src="/Admin/Public/GetImage.ashx?width=50&height=50&crop=5&Compression=75&image={{image}}" alt="{{name}}"></a></td> 5428 <td class="u-va-middle"> 5429 <a href="{{link}}" class="mini-cart-orderline__name" title="{{name}}">{{name}}</a> 5430 {{#if variantname}} 5431 <a href="{{link}}" class="mini-cart-orderline__name mini-cart-orderline__name--sm">{{variantname}}</a> 5432 {{/if}} 5433 {{#if unitname}} 5434 <div class="mini-cart-orderline__name mini-cart-orderline__name--sm">{{unitname}}</div> 5435 {{/if}} 5436 </td> 5437 <td class="u-ta-right u-va-middle">{{quantity}}</td> 5438 <td class="u-ta-right u-va-middle"> 5439 {{#if pointsTotal}} 5440 <span class="u-color--loyalty-points">{{pointsTotal}}</span> @Translate("points") 5441 {{else}} 5442 {{totalprice}} 5443 {{/if}} 5444 </td> 5445 </tr> 5446 {{/unless}} 5447 </script> 5448 5449 <script id="MiniCartOrderlineDiscount" type="text/x-template"> 5450 {{#unless isEmpty}} 5451 <tr class="table__row--no-border"> 5452 <td class="u-w60px">&nbsp;</td> 5453 <td><div class="mini-cart-orderline__name dw-mod">{{name}}</div></td> 5454 <td class="u-ta-right">&nbsp;</td> 5455 <td class="u-ta-right">{{totalprice}}</td> 5456 </tr> 5457 {{/unless}} 5458 </script> 5459 } 5460 5461 @helper RenderMiniCartScriptsListTemplates() 5462 { 5463 int cartOrderlinesFeedPageId = GetPageIdByNavigationTag("CartOrderlinesFeed"); 5464 <script id="MiniCartOrderline" type="text/x-template"> 5465 {{#unless isEmpty}} 5466 <div class="mini-cart-orderline grid dw-mod"> 5467 <div class="grid__col-4"> 5468 <a href="{{link}}" class="{{hideimage}}"> 5469 <img class="b-lazy" src="/Files/Images/placeholder.gif" data-src="/Admin/Public/GetImage.ashx?width=100&height=100&crop=5&Compression=75&image={{image}}" alt="{{name}}" title="{{name}}"> 5470 </a> 5471 </div> 5472 <div class="grid__col-8"> 5473 <a href="{{link}}" class="mini-cart-orderline__name mini-cart-orderline__name--truncate mini-cart-orderline__name--md u-padding-right--lg" title="{{name}}">{{name}}</a> 5474 {{#if variantname}} 5475 <div class="mini-cart-orderline__name mini-cart-orderline__name--sm dw-mod">@Translate("Variant"): {{variantname}}</div> 5476 {{/if}} 5477 {{#if unitname}} 5478 <div class="mini-cart-orderline__name mini-cart-orderline__name--sm dw-mod">@Translate("Unit"): {{unitname}}</div> 5479 {{/if}} 5480 <div class="mini-cart-orderline__name mini-cart-orderline__name--sm dw-mod">@Translate("Qty"): {{quantity}}</div> 5481 5482 <div class="grid__cell-footer"> 5483 <div class="grid__cell"> 5484 <div class="u-pull--left mini-cart-orderline__price dw-mod"> 5485 {{#if pointsTotal}} 5486 <span class="u-color--loyalty-points">{{pointsTotal}}</span> @Translate("points") 5487 {{else}} 5488 {{totalprice}} 5489 {{/if}} 5490 </div> 5491 <button type="button" title="@Translate("Remove orderline")" class="btn btn--clean btn--condensed u-pull--right mini-cart-orderline__remove-btn dw-mod" onclick="{{removeFromCartGoogleImpression}}; Cart.UpdateCart('Cart', '/Default.aspx?ID=@cartOrderlinesFeedPageId', 'CartCmd=DelOrderLine&key={{orderLineId}}', true);">@Translate("Remove")</button> 5492 </div> 5493 </div> 5494 </div> 5495 </div> 5496 {{/unless}} 5497 </script> 5498 5499 <script id="MiniCartOrderlineDiscount" type="text/x-template"> 5500 {{#unless isEmpty}} 5501 <div class="mini-cart-orderline mini-cart-orderline--discount grid dw-mod"> 5502 <div class="grid__col-4"> 5503 <div class="mini-cart-orderline__name mini-cart-orderline__name dw-mod">{{name}}</div> 5504 </div> 5505 <div class="grid__col-8">{{totalprice}}</div> 5506 </div> 5507 {{/unless}} 5508 </script> 5509 } 5510 5511 @helper RenderMiniCartScriptTemplates() 5512 { 5513 List<Block> subBlocks = this.masterPage.GetBlockListById("MasterMiniCartTemplates").OrderBy(item => item.SortId).ToList(); 5514 bool useGoogleTagManager = !string.IsNullOrEmpty(Pageview.AreaSettings.GetItem("Settings").GetString("GoogleTagManagerID")); 5515 string cartPageLink = string.Concat("/Default.aspx?ID=", GetPageIdByNavigationTag("CartPage")); 5516 5517 <script id="MiniCartContent" type="text/x-template"> 5518 {{#.}} 5519 {{#unless isEmpty}} 5520 @if (useGoogleTagManager) 5521 { 5522 <text>{{{googleEnchantImpressionEmptyCart OrderLines}}}</text> 5523 } 5524 @RenderBlockList(subBlocks) 5525 {{/unless}} 5526 {{#if isEmpty}} 5527 {{{locationReload '@cartPageLink'}}} 5528 {{/if}} 5529 {{/.}} 5530 </script> 5531 } 5532 5533 @helper RenderMiniCartOrderLinesTable() 5534 { 5535 List<Block> subBlocks = this.masterPage.GetBlockListById("MiniCartOrderLines").OrderBy(item => item.SortId).ToList(); 5536 5537 <div class="u-overflow-auto"> 5538 <table class="table mini-cart-table dw-mod"> 5539 @RenderBlockList(subBlocks) 5540 </table> 5541 </div> 5542 } 5543 5544 @helper RenderMiniCartOrderLinesBlocks() 5545 { 5546 List<Block> subBlocks = this.masterPage.GetBlockListById("MiniCartOrderLines").OrderBy(item => item.SortId).ToList(); 5547 5548 <div class="u-overflow-auto"> 5549 @RenderBlockList(subBlocks) 5550 </div> 5551 } 5552 5553 @helper RenderMiniCartOrderLinesHeader() 5554 { 5555 <thead> 5556 <tr> 5557 <td>&nbsp;</td> 5558 <td>@Translate("Product")</td> 5559 <td class="u-ta-right">@Translate("Qty")</td> 5560 <td class="u-ta-right" width="120">@Translate("Price")</td> 5561 </tr> 5562 </thead> 5563 } 5564 5565 @helper RenderMiniCartOrderLinesList() 5566 { 5567 <text> 5568 {{#OrderLines}} 5569 {{#ifCond template "===" "CartOrderline"}} 5570 {{>MiniCartOrderline}} 5571 {{/ifCond}} 5572 {{#ifCond template "===" "CartOrderlineMobile"}} 5573 {{>MiniCartOrderline}} 5574 {{/ifCond}} 5575 {{#ifCond template "===" "CartOrderlineDiscount"}} 5576 {{>MiniCartOrderlineDiscount}} 5577 {{/ifCond}} 5578 {{/OrderLines}} 5579 </text> 5580 } 5581 5582 @helper RenderMiniCartFees() 5583 { 5584 @* CS NT Hide Payment Method 5585 <div class="grid u-border-top grid--external-bleed-bottom"> 5586 <div class="grid__col-6"> 5587 {{paymentmethod}} 5588 </div> 5589 <div class="grid__col-6 grid--align-end">{{paymentfee}}</div> 5590 </div> 5591 *@ 5592 <div class="grid grid--external-bleed-bottom"> 5593 <div class="grid__col-6"> 5594 {{shippingmethod}} 5595 </div> 5596 <div class="grid__col-6 grid--align-end">{{shippingfee}}</div> 5597 </div> 5598 } 5599 5600 @helper RenderMiniCartFooter() 5601 { 5602 List<Block> subBlocks = this.masterPage.GetBlockListById("MiniCartFooter").OrderBy(item => item.SortId).ToList(); 5603 5604 <div class="mini-cart__footer dw-mod"> 5605 @RenderBlockList(subBlocks) 5606 </div> 5607 } 5608 5609 @helper RenderMiniCartActions() 5610 { 5611 int cartPageId = GetPageIdByNavigationTag("CartPage"); 5612 5613 <button type="button" title="@Translate("Empty cart")" class="btn btn--secondary u-full-width dw-mod u-no-margin u-margin-bottom" onclick="googleEnchantImpressionEmptyCart(); Cart.EmptyCart(event);">@Translate("Empty cart")</button> 5614 <a href="/Default.aspx?ID=@cartPageId" title="@Translate("Proceed to checkout")" class="btn btn--primary u-full-width u-no-margin dw-mod">@Translate("Proceed to checkout")</a> 5615 } 5616 5617 @helper RenderMiniCartPoints() 5618 { 5619 <text> 5620 {{#if earnings}} 5621 <div class="grid grid--external-bleed-bottom"> 5622 <div class="grid__col-6">@Translate("Earnings")</div> 5623 <div class="grid__col-6 grid--align-end"> 5624 <div> 5625 <span class="u-color--loyalty-points">{{earnings}}</span> @Translate("points") 5626 </div> 5627 </div> 5628 </div> 5629 {{/if}} 5630 </text> 5631 } 5632 5633 @helper RenderMiniCartTotal() 5634 { 5635 <div class="mini-cart-totals grid u-margin-bottom dw-mod"> 5636 <div class="grid__col-6">@Translate("Total")</div> 5637 <div class="grid__col-6 grid--align-end">{{totalprice}}</div> 5638 </div> 5639 } 5640 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 5641 5642 @using Dynamicweb.Rapido.Blocks.Extensibility 5643 @using Dynamicweb.Rapido.Blocks 5644 5645 @{ 5646 bool addToCartNotificationOnlyPreview = Model.Area.Item.GetItem("Ecommerce").GetBoolean("OnlyPreviewForAnonymous") && Model.CurrentUser.ID == 0; 5647 string addToCartNotificationType = Model.Area.Item.GetItem("Ecommerce").GetItem("MiniCart").GetList("AddToCartNotificationType") != null ? Model.Area.Item.GetItem("Ecommerce").GetItem("MiniCart").GetList("AddToCartNotificationType").SelectedValue : ""; 5648 5649 if (!addToCartNotificationOnlyPreview && !string.IsNullOrEmpty(addToCartNotificationType)) { 5650 if (addToCartNotificationType == "modal") 5651 { 5652 Block addToCartNotificationModal = new Block 5653 { 5654 Id = "AddToCartNotificationModal", 5655 Template = RenderAddToCartNotificationModal() 5656 }; 5657 5658 Block addToCartNotificationScript = new Block 5659 { 5660 Id = "AddToCartNotificationScript", 5661 Template = RenderAddToCartNotificationModalScript() 5662 }; 5663 BlocksPage.GetBlockPage("Master").Add("MasterTopSnippets", addToCartNotificationModal); 5664 BlocksPage.GetBlockPage("Master").Add("MasterBottomSnippets", addToCartNotificationScript); 5665 } 5666 else if (addToCartNotificationType == "toggle") 5667 { 5668 Block addToCartNotificationScript = new Block 5669 { 5670 Id = "AddToCartNotificationScript", 5671 Template = RenderAddToCartNotificationToggleScript() 5672 }; 5673 BlocksPage.GetBlockPage("Master").Add("MasterBottomSnippets", addToCartNotificationScript); 5674 } 5675 } 5676 } 5677 5678 @helper RenderAddToCartNotificationModal() 5679 { 5680 <div id="LastAddedProductModal" data-template="LastAddedProductTemplate"></div> 5681 } 5682 5683 @helper RenderAddToCartNotificationModalScript() 5684 { 5685 int cartPageId = GetPageIdByNavigationTag("CartPage"); 5686 5687 <script id="LastAddedProductTemplate" type="text/x-template"> 5688 <!-- Trigger for the login modal --> 5689 <input type="checkbox" id="LastAddedProductModalTrigger" class="modal-trigger" /> 5690 5691 <!-- Login modal --> 5692 <div class="modal-container"> 5693 <label for="LastAddedProductModalTrigger" class="modal-overlay"></label> 5694 <div class="modal modal--md"> 5695 <div class="modal__header"> 5696 <h2>@Translate("Product is added to the cart")</h2> 5697 </div> 5698 <div class="modal__body"> 5699 <div class="grid"> 5700 <div class="grid__col-2"> 5701 <a href="{{productInfo.link}}"> 5702 <img src="{{productInfo.image}}" alt="{{productInfo.name}}" class="dw-mod" /> 5703 </a> 5704 </div> 5705 <div class="u-padding grid--align-self-center"> 5706 <span>{{quantity}}</span> x 5707 </div> 5708 <div class="grid__col-auto grid--align-self-center"> 5709 <div>{{productInfo.name}}</div> 5710 {{#if productInfo.variantName}} 5711 <small class="u-margin-bottom-5px">{{productInfo.variantName}}</small> 5712 {{/if}} 5713 {{#if productInfo.unitName}} 5714 <small class="u-margin-bottom-5px">{{productInfo.unitName}}</small> 5715 {{/if}} 5716 </div> 5717 </div> 5718 <div class="modal__footer u-margin-top--lg"> 5719 <label class="btn btn--secondary u-pull--left u-no-margin dw-mod btn--sm" for="LastAddedProductModalTrigger">@Translate("Continue shopping")</label> 5720 <a href="/Default.aspx?ID=@cartPageId" class="btn btn--primary u-pull--right u-no-margin dw-mod btn--sm">@Translate("Proceed to checkout")</a> 5721 </div> 5722 </div> 5723 <label class="modal__close-btn" for="LastAddedProductModalTrigger"></label> 5724 </div> 5725 </div> 5726 </script> 5727 <script> 5728 document.addEventListener('addToCart', function (event) { 5729 Cart.ShowLastAddedProductModal(event.detail); 5730 }); 5731 </script> 5732 } 5733 5734 @helper RenderAddToCartNotificationToggleScript() 5735 { 5736 int miniCartFeedPageId = GetPageIdByNavigationTag("MiniCartFeed"); 5737 5738 <script> 5739 document.addEventListener('addToCart', function () { 5740 Cart.ToggleMiniCart('miniCartTrigger', 'miniCart', 'cartCounter', '@miniCartFeedPageId'); 5741 }); 5742 </script> 5743 } 5744 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 5745 5746 @using System 5747 @using System.Web 5748 @using System.Collections.Generic 5749 @using Dynamicweb.Rapido.Blocks.Extensibility 5750 @using Dynamicweb.Rapido.Blocks 5751 5752 @functions { 5753 BlocksPage footerBlocksPage = BlocksPage.GetBlockPage("Master"); 5754 } 5755 5756 @{ 5757 string footerColumnOneContent = Model.Area.Item.GetItem("Layout").GetItem("FooterColumnOne").GetString("Content"); 5758 string footerColumnTwoContent = Model.Area.Item.GetItem("Layout").GetItem("FooterColumnTwo").GetString("Content"); 5759 string footerColumnThreeContent = Model.Area.Item.GetItem("Layout").GetItem("FooterColumnThree").GetString("Content"); 5760 string footerColumnOneHeader = Model.Area.Item.GetItem("Layout").GetItem("FooterColumnOne").GetString("Header"); 5761 string footerColumnTwoHeader = Model.Area.Item.GetItem("Layout").GetItem("FooterColumnTwo").GetString("Header"); 5762 string footerColumnThreeHeader = Model.Area.Item.GetItem("Layout").GetItem("FooterColumnThree").GetString("Header"); 5763 5764 Block masterFooterContent = new Block() 5765 { 5766 Id = "MasterFooterContent", 5767 SortId = 10, 5768 Template = RenderFooter(), 5769 SkipRenderBlocksList = true 5770 }; 5771 footerBlocksPage.Add(MasterBlockId.MasterFooter, masterFooterContent); 5772 5773 if (!string.IsNullOrEmpty(footerColumnOneContent) || !string.IsNullOrEmpty(footerColumnOneHeader)) 5774 { 5775 Block masterFooterColumnOne = new Block 5776 { 5777 Id = "MasterFooterColumnOne", 5778 SortId = 10, 5779 Template = RenderFooterColumn(footerColumnOneHeader, footerColumnOneContent), 5780 Design = new Design { 5781 Size = "auto", 5782 RenderType = RenderType.Column 5783 } 5784 }; 5785 footerBlocksPage.Add("MasterFooterContent", masterFooterColumnOne); 5786 } 5787 5788 if (!string.IsNullOrEmpty(footerColumnTwoContent) || !string.IsNullOrEmpty(footerColumnTwoHeader)) 5789 { 5790 Block masterFooterColumnTwo = new Block 5791 { 5792 Id = "MasterFooterColumnTwo", 5793 SortId = 20, 5794 Template = RenderFooterColumn(footerColumnTwoHeader, footerColumnTwoContent), 5795 Design = new Design 5796 { 5797 Size = "auto", 5798 RenderType = RenderType.Column 5799 } 5800 }; 5801 footerBlocksPage.Add("MasterFooterContent", masterFooterColumnTwo); 5802 } 5803 5804 if (!string.IsNullOrEmpty(footerColumnThreeContent) || !string.IsNullOrEmpty(footerColumnThreeHeader)) 5805 { 5806 Block masterFooterColumnThree = new Block 5807 { 5808 Id = "MasterFooterColumnThree", 5809 SortId = 30, 5810 Template = RenderFooterColumn(footerColumnThreeHeader, footerColumnThreeContent), 5811 Design = new Design 5812 { 5813 Size = "auto", 5814 RenderType = RenderType.Column 5815 } 5816 }; 5817 footerBlocksPage.Add("MasterFooterContent", masterFooterColumnThree); 5818 } 5819 5820 if (Model.Area.Item.GetItem("Layout").GetBoolean("FooterNewsletterSignUp")) 5821 { 5822 Block masterFooterNewsletterSignUp = new Block 5823 { 5824 Id = "MasterFooterNewsletterSignUp", 5825 SortId = 40, 5826 Template = RenderFooterNewsletterSignUp(), 5827 Design = new Design 5828 { 5829 Size = "auto", 5830 RenderType = RenderType.Column 5831 } 5832 }; 5833 footerBlocksPage.Add("MasterFooterContent", masterFooterNewsletterSignUp); 5834 } 5835 5836 if (Model.Area.Item.GetItem("Layout").GetItems("FooterSocialLinks") != null && Model.Area.Item.GetItem("Layout").GetItems("FooterSocialLinks").Count > 0) 5837 { 5838 Block masterFooterSocialLinks = new Block 5839 { 5840 Id = "MasterFooterSocialLinks", 5841 SortId = 50, 5842 Template = RenderFooterSocialLinks(), 5843 Design = new Design 5844 { 5845 Size = "auto", 5846 RenderType = RenderType.Column 5847 } 5848 }; 5849 footerBlocksPage.Add("MasterFooterContent", masterFooterSocialLinks); 5850 } 5851 5852 if (Model.Area.Item.GetItem("Layout").GetItems("FooterPayments") != null && Model.Area.Item.GetItem("Layout").GetItems("FooterPayments").Count > 0) 5853 { 5854 Block masterFooterPayments = new Block 5855 { 5856 Id = "MasterFooterPayments", 5857 SortId = 60, 5858 Template = RenderFooterPayments(), 5859 Design = new Design 5860 { 5861 Size = "12", 5862 RenderType = RenderType.Column 5863 } 5864 }; 5865 footerBlocksPage.Add("MasterFooterContent", masterFooterPayments); 5866 } 5867 5868 Block masterFooterCopyright = new Block 5869 { 5870 Id = "MasterFooterCopyright", 5871 SortId = 70, 5872 Template = RenderFooterCopyright(), 5873 Design = new Design 5874 { 5875 Size = "12", 5876 RenderType = RenderType.Column 5877 } 5878 }; 5879 footerBlocksPage.Add("MasterFooterContent", masterFooterCopyright); 5880 } 5881 5882 @helper RenderFooter() { 5883 List<Block> subBlocks = this.footerBlocksPage.GetBlockListById("MasterFooterContent").OrderBy(item => item.SortId).ToList(); 5884 5885 <footer class="footer dw-mod"> 5886 <div class="center-container top-container__center-container dw-mod"> 5887 <div class="grid grid--external-bleed-x"> 5888 @RenderBlockList(subBlocks) 5889 </div> 5890 </div> 5891 </footer> 5892 } 5893 5894 @helper RenderFooterColumn(string header, string content) { 5895 <h3 class="footer__heading dw-mod">@header</h3> 5896 <div class="footer__content dw-mod"> 5897 @content 5898 </div> 5899 } 5900 5901 @helper RenderFooterNewsletterSignUp() { 5902 string newsletterSignUpPageId = GetPageIdByNavigationTag("NewsletterSignUp").ToString(); 5903 5904 <h3 class="footer__heading dw-mod">@Translate("Mailing list")</h3> 5905 <div class="footer__content dw-mod"> 5906 <form class="form dw-mod" name="NewsletterRedirect" action='/Default.aspx' method="get" enctype="multipart/form-data"> 5907 <input name="ID" value="@newsletterSignUpPageId" type="hidden" /> 5908 <label for="NewsletterEmail" class="u-margin-bottom">@Translate("Sign up if you would like to receive occasional treats from us", "Sign up if you would like to receive occasional treats from us")</label> 5909 <div class="form__field-combi"> 5910 <input name="NewsletterEmail" id="NewsletterEmail" type="text" placeholder='@Translate("Your email address", "Your email address")' class="u-full-width use-btn-primary-height" /> 5911 <input class="btn btn--primary btn--condensed dw-mod" type="submit" id="Submitter" value='@Translate("Go", "Go")' /> 5912 </div> 5913 </form> 5914 </div> 5915 } 5916 5917 @helper RenderFooterSocialLinks() { 5918 <h3 class="footer__heading dw-mod">@Translate("Social links")</h3> 5919 <div class="footer__content dw-mod"> 5920 <div class="collection dw-mod"> 5921 @foreach (var socialitem in Model.Area.Item.GetItem("Layout").GetItems("FooterSocialLinks")) 5922 { 5923 var socialIcon = socialitem.GetValue("Icon") as Dynamicweb.Frontend.ListViewModel; 5924 string socialIconClass = socialIcon.SelectedValue; 5925 string socialIconTitle = socialIcon.SelectedName; 5926 string socialLink = socialitem.GetString("Link"); 5927 5928 <a href="@socialLink" target="_blank" title="@socialIconTitle" class="u-margin-bottom-5px" rel="noopener"><i class="@socialIconClass fa-2x"></i></a> 5929 } 5930 </div> 5931 </div> 5932 } 5933 5934 @helper RenderFooterPayments() { 5935 <div class="footer__content dw-mod"> 5936 <div class="collection dw-mod"> 5937 @foreach (var payment in Model.Area.Item.GetItem("Layout").GetItems("FooterPayments")) 5938 { 5939 var paymentItem = payment.GetValue("CardTypeOrVerifiedPayment") as Dynamicweb.Frontend.ListViewModel; 5940 string paymentImage = null; 5941 string paymentTitle = paymentItem.SelectedName; 5942 ListOptionViewModel selected = paymentItem.SelectedOptions.FirstOrDefault(); 5943 if (selected != null) 5944 { 5945 paymentImage = selected.Icon; 5946 } 5947 5948 <div class="footer__card-type"> 5949 <img class="b-lazy" src="/Files/Images/placeholder.gif" data-src="/Admin/Public/GetImage.ashx?width=60&Compression=75&image=@paymentImage" alt="@paymentTitle" title="@paymentTitle" /> 5950 </div> 5951 } 5952 </div> 5953 </div> 5954 } 5955 5956 @helper RenderFooterCopyright() { 5957 <div class="grid__col-12 footer__copyright dw-mod"> 5958 <p>@Model.Area.Item.GetItem("Layout").GetString("FooterCopyrightText")</p> 5959 </div> 5960 } 5961 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 5962 5963 @using System 5964 @using System.Web 5965 @using System.Collections.Generic 5966 @using Dynamicweb.Rapido.Blocks.Extensibility 5967 @using Dynamicweb.Rapido.Blocks 5968 @using Dynamicweb.Ecommerce.Common 5969 5970 @{ 5971 BlocksPage referencesBlocksPage = BlocksPage.GetBlockPage("Master"); 5972 5973 Block masterScriptReferences = new Block() 5974 { 5975 Id = "MasterScriptReferences", 5976 SortId = 1, 5977 Template = RenderMasterScriptReferences() 5978 }; 5979 referencesBlocksPage.Add(MasterBlockId.MasterReferences, masterScriptReferences); 5980 } 5981 5982 @helper RenderMasterScriptReferences() { 5983 <script src="/Files/Templates/Designs/Rapido/js/handlebars-v4.0.12.min.js"></script> 5984 <script src="/Files/Templates/Designs/Rapido/js/master.min.js"></script> 5985 5986 if (Model.Area.Item.GetItem("Custom").GetBoolean("UseCustomJavascript")) 5987 { 5988 <script src="/Files/Templates/Designs/Rapido/js/custom.min.js"></script> 5989 PushPromise("/Files/Templates/Designs/Rapido/js/custom.min.js"); 5990 } 5991 5992 PushPromise("/Files/Templates/Designs/Rapido/js/handlebars-v4.0.12.min.js"); 5993 PushPromise("/Files/Templates/Designs/Rapido/js/master.min.js"); 5994 } 5995 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 5996 5997 @using System 5998 @using System.Web 5999 @using System.Collections.Generic 6000 @using Dynamicweb.Rapido.Blocks.Extensibility 6001 @using Dynamicweb.Rapido.Blocks 6002 6003 @{ 6004 BlocksPage searchBlocksPage = BlocksPage.GetBlockPage("Master"); 6005 bool navigationItemsHideSearch = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("HideSearch"); 6006 6007 if (!navigationItemsHideSearch) 6008 { 6009 Block masterSearchScriptTemplates = new Block() 6010 { 6011 Id = "MasterSearchScriptTemplates", 6012 SortId = 1, 6013 Template = RenderSearchScriptTemplates() 6014 }; 6015 6016 searchBlocksPage.Add(MasterBlockId.MasterBottomSnippets, masterSearchScriptTemplates); 6017 } 6018 } 6019 6020 @helper RenderSearchScriptTemplates() 6021 { 6022 int productsPageId = GetPageIdByNavigationTag("ProductsPage"); 6023 string contentSearchPageLink = GetPageIdByNavigationTag("ContentSearchResults") + "&Areaid=" + Model.Area.ID; 6024 bool useFacebookPixel = !string.IsNullOrWhiteSpace(Pageview.AreaSettings.GetItem("Settings").GetString("FacebookPixelID")); 6025 bool onlyPreview = Model.Area.Item.GetItem("Ecommerce").GetBoolean("OnlyPreviewForAnonymous") && Model.CurrentUser.ID == 0; 6026 bool useGoogleTagManager = !string.IsNullOrEmpty(Model.Area.Item.GetItem("Settings").GetString("GoogleTagManagerID")); 6027 bool showPrice = !Pageview.AreaSettings.GetItem("Layout").GetBoolean("HidePriceInSearchResults"); 6028 bool showAddToCartButton = !Pageview.AreaSettings.GetItem("Layout").GetBoolean("HideAddToCartButton"); 6029 bool showViewButton = !Pageview.AreaSettings.GetItem("Layout").GetBoolean("HideViewButton"); 6030 bool showAddToDownloadButton = Pageview.AreaSettings.GetItem("Layout").GetBoolean("ShowAddToDownloadButton"); 6031 bool pointShopOnly = Pageview.AreaSettings.GetItem("Ecommerce").GetBoolean("PointShopOnly"); 6032 6033 <script id="SearchGroupsTemplate" type="text/x-template"> 6034 {{#.}} 6035 <li class="dropdown__item dw-mod" onclick="Search.UpdateGroupSelection(this)" data-group-id="{{id}}">{{name}}</li> 6036 {{/.}} 6037 </script> 6038 6039 <script id="SearchProductsTemplate" type="text/x-template"> 6040 {{#each .}} 6041 {{#Product}} 6042 {{#ifCond template "!==" "SearchMore"}} 6043 <li class="dropdown__item dropdown__item--seperator dw-mod"> 6044 @if (useFacebookPixel) 6045 { 6046 <text>{{{facebookPixelSearch name number priceDouble currency searchParameter}}}</text> 6047 } 6048 @if (useGoogleTagManager) 6049 { 6050 <text>{{{googleEnchantImpression 'Search results' currency googleImpression}}}</text> 6051 } 6052 <div> 6053 <a href="{{link}}" class="js-typeahead-link u-color-inherit u-pull--left" onclick="{{googleImpressionClick}}" title="{{name}}"> 6054 <div class="u-margin-right u-pull--left {{noimage}} u-hidden-xs u-hidden-xxs"><img class="b-lazy" src="/Files/Images/placeholder.gif" data-src="/Admin/Public/GetImage.ashx?width=45&height=36&crop=5&FillCanvas=True&Compression=75&image={{image}}" alt="{{name}}"></div> 6055 <div class="u-pull--left"> 6056 <div class="u-bold u-max-w220px u-truncate-text js-typeahead-name">{{name}}</div> 6057 @if (showPrice && !onlyPreview) 6058 { 6059 if (pointShopOnly) 6060 { 6061 <text> 6062 {{#if havePointPrice}} 6063 <div> 6064 <span class="u-color--loyalty-points">{{points}}</span> @Translate("points") 6065 </div> 6066 {{else}} 6067 <small class="help-text u-no-margin">@Translate("Not available")</small> 6068 {{/if}} 6069 {{#unless canBePurchasedWithPoints}} 6070 {{#if havePointPrice}} 6071 <small class="help-text u-no-margin">@Translate("Not enough points to buy this")</small> 6072 {{/if}} 6073 {{/unless}} 6074 </text> 6075 } 6076 else 6077 { 6078 <div>{{price}}</div> 6079 } 6080 } 6081 </div> 6082 </a> 6083 <div class="u-margin-left u-pull--right"> 6084 @if (showAddToCartButton && !onlyPreview) { 6085 if (pointShopOnly) 6086 { 6087 <button type="button" class="btn btn--primary btn--condensed btn--full u-no-margin dw-mod {{hideBuyOptions}} js-ignore-click-outside {{#unless canBePurchasedWithPoints}}js-stay-disabled{{/unless}}" name="CartCmd" value="addWithPoints" 6088 onclick="Cart.AddToCart(event, { 6089 id: '{{productId}}', 6090 quantity: 1, 6091 buyForPoints: true, 6092 productInfo: {{productInfo}} 6093 }); {{facebookPixelAction}}" {{disabledBuyButton}}> 6094 <i class="@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("CartIcon").SelectedValue js-ignore-click-outside"></i> 6095 </button> 6096 } else { 6097 <button type="button" class="btn btn--primary btn--condensed btn--full u-no-margin dw-mod {{hideBuyOptions}} js-ignore-click-outside" 6098 onclick="Cart.AddToCart(event, { 6099 id: '{{productId}}', 6100 quantity: 1, 6101 productInfo: {{productInfo}} 6102 }); {{facebookPixelAction}}"> 6103 <i class="@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("CartIcon").SelectedValue js-ignore-click-outside"></i> 6104 </button> 6105 } 6106 <a href="{{link}}" onclick="{{googleImpressionClick}}" class="btn btn--secondary btn--condensed btn--full u-no-margin dw-mod {{hideViewMore}} js-ignore-click-outside" title="@Translate("View")">@Translate("View")</a> 6107 } 6108 else if (showViewButton) 6109 { 6110 <a href="{{link}}" onclick="{{googleImpressionClick}}" class="btn btn--secondary btn--condensed btn--full u-no-margin dw-mod js-ignore-click-outside" title="@Translate("View")">@Translate("View")</a> 6111 } 6112 @if (showAddToDownloadButton) 6113 { 6114 <button type="button" class="btn btn--primary u-no-margin btn--condensed dw-mod js-add-to-downloads" title="@Translate("Add")" data-product-id="{{productId}}"> 6115 <i class="fas fa-plus js-button-icon"></i> 6116 </button> 6117 } 6118 </div> 6119 </div> 6120 </li> 6121 {{/ifCond}} 6122 {{#ifCond template "===" "SearchMore"}} 6123 {{>SearchMoreProducts}} 6124 {{/ifCond}} 6125 {{/Product}} 6126 {{else}} 6127 <li class="dropdown__item dropdown__item--seperator dw-mod"> 6128 @Translate("Your search gave 0 results") 6129 </li> 6130 {{/each}} 6131 </script> 6132 6133 <script id="SearchMoreProducts" type="text/x-template"> 6134 <li class="dropdown__item dropdown__item--not-selectable {{stickToBottom}} dw-mod"> 6135 <a href="/Default.aspx?ID=@productsPageId&Search={{searchParameter}}&GroupID={{groupId}}" class="btn btn--primary btn--full u-no-margin dw-mod js-typeahead-link"> 6136 @Translate("View all") 6137 </a> 6138 </li> 6139 </script> 6140 6141 <script id="SearchMorePages" type="text/x-template"> 6142 <li class="dropdown__item dropdown__item--not-selectable {{stickToBottom}} dw-mod"> 6143 <a href="/Default.aspx?ID=@contentSearchPageLink&Search={{searchParameter}}" class="btn btn--primary btn--full u-no-margin dw-mod js-typeahead-link"> 6144 @Translate("View all") 6145 </a> 6146 </li> 6147 </script> 6148 6149 <script id="SearchPagesTemplate" type="text/x-template"> 6150 {{#each .}} 6151 {{#ifCond template "!==" "SearchMore"}} 6152 <li class="dropdown__item dropdown__item--seperator dw-mod"> 6153 <div> 6154 <a href="/Default.aspx?ID={{id}}" class="js-typeahead-link u-pull--left u-color-inherit"> 6155 <div class="u-margin-right u-pull--left"><i class="fa {{icon}} u-w20px u-ta-center"></i></div> 6156 <div class="u-pull--left"> 6157 <div class="u-bold u-truncate-text u-max-w220px js-typeahead-name">{{name}}</div> 6158 </div> 6159 </a> 6160 </div> 6161 </li> 6162 {{/ifCond}} 6163 {{#ifCond template "===" "SearchMore"}} 6164 {{>SearchMorePages}} 6165 {{/ifCond}} 6166 {{else}} 6167 <li class="dropdown__item dropdown__item--seperator dropdown__item--not-selectable dw-mod"> 6168 @Translate("Your search gave 0 results") 6169 </li> 6170 {{/each}} 6171 </script> 6172 6173 <script id="SearchPagesTemplateWrap" type="text/x-template"> 6174 <div class="dropdown__column-header">@Translate("Pages")</div> 6175 <ul class="dropdown__list u-min-w220px u-full-width u-margin-bottom dw-mod"> 6176 {{>SearchPagesTemplate}} 6177 </ul> 6178 </script> 6179 6180 <script id="SearchProductsTemplateWrap" type="text/x-template"> 6181 <div class="dropdown__column-header">@Translate("Products")</div> 6182 <ul class="dropdown__list u-min-w220px u-full-width u-margin-bottom dw-mod"> 6183 {{>SearchProductsTemplate}} 6184 </ul> 6185 </script> 6186 } 6187 6188 6189 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 6190 6191 @using System 6192 @using System.Web 6193 @using System.Collections.Generic 6194 @using Dynamicweb.Rapido.Blocks.Extensibility 6195 @using Dynamicweb.Rapido.Blocks 6196 6197 @{ 6198 BlocksPage bottomSnippetsBlocksPage = BlocksPage.GetBlockPage("Master"); 6199 6200 Block primaryBottomSnippets = new Block() 6201 { 6202 Id = "MasterJavascriptInitializers", 6203 SortId = 100, 6204 Template = RenderPrimaryBottomSnippets() 6205 }; 6206 bottomSnippetsBlocksPage.Add(MasterBlockId.MasterReferences, primaryBottomSnippets); 6207 } 6208 6209 @helper RenderPrimaryBottomSnippets() { 6210 bool isWireframeMode = Model.Area.Item.GetItem("Settings").GetBoolean("WireframeMode"); 6211 bool useGoogleTagManager = !string.IsNullOrEmpty(Pageview.AreaSettings.GetItem("Settings").GetString("GoogleTagManagerID")); 6212 6213 if (isWireframeMode) 6214 { 6215 <script> 6216 Wireframe.Init(true); 6217 </script> 6218 } 6219 6220 6221 if (useGoogleTagManager) 6222 { 6223 <script> 6224 document.addEventListener('addToCart', function(event) { 6225 var googleImpression = event.detail.productInfo.googleImpression; 6226 dataLayer.push({ 6227 'event': 'addToCart', 6228 'ecommerce': { 6229 'currencyCode': '@Dynamicweb.Ecommerce.Services.Currencies.GetDefaultCurrency().Code', 6230 'add': { 6231 'products': [{ 6232 'name': googleImpression.name, 6233 'id': googleImpression.id, 6234 'price': googleImpression.price, 6235 'brand': googleImpression.brand, 6236 'category': googleImpression.category, 6237 'variant': googleImpression.variant, 6238 'quantity': event.detail.quantity 6239 }] 6240 } 6241 } 6242 }); 6243 }); 6244 </script> 6245 } 6246 6247 //if digitalwarehouse 6248 if (Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("ShowDownloadCart")) 6249 { 6250 string cartContextId = Converter.ToString(HttpContext.Current.Application["DownloadCartContext"]); 6251 6252 if (string.IsNullOrEmpty(cartContextId)) { 6253 var moduleProps = Dynamicweb.Modules.Properties.GetParagraphModuleSettings(GetPageIdByNavigationTag("DownloadCart"), "eCom_CartV2"); 6254 var cartSettings = new Dynamicweb.Ecommerce.Cart.ModuleSettings(moduleProps); 6255 cartContextId = cartSettings.OrderContextID; 6256 HttpContext.Current.Application["DownloadCartContext"] = cartContextId; 6257 } 6258 6259 <script> 6260 let downloadCart = new DownloadCart({ 6261 cartPageId: @GetPageIdByNavigationTag("MiniCartFeed"), 6262 contextId: "@cartContextId", 6263 addButtonText: "@Translate("Add")", 6264 removeButtonText: "@Translate("Remove")" 6265 }); 6266 </script> 6267 } 6268 6269 <!--@Javascripts--> 6270 } 6271 @if (File.Exists(HttpContext.Current.Server.MapPath("/MasterBlocks/Custom__Blocks.cshtml"))) 6272 { 6273 <text>@inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 6274 6275 @using System 6276 @using System.Web 6277 @using System.Collections.Generic 6278 @using Dynamicweb.Rapido.Blocks 6279 6280 @{ 6281 BlocksPage masterCustomBlocksPage = BlocksPage.GetBlockPage("Master"); 6282 6283 }</text> 6284 } 6285 6286 6287 @functions { 6288 public class ManifestIcon 6289 { 6290 public string src { get; set; } 6291 public string type { get; set; } 6292 public string sizes { get; set; } 6293 } 6294 6295 public class Manifest 6296 { 6297 public string name { get; set; } 6298 public string short_name { get; set; } 6299 public string start_url { get; set; } 6300 public string display { get; set; } 6301 public string background_color { get; set; } 6302 public string theme_color { get; set; } 6303 public List<ManifestIcon> icons { get; set; } 6304 } 6305 } 6306 @{ 6307 if (!String.IsNullOrEmpty(Model.Area.Item.GetItem("Settings").GetString("AppName")) && Model.Area.Item.GetItem("Settings").GetFile("AppIcon") != null) { 6308 Manifest manifest = new Manifest 6309 { 6310 name = Model.Area.Item.GetItem("Settings").GetString("AppName"), 6311 short_name = !String.IsNullOrEmpty(Model.Area.Item.GetItem("Settings").GetString("AppShortName")) ? Model.Area.Item.GetItem("Settings").GetString("AppShortName") : Model.Area.Item.GetItem("Settings").GetString("AppName"), 6312 start_url = "/", 6313 display = "standalone", 6314 background_color = Model.Area.Item.GetItem("Settings").GetString("AppBackgroundColor"), 6315 theme_color = Model.Area.Item.GetItem("Settings").GetString("AppThemeColor") 6316 }; 6317 6318 manifest.icons = new List<ManifestIcon> { 6319 new ManifestIcon { 6320 src = "/Admin/Public/GetImage.ashx?width=192&height=192&crop=5&image=" + Model.Area.Item.GetItem("Settings").GetFile("AppIcon").PathUrlEncoded, 6321 sizes = "192x192", 6322 type = "image/png" 6323 }, 6324 new ManifestIcon { 6325 src = "/Admin/Public/GetImage.ashx?width=512&height=512&crop=5&image=" + Model.Area.Item.GetItem("Settings").GetFile("AppIcon").PathUrlEncoded, 6326 sizes = "512x512", 6327 type = "image/png" 6328 }, 6329 new ManifestIcon { 6330 src = "/Admin/Public/GetImage.ashx?width=1024&height=1024&crop=5&image=" + Model.Area.Item.GetItem("Settings").GetFile("AppIcon").PathUrlEncoded, 6331 sizes = "1024x1024", 6332 type = "image/png" 6333 } 6334 }; 6335 6336 string manifestFilePath = HttpContext.Current.Request.MapPath("/Files/Templates/Designs/Rapido/manifest.json"); 6337 string manifestJSON = Newtonsoft.Json.JsonConvert.SerializeObject(manifest); 6338 string currentManifest = File.ReadAllText(manifestFilePath); 6339 6340 if (manifestJSON != currentManifest) 6341 { 6342 File.WriteAllText(manifestFilePath, manifestJSON); 6343 } 6344 } 6345 } 6346 6347 @{ 6348 var swatches = new Dynamicweb.Content.Items.ColorSwatchService(); 6349 var brandColors = swatches.GetColorSwatch(1); 6350 string brandColorOne = brandColors.Palette["BrandColor1"]; 6351 6352 var nextechCSSfileInfo = new System.IO.FileInfo(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/Rapido/css/nextech.css"));//CS SOS Ticks 6353 var customJSfileInfo = new System.IO.FileInfo(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/Rapido/js/source/Custom.js"));//CS SOS Ticks 6354 } 6355 6356 <!DOCTYPE html> 6357 6358 <html lang="@Pageview.Area.CultureInfo.TwoLetterISOLanguageName"> 6359 <head> 6360 <!-- Rapido version 3.1 --> 6361 <meta charset="utf-8" /> 6362 <title>@Model.Title</title> 6363 <meta name="viewport" content="width=device-width, initial-scale=1.0"> 6364 <meta name="robots" content="index, follow"> 6365 <meta name="theme-color" content="@brandColorOne" /> 6366 6367 @Model.MetaTags 6368 6369 <!-- CS NT JQuery Library--> 6370 <script type="text/javascript" src="/Files/Templates/Designs/Rapido/js/jquery.min.js"></script> 6371 6372 <!-- CS NT Slick.js Library--> 6373 <script type="text/javascript" src="/Files/Templates/Designs/Rapido/js/slick.js"></script> 6374 6375 <!-- CS NT Custom.js from DW--> 6376 <script type="text/javascript" src="/Files/Templates/Designs/Rapido/js/source/Custom.js?ticks=@customJSfileInfo.LastWriteTime.Ticks.ToString()"></script> 6377 6378 <!-- Favicon --> 6379 <link href="@favicon" rel="icon" type="image/png"> 6380 6381 <!-- Base (Default, wireframe) styles --> 6382 <link rel="stylesheet" href="/Files/Templates/Designs/Rapido/css/base/base.min.css" type="text/css"> 6383 6384 <!-- Rapido Css from Website Settings --> 6385 <link rel="stylesheet" id="rapidoCss" href="@autoCssLink" type="text/css"> 6386 6387 <!-- Ignite Css (Custom site specific styles) --> 6388 <link rel="stylesheet" id="igniteCss" type="text/css" href="/Files/Templates/Designs/Rapido/css/ignite/ignite.min.css"> 6389 6390 <!-- Font awesome --> 6391 <link rel="stylesheet" href="@fontAwesomeCssLink" type="text/css"> 6392 6393 <!-- Flag icon --> 6394 <link rel="stylesheet" href="/Files/Templates/Designs/Rapido/css/fonts/flag-icon.min.css" type="text/css"> 6395 6396 <!-- CS NT Custom nextech.css--> 6397 <link rel="stylesheet" type="text/css" href="/Files/Templates/Designs/Rapido/css/nextech.css?ticks=@nextechCSSfileInfo.LastWriteTime.Ticks.ToString()"> 6398 6399 <!-- CS NT Custom slick.css--> 6400 <link rel="stylesheet" href="/Files/Templates/Designs/Rapido/css/slick.css" type="text/css"> 6401 6402 <!-- CS NT Custom slick-theme.css--> 6403 <link rel="stylesheet" href="/Files/Templates/Designs/Rapido/css/slick-theme.css" type="text/css"> 6404 6405 <!-- Google fonts --> 6406 @{ 6407 var family = string.Join("%7C", fonts.Where(x => !string.IsNullOrEmpty(x)).Distinct().Select(x => string.Format("{0}:100,200,300,400,500,600,700,800,900", x))); 6408 } 6409 <link href="https://fonts.googleapis.com/css?family=@family" rel="stylesheet"> 6410 @{ 6411 PushPromise(favicon); 6412 PushPromise(fontAwesomeCssLink); 6413 PushPromise("/Files/Templates/Designs/Rapido/css/base/base.min.css"); 6414 PushPromise(autoCssLink); 6415 PushPromise("/Files/Templates/Designs/Rapido/css/ignite/ignite.min.css"); 6416 PushPromise("/Files/Images/placeholder.gif"); 6417 PushPromise("/Files/Templates/Designs/Rapido/css/fonts/flag-icon.min.css"); 6418 } 6419 6420 @if (!String.IsNullOrEmpty(Model.Area.Item.GetItem("Settings").GetString("AppName"))) 6421 { 6422 <link rel="manifest" href="/Files/Templates/Designs/Rapido/manifest.json"> 6423 PushPromise("/Files/Templates/Designs/Rapido/manifest.json"); 6424 } 6425 6426 <!--Commented out by CS NT (Placed above) <script src="/Files/Templates/Designs/Rapido/js/jquery.min.js" type="text/javascript"></script>--> 6427 <script src="/Files/Templates/Designs/Rapido/js/classie.js" type="text/javascript"></script> 6428 <link rel="stylesheet" href="/Files/Templates/Designs/Rapido/css/fonts/FontAwesomePro/css/fontawesome-all.min.css" type="text/css" media="all" /> 6429 <link rel="stylesheet" href="/Files/Templates/Designs/Rapido/css/style.min.css" type="text/css" media="all" /> 6430 6431 <!--CS NT --> 6432 <script type="application/ld+json"> 6433 { 6434 "@@context": "http://schema.org", 6435 "@@type": "Organization", 6436 "name": "Superhome Center DIY", 6437 "url": "http://www.superhome.com.cy", 6438 "address": "", 6439 "sameAs": [ 6440 "https://www.facebook.com/SuperhomeCenterCy", 6441 "https://www.instagram.com/superhomecenter/", 6442 "https://www.youtube.com/channel/UCcCTL9VwHJhYZSc0phv_HoQ", 6443 "https://www.linkedin.com/company/superhome-center/about/" 6444 ] 6445 } 6446 </script> 6447 6448 </head> 6449 6450 <body> 6451 6452 @* The @RenderBlockList base helper is included in Components/GridBuilder.cshtml *@ 6453 @RenderBlockList(masterPage.BlocksRoot.BlocksList) 6454 6455 6456 @helper RenderMasterHeader() 6457 { 6458 List<Block> subBlocks = this.masterPage.GetBlockListById("MasterHeader").OrderBy(item => item.SortId).ToList(); 6459 bool isNavigationStickyMenu = Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet" && Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("StickyTop"); 6460 string stickyTop = isNavigationStickyMenu ? "top-container--sticky" : ""; 6461 6462 <header class="top-container @stickyTop dw-mod" id="Top"> 6463 @RenderBlockList(subBlocks) 6464 </header> 6465 } 6466 6467 @helper RenderMain() 6468 { 6469 List<Block> subBlocks = this.masterPage.GetBlockListById("MasterMain").OrderBy(item => item.SortId).ToList(); 6470 6471 <main class="site dw-mod"> 6472 @RenderBlockList(subBlocks) 6473 </main> 6474 } 6475 6476 @helper RenderPageContent() 6477 { 6478 bool isNavigationStickyMenu = Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet" && Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("StickyTop"); 6479 string pagePos = isNavigationStickyMenu ? "js-page-pos" : ""; 6480 6481 <div id="Page" class="page @pagePos"> 6482 <section class="center-container content-container dw-mod" id="content"> 6483 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 6484 6485 6486 @{ 6487 string columnClass = "12"; 6488 bool isProductPage = HttpContext.Current.Request.QueryString.Get("ProductID") != null; 6489 string backgroundColorClass = Model.PropertyItem.GetList("BackgroundColor") != null && !isProductPage ? "u-" + Model.PropertyItem.GetList("BackgroundColor").SelectedValue + "--bg" : ""; 6490 } 6491 6492 @if (Model.PropertyItem.GetList("ShowBreadcrumb").SelectedValue == "True") 6493 { 6494 <div class="grid__col-12 grid__col--bleed-y"> 6495 @RenderNavigation(new 6496 { 6497 id = "breadcrumb", 6498 template = "Breadcrumb.xslt" 6499 }) 6500 </div> 6501 } 6502 6503 <div class="grid"> 6504 @if (Model.PropertyItem.GetList("LeftMenu") != null && Model.PropertyItem.GetList("LeftMenu").SelectedValue == "True" && (Pageview.Page.NavigationSettings == null || !Pageview.Page.NavigationSettings.UseEcomGroups)) 6505 { 6506 var navigationMarkup = RenderNavigation(new 6507 { 6508 id = "leftnav", 6509 cssclass = "dwnavigation", 6510 startLevel = 2, 6511 expandmode = "all", 6512 endlevel = 5, 6513 template = "LeftNavigation.xslt" 6514 }); 6515 6516 if (!string.IsNullOrEmpty(navigationMarkup)) 6517 { 6518 <nav class="grid__col-md-3"> 6519 <div class="grid__cell"> 6520 @navigationMarkup 6521 </div> 6522 </nav> 6523 columnClass = "9"; 6524 } 6525 } 6526 <div class="grid__col-md-@columnClass grid__col--bleed"> 6527 <div class="grid"> 6528 @Model.Placeholder("dwcontent", "content", "default:true;sort:1") 6529 </div> 6530 </div> 6531 </div> 6532 6533 6534 @* Very small hack to make it cleanly, and easily possible to change the background color on a single page *@ 6535 @if (backgroundColorClass != "") 6536 { 6537 <script> 6538 document.getElementById("Page").classList.add("@backgroundColorClass"); 6539 </script> 6540 } 6541 </section> 6542 </div> 6543 } 6544 6545 </body> 6546 </html> 6547 6548