Error executing template "Designs/Rapido/_parsed/Page.parsed.cshtml"
System.Data.SqlClient.SqlException (0x80131904): Connection Timeout Expired.  The timeout period elapsed during the post-login phase.  The connection could have timed out while waiting for server to complete the login process and respond; Or it could have timed out while attempting to create multiple active connections.  The duration spent while attempting to connect to this server was - [Pre-Login] initialization=0; handshake=12240; [Login] initialization=0; authentication=0; [Post-Login] complete=2390;  ---> System.ComponentModel.Win32Exception (0x80004005): The wait operation timed out
   at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)
   at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)
   at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
   at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
   at System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry)
   at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
   at System.Data.SqlClient.SqlConnection.Open()
   at Dynamicweb.Data.DatabaseConnectionProvider.CreateConnection(Boolean open)
   at Dynamicweb.Data.Database.CreateConnection()
   at Dynamicweb.Data.Database.CreateDataReader(String sql, IDbConnection connection, IDbTransaction transaction, Int32 commandTimeout, Dictionary`2 sqlParams)
   at Dynamicweb.Ecommerce.Products.GroupShopRelation.get_CachedGroupShopRelations(GroupShopRelationType type)
   at Dynamicweb.Ecommerce.Products.GroupShopRelation.get_GroupShopRelationByGroupId(String theGroupId, String theShopId)
   at Dynamicweb.Ecommerce.Products.Group.get_ShopId()
   at Dynamicweb.Ecommerce.Products.GroupService.GetAllGroupsByLanguageIdAndShopId(String groupLanguageId, String shopId)
   at Dynamicweb.Ecommerce.Shops.Shop.GetTopLevelGroups(String languageId)
   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 CompiledRazorTemplates.Dynamic.RazorEngine_de49b1cd620f471e9615a0bb42008062.<RenderDesktopToolsNavigation>b__118_0(TextWriter __razor_helper_writer) in D:\dynamicweb.net\Solutions\Nextech\papaellinas.cloud.dynamicweb-cms.com\Files-rapidofull-live-20240522\Templates\Designs\Rapido\_parsed\Page.parsed.cshtml:line 5018
   at RazorEngine.Templating.TemplateWriter.ToString()
   at System.Lazy`1.CreateValue()
   at System.Lazy`1.LazyInitValue()
   at CompiledRazorTemplates.Dynamic.RazorEngine_de49b1cd620f471e9615a0bb42008062.<>c__DisplayClass3_0.<RenderBlock>b__0(TextWriter __razor_helper_writer) in D:\dynamicweb.net\Solutions\Nextech\papaellinas.cloud.dynamicweb-cms.com\Files-rapidofull-live-20240522\Templates\Designs\Rapido\_parsed\Page.parsed.cshtml:line 224
   at CompiledRazorTemplates.Dynamic.RazorEngine_de49b1cd620f471e9615a0bb42008062.<>c__DisplayClass2_0.<RenderBlockList>b__0(TextWriter __razor_helper_writer) in D:\dynamicweb.net\Solutions\Nextech\papaellinas.cloud.dynamicweb-cms.com\Files-rapidofull-live-20240522\Templates\Designs\Rapido\_parsed\Page.parsed.cshtml:line 166
   at CompiledRazorTemplates.Dynamic.RazorEngine_de49b1cd620f471e9615a0bb42008062.<RenderDesktopTools>b__116_0(TextWriter __razor_helper_writer) in D:\dynamicweb.net\Solutions\Nextech\papaellinas.cloud.dynamicweb-cms.com\Files-rapidofull-live-20240522\Templates\Designs\Rapido\_parsed\Page.parsed.cshtml:line 4998
   at RazorEngine.Templating.TemplateWriter.ToString()
   at System.Lazy`1.CreateValue()
   at System.Lazy`1.LazyInitValue()
   at CompiledRazorTemplates.Dynamic.RazorEngine_de49b1cd620f471e9615a0bb42008062.<>c__DisplayClass3_0.<RenderBlock>b__0(TextWriter __razor_helper_writer) in D:\dynamicweb.net\Solutions\Nextech\papaellinas.cloud.dynamicweb-cms.com\Files-rapidofull-live-20240522\Templates\Designs\Rapido\_parsed\Page.parsed.cshtml:line 224
   at CompiledRazorTemplates.Dynamic.RazorEngine_de49b1cd620f471e9615a0bb42008062.<>c__DisplayClass2_0.<RenderBlockList>b__0(TextWriter __razor_helper_writer) in D:\dynamicweb.net\Solutions\Nextech\papaellinas.cloud.dynamicweb-cms.com\Files-rapidofull-live-20240522\Templates\Designs\Rapido\_parsed\Page.parsed.cshtml:line 138
   at CompiledRazorTemplates.Dynamic.RazorEngine_de49b1cd620f471e9615a0bb42008062.<RenderMasterHeader>b__149_0(TextWriter __razor_helper_writer) in D:\dynamicweb.net\Solutions\Nextech\papaellinas.cloud.dynamicweb-cms.com\Files-rapidofull-live-20240522\Templates\Designs\Rapido\_parsed\Page.parsed.cshtml:line 6519
   at RazorEngine.Templating.TemplateWriter.ToString()
   at System.Lazy`1.CreateValue()
   at System.Lazy`1.LazyInitValue()
   at CompiledRazorTemplates.Dynamic.RazorEngine_de49b1cd620f471e9615a0bb42008062.<>c__DisplayClass3_0.<RenderBlock>b__0(TextWriter __razor_helper_writer) in D:\dynamicweb.net\Solutions\Nextech\papaellinas.cloud.dynamicweb-cms.com\Files-rapidofull-live-20240522\Templates\Designs\Rapido\_parsed\Page.parsed.cshtml:line 224
   at CompiledRazorTemplates.Dynamic.RazorEngine_de49b1cd620f471e9615a0bb42008062.<>c__DisplayClass2_0.<RenderBlockList>b__0(TextWriter __razor_helper_writer) in D:\dynamicweb.net\Solutions\Nextech\papaellinas.cloud.dynamicweb-cms.com\Files-rapidofull-live-20240522\Templates\Designs\Rapido\_parsed\Page.parsed.cshtml:line 138
   at CompiledRazorTemplates.Dynamic.RazorEngine_de49b1cd620f471e9615a0bb42008062.<RenderMain>b__150_0(TextWriter __razor_helper_writer) in D:\dynamicweb.net\Solutions\Nextech\papaellinas.cloud.dynamicweb-cms.com\Files-rapidofull-live-20240522\Templates\Designs\Rapido\_parsed\Page.parsed.cshtml:line 6530
   at RazorEngine.Templating.TemplateWriter.ToString()
   at System.Lazy`1.CreateValue()
   at System.Lazy`1.LazyInitValue()
   at CompiledRazorTemplates.Dynamic.RazorEngine_de49b1cd620f471e9615a0bb42008062.<>c__DisplayClass3_0.<RenderBlock>b__0(TextWriter __razor_helper_writer) in D:\dynamicweb.net\Solutions\Nextech\papaellinas.cloud.dynamicweb-cms.com\Files-rapidofull-live-20240522\Templates\Designs\Rapido\_parsed\Page.parsed.cshtml:line 224
   at CompiledRazorTemplates.Dynamic.RazorEngine_de49b1cd620f471e9615a0bb42008062.<>c__DisplayClass2_0.<RenderBlockList>b__0(TextWriter __razor_helper_writer) in D:\dynamicweb.net\Solutions\Nextech\papaellinas.cloud.dynamicweb-cms.com\Files-rapidofull-live-20240522\Templates\Designs\Rapido\_parsed\Page.parsed.cshtml:line 138
   at CompiledRazorTemplates.Dynamic.RazorEngine_de49b1cd620f471e9615a0bb42008062.<>c__DisplayClass3_0.<RenderBlock>b__0(TextWriter __razor_helper_writer) in D:\dynamicweb.net\Solutions\Nextech\papaellinas.cloud.dynamicweb-cms.com\Files-rapidofull-live-20240522\Templates\Designs\Rapido\_parsed\Page.parsed.cshtml:line 246
   at CompiledRazorTemplates.Dynamic.RazorEngine_de49b1cd620f471e9615a0bb42008062.<>c__DisplayClass2_0.<RenderBlockList>b__0(TextWriter __razor_helper_writer) in D:\dynamicweb.net\Solutions\Nextech\papaellinas.cloud.dynamicweb-cms.com\Files-rapidofull-live-20240522\Templates\Designs\Rapido\_parsed\Page.parsed.cshtml:line 138
   at CompiledRazorTemplates.Dynamic.RazorEngine_de49b1cd620f471e9615a0bb42008062.Execute() in D:\dynamicweb.net\Solutions\Nextech\papaellinas.cloud.dynamicweb-cms.com\Files-rapidofull-live-20240522\Templates\Designs\Rapido\_parsed\Page.parsed.cshtml:line 6509
   at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context, TextWriter reader)
   at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
   at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass16_0.<RunCompile>b__0(TextWriter writer)
   at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
   at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template)
   at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template)
   at Dynamicweb.Rendering.Template.RenderRazorTemplate()
ClientConnectionId:06b18447-72c6-4b66-a7f7-f3442275a163
Error Number:-2,State:0,Class:11

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