Quick Connectors
Reduce connection time & improve productivity
Testing, filling & evacuating in any industry:
Manufacturing, Automation, Automotive, Gas Processing, HVAC-R, Breathing Air.
Flat-Face Quick Connect Couplings
Quick, easy & safe changes for hydraulic systems.
The system consists of the TRC1 Quick Connect Coupling and the TRN1 Plug-in Fitting. The protective caps are recommended accessories.
H2 Refueling Components
Don‘t just talk about HYDROGEN. Connect it.
On-Vehicle & Dispenser components for real world applications. 70 MPa / 35 MPa
Nozzles, breakaways, filters, receptacles & check valves.
CNG Refueling Components
Superior quality for maximum reliability.
Field proven On-Vehicle & Dispenser components.
Nozzles, breakaways, filters, receptacles & check valves.
Check Valves
Outstanding quality for maximum reliability.
Various designs and materials such as stainless steel, steel and brass.
Customer-tailored solutions.
Components for Gas
Reliable & safe since 1983.
Shut-off valves, vacuum pressure relief modules, check valves & Filters for the assembly of safe technical gas systems and plants.
Ultra High Pressure Solutions
Components & systems for the highest pressure range
Valves, fittings & tubes, Hoses, pressure generators and pressure vessels.

Quality
Made in Germany


Certified
Quality Management System  
DIN EN ISO 9001:2015

Maximum
Safety


Through exceptional products
and high-quality materials,
Pressure Equipment Directive
2014/68/EU Annex III, Module H

Environmental Management


Sustainable action and
products, Environmental
Management System
DIN EN 14001:2015

In-house
Test Center


Extensive
testing during
development

Error executing template "Designs/Rapido/ContentPage/Paragraph/Articles.cshtml"
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Data.SqlClient.SqlException: A connection was successfully established with the server, but then an error occurred during the login process. (provider: SSL Provider, error: 0 - An existing connection was forcibly closed by the remote host.) ---> System.ComponentModel.Win32Exception: An existing connection was forcibly closed by the remote host
   --- End of inner exception stack trace ---
   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(CommandBuilder commandBuilder, IDbConnection connection, IDbTransaction transaction, Int32 commandTimeout)
   at Dynamicweb.Content.Items.Queries.Repository.FindChildPagesId(IEnumerable`1 pids, Boolean includeAllChildItems)
   at Dynamicweb.Content.Items.Queries.Repository.GetPagesByIds(IEnumerable`1 parentIds, Boolean includeChildItems, Boolean checkPermissions, List`1& childPages)
   at Dynamicweb.Content.Items.Queries.Repository.SelectByParentPageIds(IEnumerable`1 parentIds, Query query, Boolean includeParagraphs, Boolean includeChildItems, Boolean checkPermissions, Boolean includeInheritedItems)
   at Dynamicweb.ItemPublisher.Frontend.GetItems()
   at Dynamicweb.ItemPublisher.Frontend.List()
   at Dynamicweb.ItemPublisher.Frontend.GetContent()
   at Dynamicweb.ItemPublisher.Frontend.GetContentBySettings(String settings)
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at Dynamicweb.Extensibility.AddIns.AddInManager.InvokeFunction(Object instance, String functionName, Object[] arguments)
   at Dynamicweb.Rendering.TemplateBase`1.RenderItemList(Object settings)
   at CompiledRazorTemplates.Dynamic.RazorEngine_ca5901c0c4d24df98192dc6645fea1b7.<>c__DisplayClass64_0.<RenderArticleList>b__0(TextWriter __razor_helper_writer) in D:\dynamicweb.net\Solutions\Dynamicweb\weh.cloud.dynamicweb-cms.com\Files\Templates\Designs\Rapido\ContentPage\Paragraph\Articles.cshtml:line 2875
   at RazorEngine.Templating.TemplateWriter.ToString()
   at Dynamicweb.Rapido.Blocks.Components.ComponentBase.Render(Object component)
   at CompiledRazorTemplates.Dynamic.RazorEngine_ca5901c0c4d24df98192dc6645fea1b7.<>c__DisplayClass2_0.<Render>b__0(TextWriter __razor_helper_writer) in D:\dynamicweb.net\Solutions\Dynamicweb\weh.cloud.dynamicweb-cms.com\Files\Templates\Designs\Rapido\ContentPage\Paragraph\Articles.cshtml:line 198
   at CompiledRazorTemplates.Dynamic.RazorEngine_ca5901c0c4d24df98192dc6645fea1b7.Execute() in D:\dynamicweb.net\Solutions\Dynamicweb\weh.cloud.dynamicweb-cms.com\Files\Templates\Designs\Rapido\ContentPage\Paragraph\Articles.cshtml:line 21
   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()

1 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel> 2 @using System.IO 3 @using System.Web 4 @using Dynamicweb.Rapido.Blocks.Components 5 @using Dynamicweb.Rapido.Blocks.Components.Articles 6 @using Dynamicweb.Rapido.Blocks.Components.General 7 @using Dynamicweb.Rapido.Blocks 8 9 @{ 10 int pageId = Model.PageID; 11 bool hideTitle = Model.Item.GetBoolean("HideTitle"); 12 string itemType = Model.Item.GetString("ItemTypeName") != null ? Model.Item.GetString("ItemTypeName") : "DynamicArticle"; 13 string sourcePagsId = Model.Item.GetItem("GetArticlesFrom") != null ? Model.Item.GetItem("GetArticlesFrom").PageID.ToString() : Pageview.ID.ToString(); 14 } 15 16 <div class="articles-paragraph dw-mod"> 17 @if (!hideTitle) { 18 @Render(new Heading { Title = Model.Item.GetString("Title"), Level = 2, CssClass = "u-no-margin" }) 19 } 20 21 @Render(new ArticleList { Template = "../ItemPublisher/List/DynamicList.cshtml", PageSize = Model.Item.GetInt32("ArticlesListSize"), DisablePagination = true, SourcePage = sourcePagsId, SourceType = "Page", ItemType = itemType }) 22 </div> 23 24 25 @* Include the required Grid builder (Contains the methods @RenderBlockList and @RenderBlock) *@ 26 @using System.Text.RegularExpressions 27 @using System.Collections.Generic 28 @using System.Reflection 29 @using System.Web 30 @using System.Web.UI.HtmlControls 31 @using Dynamicweb.Rapido.Blocks.Components 32 @using Dynamicweb.Rapido.Blocks.Components.Articles 33 @using Dynamicweb.Rapido.Blocks.Components.Documentation 34 @using Dynamicweb.Rapido.Blocks 35 36 37 @*--- START: Base block renderers ---*@ 38 39 @helper RenderBlockList(List<Block> blocks) 40 { 41 bool debug = !String.IsNullOrEmpty(HttpContext.Current.Request.QueryString.Get("debug")) ? Convert.ToBoolean(HttpContext.Current.Request.QueryString.Get("debug")) : false; 42 blocks = blocks.OrderBy(item => item.SortId).ToList(); 43 44 foreach (Block item in blocks) 45 { 46 if (debug) { 47 <!-- Block START: @item.Id --> 48 } 49 50 if (item.Design == null) 51 { 52 @RenderBlock(item) 53 } 54 else if (item.Design.RenderType == RenderType.None) { 55 string cssClass = item.Design.CssClass != null ? item.Design.CssClass : ""; 56 57 <div class="@cssClass dw-mod"> 58 @RenderBlock(item) 59 </div> 60 } 61 else if (item.Design.RenderType != RenderType.Hide) 62 { 63 string cssClass = item.Design.CssClass != null ? item.Design.CssClass : ""; 64 65 if (!item.SkipRenderBlocksList) { 66 if (item.Design.RenderType == RenderType.Row) 67 { 68 <div class="grid grid--align-content-start @cssClass dw-mod" id="[email protected]"> 69 @RenderBlock(item) 70 </div> 71 } 72 73 if (item.Design.RenderType == RenderType.Column) 74 { 75 string hidePadding = item.Design.HidePadding ? "u-no-padding" : ""; 76 string size = item.Design.Size ?? "12"; 77 size = Regex.IsMatch(size, @"\d") ? "md-" + item.Design.Size : item.Design.Size; 78 79 <div class="[email protected] [email protected] grid__col-sm-12 grid__col-xs-12 @hidePadding @cssClass dw-mod" id="[email protected]"> 80 @RenderBlock(item) 81 </div> 82 } 83 84 if (item.Design.RenderType == RenderType.Table) 85 { 86 <table class="table @cssClass dw-mod" id="[email protected]"> 87 @RenderBlock(item) 88 </table> 89 } 90 91 if (item.Design.RenderType == RenderType.TableRow) 92 { 93 <tr class="@cssClass dw-mod" id="[email protected]"> 94 @RenderBlock(item) 95 </tr> 96 } 97 98 if (item.Design.RenderType == RenderType.TableColumn) 99 { 100 <td class="@cssClass dw-mod" id="[email protected]"> 101 @RenderBlock(item) 102 </td> 103 } 104 105 if (item.Design.RenderType == RenderType.CardHeader) 106 { 107 <div class="card-header @cssClass dw-mod"> 108 @RenderBlock(item) 109 </div> 110 } 111 112 if (item.Design.RenderType == RenderType.CardBody) 113 { 114 <div class="card @cssClass dw-mod"> 115 @RenderBlock(item) 116 </div> 117 } 118 119 if (item.Design.RenderType == RenderType.CardFooter) 120 { 121 <div class="card-footer @cssClass dw-mod"> 122 @RenderBlock(item) 123 </div> 124 } 125 } 126 else 127 { 128 @RenderBlock(item) 129 } 130 } 131 132 if (debug) { 133 <!-- Block END: @item.Id --> 134 } 135 } 136 } 137 138 @helper RenderBlock(Block item) 139 { 140 bool debug = !String.IsNullOrEmpty(HttpContext.Current.Request.QueryString.Get("debug")) ? Convert.ToBoolean(HttpContext.Current.Request.QueryString.Get("debug")) : false; 141 142 if (item.Template != null) 143 { 144 @BlocksPage.RenderTemplate(item.Template) 145 } 146 147 if (item.Component != null) 148 { 149 string customSufix = "Custom"; 150 string methodName = item.Component.HelperName; 151 152 ComponentBase[] methodParameters = new ComponentBase[1]; 153 methodParameters[0] = item.Component; 154 Type methodType = this.GetType(); 155 156 MethodInfo customMethod = methodType.GetMethod(methodName + customSufix); 157 MethodInfo generalMethod = methodType.GetMethod(methodName); 158 159 try { 160 if (debug) { 161 <!-- Component: @methodName.Replace("Render", "") --> 162 } 163 @customMethod.Invoke(this, methodParameters).ToString(); 164 } catch { 165 try { 166 @generalMethod.Invoke(this, methodParameters).ToString(); 167 } catch(Exception ex) { 168 throw new Exception(item.Component.GetType().Name + " method '" + methodName +"' could not be invoked", ex); 169 } 170 } 171 } 172 173 if (item.BlocksList.Count > 0 && !item.SkipRenderBlocksList) 174 { 175 @RenderBlockList(item.BlocksList) 176 } 177 } 178 179 @*--- END: Base block renderers ---*@ 180 181 182 @* Include the components *@ 183 @using Dynamicweb.Rapido.Blocks.Components 184 @using Dynamicweb.Rapido.Blocks.Components.General 185 @using Dynamicweb.Rapido.Blocks 186 @using System.IO 187 188 @* Required *@ 189 @using Dynamicweb.Rapido.Blocks.Components 190 @using Dynamicweb.Rapido.Blocks.Components.General 191 @using Dynamicweb.Rapido.Blocks 192 193 194 @helper Render(ComponentBase component) 195 { 196 if (component != null) 197 { 198 @component.Render(this) 199 } 200 } 201 202 @* Components *@ 203 @using System.Reflection 204 @using Dynamicweb.Rapido.Blocks.Components.General 205 206 207 @* Component *@ 208 209 @helper RenderIcon(Icon settings) 210 { 211 if (settings != null) 212 { 213 string color = settings.Color != null ? "style=\"color: " + settings.Color + "\"" : ""; 214 215 if (settings.Name != null) 216 { 217 if (string.IsNullOrEmpty(settings.Label)) 218 { 219 <i class="@settings.Prefix @settings.Name @settings.CssClass" @color></i> 220 } 221 else 222 { 223 if (settings.LabelPosition == IconLabelPosition.Before) 224 { 225 <div class="u-flex u-flex--align-items-center @settings.CssClass">@settings.Label <i class="@settings.Prefix @settings.Name u-margin-left" @color></i></div> 226 } 227 else 228 { 229 <div class="u-flex u-flex--align-items-center @settings.CssClass"><i class="@settings.Prefix @settings.Name u-margin-right--lg u-w20px" @color></i>@settings.Label</div> 230 } 231 } 232 } 233 else if (!string.IsNullOrEmpty(settings.Label)) 234 { 235 @settings.Label 236 } 237 } 238 } 239 @using System.Reflection 240 @using Dynamicweb.Rapido.Blocks.Components.General 241 @using Dynamicweb.Rapido.Blocks.Components 242 @using Dynamicweb.Core 243 244 @* Component *@ 245 246 @helper RenderButton(Button settings) 247 { 248 if (settings != null && (!string.IsNullOrEmpty(settings.Title) || settings.Icon != null)) 249 { 250 Dictionary<string, string> attributes = new Dictionary<string, string>(); 251 List<string> classList = settings.CssClass != null ? settings.CssClass.Split(' ').ToList() : new List<string>(); 252 if (settings.Disabled) { 253 attributes.Add("disabled", "true"); 254 classList.Add("disabled"); 255 } 256 257 if (!string.IsNullOrEmpty(settings.ConfirmText) || !string.IsNullOrEmpty(settings.ConfirmTitle)) 258 { 259 settings.Id = !string.IsNullOrEmpty(settings.Id) ? settings.Id : Guid.NewGuid().ToString("N"); 260 @RenderConfirmDialog(settings); 261 settings.OnClick = "document.getElementById('" + settings.Id + "ModalTrigger').checked = true"; 262 } 263 264 if (!string.IsNullOrEmpty(settings.Id)) { attributes.Add("id", settings.Id); } 265 if (!string.IsNullOrEmpty(settings.Name)) { attributes.Add("name", settings.Name); } 266 if (!string.IsNullOrEmpty(settings.AltText)) 267 { 268 attributes.Add("title", settings.AltText); 269 } 270 else if (!string.IsNullOrEmpty(settings.Title)) 271 { 272 string cleanTitle = Regex.Replace(settings.Title, "<.*?>", String.Empty); 273 cleanTitle = cleanTitle.Replace("&nbsp;", " "); 274 attributes.Add("title", cleanTitle); 275 } 276 277 var onClickEvents = new List<string>(); 278 if (!string.IsNullOrEmpty(settings.OnClick)) 279 { 280 onClickEvents.Add(settings.OnClick); 281 } 282 if (!string.IsNullOrEmpty(settings.Href)) 283 { 284 onClickEvents.Add("location.href='" + settings.Href + "'"); 285 } 286 if (onClickEvents.Count > 0) 287 { 288 attributes.Add("onClick", string.Join(";", onClickEvents)); 289 } 290 291 if (settings.ButtonLayout != ButtonLayout.None) 292 { 293 classList.Add("btn"); 294 string btnLayout = Enum.GetName(typeof(ButtonLayout), settings.ButtonLayout).ToLower(); 295 if (btnLayout == "linkclean") 296 { 297 btnLayout = "link-clean"; //fix 298 } 299 classList.Add("btn--" + btnLayout); 300 } 301 302 if (settings.Icon == null) 303 { 304 settings.Icon = new Icon(); 305 } 306 307 settings.Icon.CssClass += Enum.GetName(typeof(ButtonLayout), settings.ButtonLayout).ToLower() != "linkclean" ? " u-flex--align-center" : ""; 308 settings.Icon.Label = settings.Title; 309 310 attributes.Add("type", Enum.GetName(typeof(ButtonType), settings.ButtonType).ToLower()); 311 312 <button class="@string.Join(" ", classList) dw-mod" @ComponentMethods.AddAttributes(attributes) @ComponentMethods.AddAttributes(settings.ExtraAttributes)>@Render(settings.Icon)</button> 313 } 314 } 315 316 @helper RenderConfirmDialog(Button settings) 317 { 318 Modal confirmDialog = new Modal { 319 Id = settings.Id, 320 Width = ModalWidth.Sm, 321 Heading = new Heading 322 { 323 Level = 2, 324 Title = settings.ConfirmTitle 325 }, 326 BodyText = settings.ConfirmText 327 }; 328 329 confirmDialog.AddAction(new Button { Title = Translate("Cancel"), ButtonLayout = ButtonLayout.Secondary, OnClick = "document.getElementById('" + settings.Id + "ModalTrigger').checked = false"}); 330 confirmDialog.AddAction(new Button { Title = Translate("OK"), ButtonLayout = ButtonLayout.Primary, OnClick = "document.getElementById('" + settings.Id + "ModalTrigger').checked = false;" + settings.OnClick }); 331 332 @Render(confirmDialog) 333 } 334 @using Dynamicweb.Rapido.Blocks.Components.General 335 @using Dynamicweb.Rapido.Blocks.Components 336 @using Dynamicweb.Core 337 338 @helper RenderDashboard(Dashboard settings) 339 { 340 var widgets = settings.GetWidgets(); 341 342 if (!string.IsNullOrEmpty(settings.WidgetsBaseBackgroundColor)) 343 { 344 //set bg color for them 345 346 System.Drawing.Color color = System.Drawing.ColorTranslator.FromHtml(settings.WidgetsBaseBackgroundColor); 347 int r = Convert.ToInt16(color.R); 348 int g = Convert.ToInt16(color.G); 349 int b = Convert.ToInt16(color.B); 350 351 var count = widgets.Length; 352 var max = Math.Max(r, Math.Max(g, b)); 353 double step = 255.0 / (max * count); 354 var i = 0; 355 foreach (var widget in widgets) 356 { 357 i++; 358 359 var shade = "rgb(" + Converter.ToString(r * step * i).Replace(",", ".") + ", " + Converter.ToString(g * step * i).Replace(",", ".") + ", " + Converter.ToString(b * step * i).Replace(",", ".") + ")"; 360 widget.BackgroundColor = shade; 361 } 362 } 363 364 <div class="dashboard @settings.CssClass dw-mod" @ComponentMethods.AddAttributes(settings.ExtraAttributes)> 365 @foreach (var widget in widgets) 366 { 367 <div class="dashboard__widget"> 368 @Render(widget) 369 </div> 370 } 371 </div> 372 } 373 @using Dynamicweb.Rapido.Blocks.Components.General 374 @using Dynamicweb.Rapido.Blocks.Components 375 376 @helper RenderDashboardWidgetLink(DashboardWidgetLink settings) 377 { 378 if (!string.IsNullOrEmpty(settings.Link)) 379 { 380 var backgroundStyles = ""; 381 if (!string.IsNullOrEmpty(settings.BackgroundColor)) 382 { 383 backgroundStyles = "style=\"background-color:" + settings.BackgroundColor + "\""; 384 } 385 386 <a href="@settings.Link" class="widget widget--link @settings.CssClass dw-mod" @backgroundStyles title="@settings.Title" @ComponentMethods.AddAttributes(settings.ExtraAttributes)> 387 <div class="u-center-middle u-color-light"> 388 @if (settings.Icon != null) 389 { 390 settings.Icon.CssClass += "widget__icon"; 391 @Render(settings.Icon) 392 } 393 <div class="widget__title">@settings.Title</div> 394 </div> 395 </a> 396 } 397 } 398 @using Dynamicweb.Rapido.Blocks.Components.General 399 @using Dynamicweb.Rapido.Blocks.Components 400 401 @helper RenderDashboardWidgetCounter(DashboardWidgetCounter settings) 402 { 403 var backgroundStyles = ""; 404 if (!string.IsNullOrEmpty(settings.BackgroundColor)) 405 { 406 backgroundStyles = "style='background-color:" + settings.BackgroundColor + "'"; 407 } 408 409 <div class="widget @settings.CssClass dw-mod" @backgroundStyles @ComponentMethods.AddAttributes(settings.ExtraAttributes)> 410 <div class="u-center-middle u-color-light"> 411 @if (settings.Icon != null) 412 { 413 settings.Icon.CssClass += "widget__icon"; 414 @Render(settings.Icon) 415 } 416 <div class="widget__counter">@settings.Count</div> 417 <div class="widget__title">@settings.Title</div> 418 </div> 419 </div> 420 } 421 @using System.Reflection 422 @using Dynamicweb.Rapido.Blocks.Components.General 423 @using Dynamicweb.Rapido.Blocks.Components 424 @using Dynamicweb.Core 425 426 @* Component *@ 427 428 @helper RenderLink(Link settings) 429 { 430 if (settings != null && !string.IsNullOrEmpty(settings.Href) && (!string.IsNullOrEmpty(settings.Title) || settings.Icon != null)) 431 { 432 Dictionary<string, string> attributes = new Dictionary<string, string>(); 433 List<string> classList = settings.CssClass != null ? settings.CssClass.Split(' ').ToList() : new List<string>(); 434 if (settings.Disabled) 435 { 436 attributes.Add("disabled", "true"); 437 classList.Add("disabled"); 438 } 439 440 if (!string.IsNullOrEmpty(settings.AltText)) 441 { 442 attributes.Add("title", settings.AltText); 443 } 444 else if (!string.IsNullOrEmpty(settings.Title)) 445 { 446 attributes.Add("title", settings.Title); 447 } 448 449 if (!string.IsNullOrEmpty(settings.Id)) { attributes.Add("id", settings.Id); } 450 if (!string.IsNullOrEmpty(settings.Name)) { attributes.Add("name", settings.Name); } 451 if (!string.IsNullOrEmpty(settings.OnClick)) { attributes.Add("onClick", settings.OnClick); } 452 attributes.Add("href", settings.Href); 453 454 if (settings.ButtonLayout != ButtonLayout.None) 455 { 456 classList.Add("btn"); 457 string btnLayout = Enum.GetName(typeof(ButtonLayout), settings.ButtonLayout).ToLower(); 458 if (btnLayout == "linkclean") 459 { 460 btnLayout = "link-clean"; //fix 461 } 462 classList.Add("btn--" + btnLayout); 463 } 464 465 if (settings.Icon == null) 466 { 467 settings.Icon = new Icon(); 468 } 469 settings.Icon.Label = settings.Title; 470 471 if (settings.Target == LinkTargetType.Blank && settings.Rel == LinkRelType.None) 472 { 473 settings.Rel = LinkRelType.Noopener; 474 } 475 if (settings.Target != LinkTargetType.None) 476 { 477 attributes.Add("target", "_" + Enum.GetName(typeof(LinkTargetType), settings.Target).ToLower()); 478 } 479 if (settings.Download) 480 { 481 attributes.Add("download", "true"); 482 } 483 if (settings.Rel != LinkRelType.None) 484 { 485 attributes.Add("rel", Enum.GetName(typeof(LinkRelType), settings.Rel).ToLower()); 486 } 487 488 <a class="@string.Join(" ", classList) dw-mod" @ComponentMethods.AddAttributes(attributes) @ComponentMethods.AddAttributes(settings.ExtraAttributes)>@Render(settings.Icon)</a> 489 } 490 } 491 @using System.Reflection 492 @using Dynamicweb.Rapido.Blocks.Components 493 @using Dynamicweb.Rapido.Blocks.Components.General 494 @using Dynamicweb.Rapido.Blocks 495 496 497 @* Component *@ 498 499 @helper RenderRating(Rating settings) 500 { 501 if (settings.Score > 0) 502 { 503 int rating = settings.Score; 504 string iconType = "fa-star"; 505 506 switch (settings.Type.ToString()) { 507 case "Stars": 508 iconType = "fa-star"; 509 break; 510 case "Hearts": 511 iconType = "fa-heart"; 512 break; 513 case "Lemons": 514 iconType = "fa-lemon"; 515 break; 516 case "Bombs": 517 iconType = "fa-bomb"; 518 break; 519 } 520 521 <div class="u-ta-right"> 522 @for (int i = 0; i < settings.OutOf; i++) 523 { 524 <i class="@(rating > i ? "fas" : "far") @iconType"></i> 525 } 526 </div> 527 } 528 } 529 @using System.Reflection 530 @using Dynamicweb.Rapido.Blocks.Components.General 531 @using Dynamicweb.Rapido.Blocks.Components 532 533 534 @* Component *@ 535 536 @helper RenderSelectFieldOption(SelectFieldOption settings) 537 { 538 Dictionary<string, string> attributes = new Dictionary<string, string>(); 539 if (settings.Checked) { attributes.Add("selected", "true"); } 540 if (settings.Disabled) { attributes.Add("disabled", "true"); } 541 if (settings.Value != null) { attributes.Add("value", settings.Value); } 542 if (!string.IsNullOrEmpty(settings.Id)) { attributes.Add("id", settings.Id); } 543 544 <option @ComponentMethods.AddAttributes(attributes) @ComponentMethods.AddAttributes(settings.ExtraAttributes)>@settings.Label</option> 545 } 546 @using System.Reflection 547 @using Dynamicweb.Rapido.Blocks.Components.General 548 @using Dynamicweb.Rapido.Blocks.Components 549 550 551 @* Component *@ 552 553 @helper RenderNavigation(Navigation settings) { 554 @RenderNavigation(new 555 { 556 id = settings.Id, 557 cssclass = settings.CssClass, 558 startLevel = settings.StartLevel, 559 endlevel = settings.EndLevel, 560 expandmode = settings.Expandmode, 561 sitemapmode = settings.SitemapMode, 562 template = settings.Template 563 }) 564 } 565 @using Dynamicweb.Rapido.Blocks.Components.General 566 @using Dynamicweb.Rapido.Blocks.Components 567 568 569 @* Component *@ 570 571 @helper RenderBreadcrumbNavigation(BreadcrumbNavigation settings) { 572 settings.Id = String.IsNullOrEmpty(settings.Id) ? "breadcrumb" : settings.Id; 573 settings.Template = String.IsNullOrEmpty(settings.Template) ? "Breadcrumb.xslt" : settings.Template; 574 settings.StartLevel = settings.StartLevel == 0 ? 1 : settings.StartLevel; 575 settings.EndLevel = settings.EndLevel == 10 ? 1 : settings.EndLevel; 576 settings.Expandmode = String.IsNullOrEmpty(settings.Expandmode) ? "all" : settings.Expandmode; 577 settings.SitemapMode = false; 578 579 @RenderNavigation(settings) 580 } 581 @using Dynamicweb.Rapido.Blocks.Components.General 582 @using Dynamicweb.Rapido.Blocks.Components 583 584 585 @* Component *@ 586 587 @helper RenderLeftNavigation(LeftNavigation settings) { 588 settings.Id = String.IsNullOrEmpty(settings.Id) ? "breadcrumb" : settings.Id; 589 settings.Template = String.IsNullOrEmpty(settings.Template) ? "Breadcrumb.xslt" : settings.Template; 590 settings.StartLevel = settings.StartLevel == 0 ? 1 : settings.StartLevel; 591 settings.EndLevel = settings.EndLevel == 10 ? 1 : settings.EndLevel; 592 settings.Expandmode = String.IsNullOrEmpty(settings.Expandmode) ? "all" : settings.Expandmode; 593 594 <div class="grid__cell"> 595 @RenderNavigation(settings) 596 </div> 597 } 598 @using System.Reflection 599 @using Dynamicweb.Rapido.Blocks.Components.General 600 @using Dynamicweb.Core 601 602 @* Component *@ 603 604 @helper RenderHeading(Heading settings) 605 { 606 if (settings != null && !string.IsNullOrEmpty(settings.Title)) 607 { 608 string color = settings.Color != null ? "style=\"color: " + settings.Color + "\"" : ""; 609 string tagName = settings.Level != 0 ? "h" + settings.Level.ToString() : "div"; 610 611 @("<" + tagName + " class=\"" + settings.CssClass + " dw-mod\" " + color + ">") 612 if (!string.IsNullOrEmpty(settings.Link)) 613 { 614 @Render(new Link { Href = settings.Link, Icon = settings.Icon, Title = settings.Title, ButtonLayout = ButtonLayout.None }) 615 } 616 else 617 { 618 if (settings.Icon == null) 619 { 620 settings.Icon = new Icon(); 621 } 622 settings.Icon.Label = settings.Title; 623 @Render(settings.Icon) 624 } 625 @("</" + tagName + ">"); 626 } 627 } 628 @using Dynamicweb.Rapido.Blocks.Components 629 @using Dynamicweb.Rapido.Blocks.Components.General 630 @using Dynamicweb.Rapido.Blocks 631 632 633 @* Component *@ 634 635 @helper RenderImage(Image settings) 636 { 637 if (settings.FilterPrimary != ImageFilter.None || settings.FilterSecondary != ImageFilter.None) 638 { 639 Dictionary<string, string> optionalAttributes = new Dictionary<string, string>(); 640 if (!string.IsNullOrEmpty(settings.FilterColor)) { optionalAttributes.Add("style", "background-color: " + settings.FilterColor); } 641 642 if (settings.Caption != null) 643 { 644 @:<div> 645 } 646 647 var primaryFilterClass = settings.FilterPrimary.ToString().ToLower(); 648 var secondaryFilterClass = settings.FilterSecondary.ToString().ToLower(); 649 650 <div class="image-filter image-filter--@primaryFilterClass u-position-relative dw-mod" @ComponentMethods.AddAttributes(optionalAttributes)> 651 <div class="image-filter image-filter--@secondaryFilterClass dw-mod"> 652 @if (settings.Link != null) 653 { 654 <a href="@settings.Link"> 655 @RenderTheImage(settings) 656 </a> 657 } 658 else 659 { 660 @RenderTheImage(settings) 661 } 662 </div> 663 </div> 664 665 if (settings.Caption != null) 666 { 667 <span class="image-caption dw-mod">@settings.Caption</span> 668 @:</div> 669 } 670 } 671 else 672 { 673 if (settings.Caption != null) 674 { 675 @:<div> 676 } 677 if (!string.IsNullOrEmpty(settings.Link)) 678 { 679 <a href="@settings.Link"> 680 @RenderTheImage(settings) 681 </a> 682 } 683 else 684 { 685 @RenderTheImage(settings) 686 } 687 688 if (settings.Caption != null) 689 { 690 <span class="image-caption dw-mod">@settings.Caption</span> 691 @:</div> 692 } 693 } 694 } 695 696 @helper RenderTheImage(Image settings) 697 { 698 if (settings != null) 699 { 700 string alternativeImage = !string.IsNullOrEmpty(Pageview.AreaSettings.GetItem("Settings").GetString("AlternativeImage")) ? Pageview.AreaSettings.GetItem("Settings").GetFile("AlternativeImage").PathUrlEncoded : "/Images/missing_image.jpg"; 701 string placeholderImage = "/Files/Images/placeholder.gif"; 702 string imageEngine = "/Admin/Public/GetImage.ashx?"; 703 704 string imageStyle = ""; 705 706 switch (settings.Style) 707 { 708 case ImageStyle.Ball: 709 imageStyle = "grid__cell-img--ball"; 710 break; 711 712 case ImageStyle.Triangle: 713 imageStyle = "grid__cell-img--triangle"; 714 break; 715 } 716 717 if (settings.Style == ImageStyle.Ball || settings.Style == ImageStyle.Circle || settings.Style == ImageStyle.Triangle) 718 { 719 settings.ImageDefault.Crop = settings.ImageDefault.Crop == 5 ? settings.ImageDefault.Crop = 0 : settings.ImageDefault.Crop; 720 721 if (settings.ImageDefault != null) 722 { 723 settings.ImageDefault.Height = settings.ImageDefault.Width; 724 } 725 if (settings.ImageMedium != null) 726 { 727 settings.ImageMedium.Height = settings.ImageMedium.Width; 728 } 729 if (settings.ImageSmall != null) 730 { 731 settings.ImageSmall.Height = settings.ImageSmall.Width; 732 } 733 } 734 735 string defaultImage = imageEngine; 736 string imageSmall = ""; 737 string imageMedium = ""; 738 739 if (settings.DisableImageEngine) 740 { 741 defaultImage = settings.Path; 742 } 743 else 744 { 745 if (settings.ImageDefault != null) 746 { 747 defaultImage += Dynamicweb.Rapido.Services.Images.GetImagePathFromSettings(settings.ImageDefault); 748 749 if (settings.Path.GetType() != typeof(string)) 750 { 751 defaultImage += settings.Path != null ? "Image=" + settings.Path.PathUrlEncoded : ""; 752 defaultImage += settings.Path != null ? "&" + settings.Path.GetFocalPointParameters() : ""; 753 } 754 else 755 { 756 defaultImage += settings.Path != null ? "Image=" + settings.Path : ""; 757 } 758 759 defaultImage += "&AlternativeImage=" + alternativeImage; 760 } 761 762 if (settings.ImageSmall != null) 763 { 764 imageSmall = "data-src-small=\"" + imageEngine; 765 imageSmall += Dynamicweb.Rapido.Services.Images.GetImagePathFromSettings(settings.ImageSmall); 766 767 if (settings.Path.GetType() != typeof(string)) 768 { 769 imageSmall += settings.Path != null ? "Image=" + settings.Path.PathUrlEncoded : ""; 770 imageSmall += settings.Path != null ? "&" + settings.Path.GetFocalPointParameters() : ""; 771 } 772 else 773 { 774 imageSmall += settings.Path != null ? "Image=" + settings.Path : ""; 775 } 776 777 imageSmall += "&alternativeImage=" + alternativeImage; 778 779 imageSmall += "\""; 780 } 781 782 if (settings.ImageMedium != null) 783 { 784 imageMedium = "data-src-medium=\"" + imageEngine; 785 imageMedium += Dynamicweb.Rapido.Services.Images.GetImagePathFromSettings(settings.ImageMedium); 786 787 if (settings.Path.GetType() != typeof(string)) 788 { 789 imageMedium += settings.Path != null ? "Image=" + settings.Path.PathUrlEncoded : ""; 790 imageMedium += settings.Path != null ? "&" + settings.Path.GetFocalPointParameters() : ""; 791 } 792 else 793 { 794 imageMedium += settings.Path != null ? "Image=" + settings.Path : ""; 795 } 796 797 imageMedium += "&alternativeImage=" + alternativeImage; 798 799 imageMedium += "\""; 800 } 801 } 802 803 Dictionary<string, string> optionalAttributes = new Dictionary<string, string>(); 804 if (!string.IsNullOrEmpty(settings.OnClick)) { optionalAttributes.Add("onclick", settings.OnClick); } 805 if (!string.IsNullOrEmpty(settings.Title)) 806 { 807 optionalAttributes.Add("alt", settings.Title); 808 optionalAttributes.Add("title", settings.Title); 809 } 810 811 if (settings.DisableLazyLoad) 812 { 813 <img id="@settings.Id" class="@imageStyle @settings.CssClass dw-mod" src="@defaultImage" @ComponentMethods.AddAttributes(optionalAttributes) @ComponentMethods.AddAttributes(settings.ExtraAttributes) /> 814 } 815 else 816 { 817 <img id="@settings.Id" class="b-lazy @imageStyle @settings.CssClass dw-mod" src="@placeholderImage" data-src="@defaultImage" @imageSmall @imageMedium @ComponentMethods.AddAttributes(optionalAttributes) @ComponentMethods.AddAttributes(settings.ExtraAttributes) /> 818 } 819 } 820 } 821 @using System.Reflection 822 @using Dynamicweb.Rapido.Blocks.Components.General 823 @using Dynamicweb.Rapido.Blocks.Components 824 825 @* Component *@ 826 827 @helper RenderFileField(FileField settings) 828 { 829 var attributes = new Dictionary<string, string>(); 830 if (string.IsNullOrEmpty(settings.Id)) 831 { 832 settings.Id = Guid.NewGuid().ToString("N"); 833 } 834 835 if (!string.IsNullOrEmpty(settings.Id)) { attributes.Add("id", settings.Id); } 836 if (settings.Disabled) { attributes.Add("disabled", "true"); } 837 if (settings.Required) { attributes.Add("required", "true"); } 838 if (settings.Multiple) { attributes.Add("multiple", "true"); } 839 if (!string.IsNullOrEmpty(settings.Name)) { attributes.Add("name", settings.Name); } 840 if (string.IsNullOrEmpty(settings.ChooseFileText)) 841 { 842 settings.ChooseFileText = Translate("Choose file"); 843 } 844 if (string.IsNullOrEmpty(settings.NoFilesChosenText)) 845 { 846 settings.NoFilesChosenText = Translate("No files chosen..."); 847 } 848 if (!string.IsNullOrEmpty(settings.OnClick)) { attributes.Add("onclick", settings.OnClick); } 849 850 if (settings.Required && !String.IsNullOrEmpty(settings.Label)) { settings.Label += " <span class=\"required dw-mod\">*</span>"; } 851 852 string setValueToFakeInput = "FileUpload.setValueToFakeInput(this)"; 853 attributes.Add("onchange", setValueToFakeInput + (!string.IsNullOrEmpty(settings.OnChange) ? settings.OnChange : "")); 854 855 attributes.Add("type", "file"); 856 if (settings.Value != null) { attributes.Add("value", settings.Value); } 857 settings.CssClass = "u-full-width " + settings.CssClass; 858 859 var resultAttributes = attributes.Concat(settings.ExtraAttributes).GroupBy(d => d.Key).ToDictionary (d => d.Key, d => d.Last().Value); 860 861 <div class="form__field-group u-full-width @settings.WrapperCssClass dw-mod"> 862 @if (!string.IsNullOrEmpty(settings.Label) || settings.Link != null ) 863 { 864 <div class="u-full-width"> 865 @if (!string.IsNullOrEmpty(settings.Label)) { <label for="@settings.Id" class="u-pull--left">@settings.Label</label> } 866 @if (settings.Link != null) { 867 <div class="u-pull--right"> 868 @{ settings.Link.ButtonLayout = ButtonLayout.LinkClean; } 869 @Render(settings.Link) 870 </div> 871 } 872 </div> 873 874 } 875 876 @if (!string.IsNullOrEmpty(settings.HelpText)) 877 { 878 <small class="form__help-text">@settings.HelpText</small> 879 } 880 881 <div class="form__field-combi file-input u-no-margin dw-mod"> 882 <input @ComponentMethods.AddAttributes(resultAttributes) class="file-input__real-input" data-no-files-text="@settings.NoFilesChosenText" data-many-files-text="@Translate("files")" /> 883 <label for="@settings.Id" class="file-input__btn btn--secondary btn dw-mod">@settings.ChooseFileText</label> 884 <label for="@settings.Id" class="@settings.CssClass file-input__fake-input js-fake-input dw-mod">@settings.NoFilesChosenText</label> 885 @if (settings.UploadButton != null) 886 { 887 settings.UploadButton.CssClass += " btn--condensed u-no-margin"; 888 @Render(settings.UploadButton) 889 } 890 </div> 891 @Render(new NotificationMessage { Message = settings.ErrorMessage }) 892 </div> 893 } 894 @using System.Reflection 895 @using Dynamicweb.Rapido.Blocks.Components.General 896 @using Dynamicweb.Rapido.Blocks.Components 897 @using Dynamicweb.Core 898 @using System.Linq 899 900 @* Component *@ 901 902 @helper RenderDateTimeField(DateTimeField settings) 903 { 904 if (string.IsNullOrEmpty(settings.Id)) 905 { 906 settings.Id = Guid.NewGuid().ToString("N"); 907 } 908 909 var textField = new TextField { 910 Name = settings.Name, 911 Id = settings.Id, 912 Label = settings.Label, 913 HelpText = settings.HelpText, 914 Value = settings.Value, 915 Disabled = settings.Disabled, 916 Required = settings.Required, 917 ErrorMessage = settings.ErrorMessage, 918 CssClass = settings.CssClass, 919 WrapperCssClass = settings.WrapperCssClass, 920 OnChange = settings.OnChange, 921 OnClick = settings.OnClick, 922 Link = settings.Link, 923 ExtraAttributes = settings.ExtraAttributes, 924 // 925 Placeholder = settings.Placeholder 926 }; 927 928 @Render(textField) 929 930 List<string> jsAttributes = new List<string>(); 931 932 jsAttributes.Add("mode: '" + Enum.GetName(typeof(DateTimeFieldMode), settings.Mode).ToLower() + "'"); 933 934 if (!string.IsNullOrEmpty(settings.DateFormat)) 935 { 936 jsAttributes.Add("dateFormat: '" + settings.DateFormat + "'"); 937 } 938 if (!string.IsNullOrEmpty(settings.MinDate)) 939 { 940 jsAttributes.Add("minDate: '" + settings.MinDate + "'"); 941 } 942 if (!string.IsNullOrEmpty(settings.MaxDate)) 943 { 944 jsAttributes.Add("maxDate: '" + settings.MaxDate + "'"); 945 } 946 if (settings.IsInline) 947 { 948 jsAttributes.Add("inline: " + Converter.ToString(settings.IsInline).ToLower()); 949 } 950 if (settings.EnableTime) 951 { 952 jsAttributes.Add("enableTime: " + Converter.ToString(settings.EnableTime).ToLower()); 953 } 954 if (settings.EnableWeekNumbers) 955 { 956 jsAttributes.Add("weekNumbers: " + Converter.ToString(settings.EnableWeekNumbers).ToLower()); 957 } 958 959 jsAttributes.AddRange(settings.GetFlatPickrOptions().Select(x => x.Key + ": " + x.Value)); 960 961 <script> 962 document.addEventListener("DOMContentLoaded", function () { 963 flatpickr("#@textField.Id", { 964 @string.Join(",", jsAttributes) 965 }); 966 }); 967 </script> 968 } 969 @using System.Reflection 970 @using Dynamicweb.Rapido.Blocks.Components.General 971 @using Dynamicweb.Rapido.Blocks.Components 972 973 @* Component *@ 974 975 @helper RenderTextField(TextField settings) 976 { 977 var attributes = new Dictionary<string, string>(); 978 if (!string.IsNullOrEmpty(settings.Label) && string.IsNullOrEmpty(settings.Id)) 979 { 980 settings.Id = Guid.NewGuid().ToString("N"); 981 } 982 983 /*base settings*/ 984 if (!string.IsNullOrEmpty(settings.Id)) { attributes.Add("id", settings.Id); } 985 if (!string.IsNullOrEmpty(settings.OnClick)) { attributes.Add("onclick", settings.OnClick); } 986 if (!string.IsNullOrEmpty(settings.OnChange)) { attributes.Add("onchange", settings.OnChange); } 987 if (settings.Disabled) { attributes.Add("disabled", "true"); } 988 if (settings.Required) { attributes.Add("required", "true"); } 989 if (!string.IsNullOrEmpty(settings.Name)) { attributes.Add("name", settings.Name); } 990 /*end*/ 991 992 if (!string.IsNullOrEmpty(settings.OnKeyUp)) { attributes.Add("onkeyup", settings.OnKeyUp); } 993 if (!string.IsNullOrEmpty(settings.OnInput)) { attributes.Add("oninput", settings.OnInput); } 994 if (!string.IsNullOrEmpty(settings.OnFocus)) { attributes.Add("onfocus", settings.OnFocus); } 995 if (settings.ReadOnly) { attributes.Add("readonly", "true"); } 996 if (settings.MaxLength != 0) { attributes.Add("maxlength", settings.MaxLength.ToString()); } 997 if (!string.IsNullOrEmpty(settings.Placeholder)) { attributes.Add("placeholder", settings.Placeholder); } 998 attributes.Add("type", Enum.GetName(typeof(TextFieldType), settings.Type).ToLower()); 999 if (settings.Type == TextFieldType.Password) { attributes.Add("autocomplete", "off"); }; 1000 if (settings.Value != null) { attributes.Add("value", settings.Value); } 1001 1002 settings.CssClass = "u-full-width " + settings.CssClass; 1003 1004 if (settings.Required && !String.IsNullOrEmpty(settings.Label)) { settings.Label += " <span class=\"required dw-mod\">*</span>"; } 1005 1006 var resultAttributes = attributes.Concat(settings.ExtraAttributes).GroupBy(d => d.Key).ToDictionary (d => d.Key, d => d.Last().Value); 1007 1008 string noMargin = "u-no-margin"; 1009 if (!settings.ReadOnly) { 1010 noMargin = ""; 1011 } 1012 1013 <div class="form__field-group u-full-width @noMargin @settings.WrapperCssClass dw-mod"> 1014 @if (!string.IsNullOrEmpty(settings.Label) || settings.Link != null ) 1015 { 1016 <div class="u-full-width"> 1017 @if (!string.IsNullOrEmpty(settings.Label)) { <label for="@settings.Id" class="u-pull--left">@settings.Label</label> } 1018 @if (settings.Link != null) { 1019 settings.Link.ButtonLayout = ButtonLayout.LinkClean; 1020 1021 <div class="u-pull--right"> 1022 @Render(settings.Link) 1023 </div> 1024 } 1025 </div> 1026 1027 } 1028 1029 @if (!string.IsNullOrEmpty(settings.HelpText)) 1030 { 1031 <small class="form__help-text">@settings.HelpText</small> 1032 } 1033 1034 @if (settings.ActionButton != null) 1035 { 1036 settings.ActionButton.CssClass += " btn--condensed u-no-margin"; 1037 <div class="form__field-combi u-no-margin dw-mod"> 1038 <input @ComponentMethods.AddAttributes(resultAttributes) class="@settings.CssClass dw-mod" /> 1039 @Render(settings.ActionButton) 1040 </div> 1041 } 1042 else 1043 { 1044 <input @ComponentMethods.AddAttributes(resultAttributes) class="@settings.CssClass dw-mod" /> 1045 } 1046 1047 @Render(new NotificationMessage { Message = settings.ErrorMessage }) 1048 </div> 1049 } 1050 @using System.Reflection 1051 @using Dynamicweb.Rapido.Blocks.Components.General 1052 @using Dynamicweb.Rapido.Blocks.Components 1053 1054 @* Component *@ 1055 1056 @helper RenderNumberField(NumberField settings) 1057 { 1058 var attributes = new Dictionary<string, string>(); 1059 if (!string.IsNullOrEmpty(settings.Label) && string.IsNullOrEmpty(settings.Id)) 1060 { 1061 settings.Id = Guid.NewGuid().ToString("N"); 1062 } 1063 1064 /*base settings*/ 1065 if (!string.IsNullOrEmpty(settings.Id)) { attributes.Add("id", settings.Id); } 1066 if (!string.IsNullOrEmpty(settings.OnClick)) { attributes.Add("onclick", settings.OnClick); } 1067 if (!string.IsNullOrEmpty(settings.OnChange)) { attributes.Add("onchange", settings.OnChange); } 1068 if (settings.Disabled) { attributes.Add("disabled", "true"); } 1069 if (settings.Required) { attributes.Add("required", "true"); } 1070 if (!string.IsNullOrEmpty(settings.Name)) { attributes.Add("name", settings.Name); } 1071 /*end*/ 1072 1073 if (!string.IsNullOrEmpty(settings.OnKeyUp)) { attributes.Add("onkeyup", settings.OnKeyUp); } 1074 if (!string.IsNullOrEmpty(settings.OnInput)) { attributes.Add("oninput", settings.OnInput); } 1075 if (!string.IsNullOrEmpty(settings.OnFocus)) { attributes.Add("onfocus", settings.OnFocus); } 1076 if (settings.ReadOnly) { attributes.Add("readonly", "true"); } 1077 if (settings.Max != null) { attributes.Add("max", settings.Max.ToString()); } 1078 if (settings.Min != null) { attributes.Add("min", settings.Min.ToString()); } 1079 if (settings.Step != 0) { attributes.Add("step", settings.Step.ToString()); } 1080 if (settings.Value != null && !string.IsNullOrEmpty(settings.Value.ToString())) { attributes.Add("value", settings.Value.ToString()); } 1081 attributes.Add("type", "number"); 1082 1083 var resultAttributes = attributes.Concat(settings.ExtraAttributes).GroupBy(d => d.Key).ToDictionary (d => d.Key, d => d.Last().Value); 1084 1085 <div class="form__field-group u-full-width @settings.WrapperCssClass dw-mod"> 1086 @if (!string.IsNullOrEmpty(settings.Label) || settings.Link != null ) 1087 { 1088 <div class="u-full-width"> 1089 @if (!string.IsNullOrEmpty(settings.Label)) { <label for="@settings.Id" class="u-pull--left">@settings.Label</label> } 1090 @if (settings.Link != null) { 1091 <div class="u-pull--right"> 1092 @{ settings.Link.ButtonLayout = ButtonLayout.LinkClean; } 1093 @Render(settings.Link) 1094 </div> 1095 } 1096 </div> 1097 1098 } 1099 1100 @if (!string.IsNullOrEmpty(settings.HelpText)) 1101 { 1102 <small class="form__help-text">@settings.HelpText</small> 1103 } 1104 1105 @if (settings.ActionButton != null) 1106 { 1107 settings.ActionButton.CssClass += " btn--condensed u-no-margin"; 1108 <div class="form__field-combi u-no-margin dw-mod"> 1109 <input @ComponentMethods.AddAttributes(resultAttributes) class="@settings.CssClass dw-mod" /> 1110 @Render(settings.ActionButton) 1111 </div> 1112 } 1113 else 1114 { 1115 <div class="form__field-combi u-no-margin dw-mod"> 1116 <input @ComponentMethods.AddAttributes(resultAttributes) class="@settings.CssClass dw-mod" /> 1117 </div> 1118 } 1119 1120 @Render(new NotificationMessage { Message = settings.ErrorMessage }) 1121 </div> 1122 } 1123 @using System.Reflection 1124 @using Dynamicweb.Rapido.Blocks.Components.General 1125 @using Dynamicweb.Rapido.Blocks.Components 1126 1127 1128 @* Component *@ 1129 1130 @helper RenderTextareaField(TextareaField settings) 1131 { 1132 Dictionary<string, string> attributes = new Dictionary<string, string>(); 1133 string id = settings.Id; 1134 if (!string.IsNullOrEmpty(settings.Label) && string.IsNullOrEmpty(id)) 1135 { 1136 id = Guid.NewGuid().ToString("N"); 1137 } 1138 1139 if (!string.IsNullOrEmpty(id)) { attributes.Add("id", id); } 1140 if (!string.IsNullOrEmpty(settings.OnClick)) { attributes.Add("onclick", settings.OnClick); } 1141 if (!string.IsNullOrEmpty(settings.OnKeyUp)) { attributes.Add("onkeyup", settings.OnKeyUp); } 1142 if (!string.IsNullOrEmpty(settings.OnInput)) { attributes.Add("oninput", settings.OnInput); } 1143 if (!string.IsNullOrEmpty(settings.OnFocus)) { attributes.Add("onfocus", settings.OnFocus); } 1144 if (!string.IsNullOrEmpty(settings.OnChange)) { attributes.Add("onchange", settings.OnChange); } 1145 if (!string.IsNullOrEmpty(settings.Placeholder)) { attributes.Add("placeholder", settings.Placeholder); } 1146 if (settings.Disabled) { attributes.Add("disabled", "true"); } 1147 if (settings.Required) { attributes.Add("required", "true"); } 1148 if (settings.ReadOnly) { attributes.Add("readonly", "true"); } 1149 if (settings.MaxLength != 0) { attributes.Add("maxlength", settings.MaxLength.ToString()); } 1150 if (settings.Rows != 0) { attributes.Add("rows", settings.Rows.ToString()); } 1151 attributes.Add("name", settings.Name); 1152 1153 if (settings.Required && !String.IsNullOrEmpty(settings.Label)) { settings.Label += " <span class=\"required dw-mod\">*</span>"; } 1154 1155 <div class="form__field-group @settings.WrapperCssClass dw-mod"> 1156 @if (!string.IsNullOrEmpty(settings.Label) || settings.Link != null ) 1157 { 1158 <div class="u-full-width"> 1159 @if (!string.IsNullOrEmpty(settings.Label)) { <label for="@settings.Id" class="u-pull--left">@settings.Label</label> } 1160 @if (settings.Link != null) { 1161 <div class="u-pull--right"> 1162 @{ settings.Link.ButtonLayout = ButtonLayout.LinkClean; } 1163 @Render(settings.Link) 1164 </div> 1165 } 1166 </div> 1167 } 1168 1169 @if (!string.IsNullOrEmpty(settings.HelpText)) 1170 { 1171 <small class="form__help-text">@settings.HelpText</small> 1172 } 1173 1174 <textarea class="u-full-width @settings.CssClass dw-mod" @ComponentMethods.AddAttributes(attributes) @ComponentMethods.AddAttributes(settings.ExtraAttributes)>@settings.Value</textarea> 1175 1176 @Render(new NotificationMessage { Message = settings.ErrorMessage }) 1177 </div> 1178 } 1179 @using System.Reflection 1180 @using Dynamicweb.Rapido.Blocks.Components.General 1181 @using Dynamicweb.Rapido.Blocks.Components 1182 1183 1184 @* Component *@ 1185 1186 @helper RenderHiddenField(HiddenField settings) { 1187 var attributes = new Dictionary<string, string>(); 1188 attributes.Add("type", "hidden"); 1189 if (!string.IsNullOrEmpty(settings.Id)) { attributes.Add("id", settings.Id); } 1190 if (settings.Value != null) { attributes.Add("value", settings.Value); } 1191 if (!string.IsNullOrEmpty(settings.Name)) { attributes.Add("name", settings.Name); } 1192 1193 <input @ComponentMethods.AddAttributes(attributes) @ComponentMethods.AddAttributes(settings.ExtraAttributes)/> 1194 } 1195 @using System.Reflection 1196 @using Dynamicweb.Rapido.Blocks.Components.General 1197 @using Dynamicweb.Rapido.Blocks.Components 1198 1199 @* Component *@ 1200 1201 @helper RenderCheckboxField(CheckboxField settings) 1202 { 1203 var attributes = new Dictionary<string, string>(); 1204 if (!string.IsNullOrEmpty(settings.Label) && string.IsNullOrEmpty(settings.Id)) 1205 { 1206 settings.Id = Guid.NewGuid().ToString("N"); 1207 } 1208 1209 /*base settings*/ 1210 if (!string.IsNullOrEmpty(settings.Id)) { attributes.Add("id", settings.Id); } 1211 if (!string.IsNullOrEmpty(settings.OnClick)) { attributes.Add("onclick", settings.OnClick); } 1212 if (!string.IsNullOrEmpty(settings.OnChange)) { attributes.Add("onchange", settings.OnChange); } 1213 if (settings.Disabled) { attributes.Add("disabled", "true"); } 1214 if (settings.Required) { attributes.Add("required", "true"); } 1215 if (!string.IsNullOrEmpty(settings.Name)) { attributes.Add("name", settings.Name); } 1216 /*end*/ 1217 1218 if (settings.Required && !String.IsNullOrEmpty(settings.Label)) { settings.Label += " <span class=\"required dw-mod\">*</span>"; } 1219 1220 attributes.Add("type", "checkbox"); 1221 if (settings.Checked) { attributes.Add("checked", "true"); } 1222 settings.CssClass = "form__control " + settings.CssClass; 1223 if (settings.Value != null) { attributes.Add("value", settings.Value); } 1224 1225 var resultAttributes = attributes.Concat(settings.ExtraAttributes).GroupBy(d => d.Key).ToDictionary (d => d.Key, d => d.Last().Value); 1226 1227 <div class="form__field-group @settings.WrapperCssClass dw-mod"> 1228 <input @ComponentMethods.AddAttributes(resultAttributes) class="@settings.CssClass dw-mod" /> 1229 @if (!string.IsNullOrEmpty(settings.Label)) 1230 { 1231 <label for="@settings.Id" class="dw-mod">@settings.Label</label> 1232 } 1233 1234 @if (settings.Link != null) { 1235 <span> 1236 @{ settings.Link.ButtonLayout = ButtonLayout.LinkClean; } 1237 @Render(settings.Link) 1238 </span> 1239 } 1240 1241 @if (!string.IsNullOrEmpty(settings.HelpText)) 1242 { 1243 <small class="form__help-text checkbox-help dw-mod">@settings.HelpText</small> 1244 } 1245 @Render(new NotificationMessage { Message = settings.ErrorMessage }) 1246 </div> 1247 } 1248 @using System.Reflection 1249 @using Dynamicweb.Rapido.Blocks.Components.General 1250 @using Dynamicweb.Rapido.Blocks.Components 1251 1252 1253 @* Component *@ 1254 1255 @helper RenderCheckboxListField(CheckboxListField settings) 1256 { 1257 <div class="form__field-group @settings.WrapperCssClass u-margin-bottom dw-mod" @ComponentMethods.AddAttributes(settings.ExtraAttributes)> 1258 @if (!string.IsNullOrEmpty(settings.Label) || settings.Link != null ) 1259 { 1260 <div class="u-full-width"> 1261 @if (!string.IsNullOrEmpty(settings.Label)) { <label for="@settings.Id" class="u-pull--left">@settings.Label</label> } 1262 @if (settings.Link != null) { 1263 <div class="u-pull--right"> 1264 @{ settings.Link.ButtonLayout = ButtonLayout.LinkClean; } 1265 @Render(settings.Link) 1266 </div> 1267 } 1268 </div> 1269 1270 } 1271 1272 <div class="u-pull--left"> 1273 @if (!string.IsNullOrEmpty(settings.HelpText)) 1274 { 1275 <small class="form__help-text">@settings.HelpText</small> 1276 } 1277 1278 @foreach (var item in settings.Options) 1279 { 1280 if (settings.Required) 1281 { 1282 item.Required = true; 1283 } 1284 if (settings.Disabled) 1285 { 1286 item.Disabled = true; 1287 } 1288 if (!string.IsNullOrEmpty(settings.Name)) 1289 { 1290 item.Name = settings.Name; 1291 } 1292 if (!string.IsNullOrEmpty(settings.CssClass)) 1293 { 1294 item.CssClass += settings.CssClass; 1295 } 1296 1297 /* value is not supported */ 1298 1299 if (!string.IsNullOrEmpty(settings.OnClick)) 1300 { 1301 item.OnClick += settings.OnClick; 1302 } 1303 if (!string.IsNullOrEmpty(settings.OnChange)) 1304 { 1305 item.OnChange += settings.OnChange; 1306 } 1307 @Render(item) 1308 } 1309 1310 @Render(new NotificationMessage { Message = settings.ErrorMessage }) 1311 </div> 1312 1313 </div> 1314 } 1315 @using Dynamicweb.Rapido.Blocks.Components.General 1316 1317 @* Component *@ 1318 1319 @helper RenderSearch(Search settings) 1320 { 1321 var searchValue = HttpContext.Current.Request.QueryString.Get(settings.SearchParameter) ?? ""; 1322 var groupValue = HttpContext.Current.Request.QueryString.Get(settings.GroupsParameter) ?? ""; 1323 1324 if (string.IsNullOrEmpty(settings.Id)) 1325 { 1326 settings.Id = Guid.NewGuid().ToString("N"); 1327 } 1328 1329 var resultAttributes = new Dictionary<string, string>(); 1330 1331 if (settings.PageSize != 0) 1332 { 1333 resultAttributes.Add("data-page-size", settings.PageSize.ToString()); 1334 } 1335 if (!string.IsNullOrEmpty(settings.GroupItemsFeedUrl)) 1336 { 1337 resultAttributes.Add("data-groups-feed-url", settings.GroupItemsFeedUrl); 1338 if (!string.IsNullOrEmpty(groupValue)) 1339 { 1340 resultAttributes.Add("data-selected-group", groupValue); 1341 } 1342 if (!string.IsNullOrEmpty(settings.GroupsParameter)) 1343 { 1344 resultAttributes.Add("data-groups-parameter", settings.GroupsParameter); 1345 } 1346 } 1347 resultAttributes.Add("data-force-init", "true"); 1348 if (settings.GoToFirstSearchResultOnEnter) 1349 { 1350 resultAttributes.Add("data-go-to-first-search-result-on-enter", settings.GoToFirstSearchResultOnEnter.ToString().ToLower()); 1351 } 1352 if (!string.IsNullOrEmpty(settings.SearchParameter)) 1353 { 1354 resultAttributes.Add("data-search-parameter", settings.SearchParameter); 1355 } 1356 resultAttributes.Add("data-search-feed-url", settings.SearchData.SearchFeedUrl); 1357 resultAttributes.Add("data-results-template-id", settings.SearchData.ResultsTemplateId); 1358 1359 if (settings.SecondSearchData != null) 1360 { 1361 resultAttributes.Add("data-second-search-feed-url", settings.SecondSearchData.SearchFeedUrl); 1362 resultAttributes.Add("data-second-results-template-id", settings.SecondSearchData.ResultsTemplateId); 1363 } 1364 if (!string.IsNullOrEmpty(settings.ResultsPageUrl)) 1365 { 1366 resultAttributes.Add("data-results-page-url", settings.ResultsPageUrl); 1367 } 1368 1369 resultAttributes = resultAttributes.Concat(settings.ExtraAttributes).GroupBy(d => d.Key).ToDictionary (d => d.Key, d => d.Last().Value); 1370 1371 string searchFieldCss = (settings.SearchButton == null) ? "search--with-icon" : ""; 1372 1373 <div class="search @settings.CssClass @searchFieldCss js-search-data-source dw-mod" id="@settings.Id" @ComponentMethods.AddAttributes(resultAttributes)> 1374 @if (!string.IsNullOrEmpty(settings.GroupItemsFeedUrl)) 1375 { 1376 <button type="button" class="search__groups-btn dw-mod js-search-groups-btn">@Translate("All")</button> 1377 <ul class="dropdown dropdown--absolute-position dw-mod search__groups-results js-search-groups-list"></ul> 1378 } 1379 1380 <input type="text" class="search__field dw-mod js-search-field" placeholder="@settings.Placeholder" value="@searchValue"> 1381 1382 <div class="dropdown dropdown--absolute-position search__results dw-mod js-search-results @(settings.SecondSearchData != null ? "search__results--combined" : "")"> 1383 @if (settings.SecondSearchData != null) 1384 { 1385 <div class="search__column search__column--products dw-mod"> 1386 <div class="search__column-header dw-mod">@Translate("Products")</div> 1387 <ul class="search__results-list dw-mod js-search-results-list" id="@(settings.Id)_ResultsList"></ul> 1388 @if (!string.IsNullOrEmpty(settings.SearchData.ResultsPageUrl)) 1389 { 1390 @Render(new Link { 1391 Title = Translate("View all"), 1392 CssClass = "js-view-all-button u-margin", 1393 Href = settings.SearchData.ResultsPageUrl 1394 }); 1395 } 1396 </div> 1397 <div class="search__column search__column--pages dw-mod"> 1398 <div class="search__column-header">@Translate("Pages")</div> 1399 <ul class="search__results-list dw-mod js-search-results-second-list" id="@(settings.Id)_SecondResultsList"></ul> 1400 @if (!string.IsNullOrEmpty(settings.SecondSearchData.ResultsPageUrl)) 1401 { 1402 @Render(new Link 1403 { 1404 Title = Translate("View all"), 1405 CssClass = "js-view-all-button u-margin", 1406 Href = settings.SecondSearchData.ResultsPageUrl 1407 }); 1408 } 1409 </div> 1410 } 1411 else 1412 { 1413 <div class="search__column search__column--only dw-mod"> 1414 <ul class="search__results-list dw-mod js-search-results-list" id="@(settings.Id)_ResultsList"></ul> 1415 @if (!string.IsNullOrEmpty(settings.SearchData.ResultsPageUrl)) 1416 { 1417 @Render(new Link { 1418 Title = Translate("View all"), 1419 CssClass = "js-view-all-button u-margin", 1420 Href = settings.SearchData.ResultsPageUrl 1421 }); 1422 } 1423 </div> 1424 } 1425 </div> 1426 1427 @if (settings.SearchButton != null) 1428 { 1429 settings.SearchButton.CssClass += " search__btn js-search-btn"; 1430 if (settings.RenderDefaultSearchIcon) 1431 { 1432 settings.SearchButton.Icon = new Icon { Name = Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SearchIcon").SelectedValue }; 1433 } 1434 @Render(settings.SearchButton); 1435 } 1436 </div> 1437 } 1438 @using System.Reflection 1439 @using Dynamicweb.Rapido.Blocks.Components.General 1440 @using Dynamicweb.Rapido.Blocks.Components 1441 1442 1443 @* Component *@ 1444 1445 @helper RenderSelectField(SelectField settings) 1446 { 1447 if (!string.IsNullOrEmpty(settings.Label) && string.IsNullOrEmpty(settings.Id)) 1448 { 1449 settings.Id = Guid.NewGuid().ToString("N"); 1450 } 1451 1452 <div class="form__field-group u-full-width @settings.WrapperCssClass dw-mod"> 1453 @if (!string.IsNullOrEmpty(settings.Label) || settings.Link != null ) 1454 { 1455 <div class="u-full-width"> 1456 @if (!string.IsNullOrEmpty(settings.Label)) { <label for="@settings.Id" class="u-pull--left">@settings.Label</label> } 1457 @if (settings.Link != null) { 1458 <div class="u-pull--right"> 1459 @{ settings.Link.ButtonLayout = ButtonLayout.LinkClean; } 1460 @Render(settings.Link) 1461 </div> 1462 } 1463 </div> 1464 } 1465 1466 @if (!string.IsNullOrEmpty(settings.HelpText)) 1467 { 1468 <small class="form__help-text">@settings.HelpText</small> 1469 } 1470 1471 @if (settings.ActionButton != null) 1472 { 1473 settings.ActionButton.CssClass += " btn--condensed u-no-margin"; 1474 <div class="form__field-combi u-no-margin dw-mod"> 1475 @RenderSelectBase(settings) 1476 @Render(settings.ActionButton) 1477 </div> 1478 } 1479 else 1480 { 1481 @RenderSelectBase(settings) 1482 } 1483 1484 @Render(new NotificationMessage { Message = settings.ErrorMessage }) 1485 </div> 1486 } 1487 1488 @helper RenderSelectBase(SelectField settings) 1489 { 1490 var attributes = new Dictionary<string, string>(); 1491 1492 /*base settings*/ 1493 if (!string.IsNullOrEmpty(settings.Id)) { attributes.Add("id", settings.Id); } 1494 if (!string.IsNullOrEmpty(settings.OnClick)) { attributes.Add("onclick", settings.OnClick); } 1495 if (!string.IsNullOrEmpty(settings.OnChange)) { attributes.Add("onchange", settings.OnChange); } 1496 if (settings.Disabled) { attributes.Add("disabled", "true"); } 1497 if (settings.Required) { attributes.Add("required", "true"); } 1498 if (!string.IsNullOrEmpty(settings.Name)) { attributes.Add("name", settings.Name); } 1499 /*end*/ 1500 1501 var resultAttributes = attributes.Concat(settings.ExtraAttributes).GroupBy(d => d.Key).ToDictionary (d => d.Key, d => d.Last().Value); 1502 1503 <select @ComponentMethods.AddAttributes(resultAttributes) class="u-full-width @settings.CssClass dw-mod"> 1504 @if (settings.Default != null) 1505 { 1506 @Render(settings.Default) 1507 } 1508 1509 @foreach (var item in settings.Options) 1510 { 1511 if (settings.Value != null) { 1512 item.Checked = item.Value == settings.Value; 1513 } 1514 @Render(item) 1515 } 1516 </select> 1517 } 1518 @using System.Reflection 1519 @using Dynamicweb.Rapido.Blocks.Components.General 1520 @using Dynamicweb.Rapido.Blocks.Components 1521 1522 @* Component *@ 1523 1524 @helper RenderRadioButtonField(RadioButtonField settings) 1525 { 1526 var attributes = new Dictionary<string, string>(); 1527 if (!string.IsNullOrEmpty(settings.Label) && string.IsNullOrEmpty(settings.Id)) 1528 { 1529 settings.Id = Guid.NewGuid().ToString("N"); 1530 } 1531 1532 /*base settings*/ 1533 if (!string.IsNullOrEmpty(settings.Id)) { attributes.Add("id", settings.Id); } 1534 if (!string.IsNullOrEmpty(settings.OnClick)) { attributes.Add("onclick", settings.OnClick); } 1535 if (!string.IsNullOrEmpty(settings.OnChange)) { attributes.Add("onchange", settings.OnChange); } 1536 if (settings.Disabled) { attributes.Add("disabled", "true"); } 1537 if (settings.Required) { attributes.Add("required", "true"); } 1538 if (!string.IsNullOrEmpty(settings.Name)) { attributes.Add("name", settings.Name); } 1539 /*end*/ 1540 1541 attributes.Add("type", "radio"); 1542 if (settings.Checked) { attributes.Add("checked", "true"); } 1543 settings.CssClass = "form__control " + settings.CssClass; 1544 if (settings.Value != null) { attributes.Add("value", settings.Value); } 1545 1546 var resultAttributes = attributes.Concat(settings.ExtraAttributes).GroupBy(d => d.Key).ToDictionary (d => d.Key, d => d.Last().Value); 1547 1548 <div class="form__field-group @settings.WrapperCssClass dw-mod"> 1549 <input @ComponentMethods.AddAttributes(resultAttributes) class="@settings.CssClass dw-mod" /> 1550 @if (!string.IsNullOrEmpty(settings.Label)) 1551 { 1552 <label for="@settings.Id" class="dw-mod">@settings.Label</label> 1553 } 1554 @if (!string.IsNullOrEmpty(settings.HelpText)) 1555 { 1556 <small class="form__help-text">@settings.HelpText</small> 1557 } 1558 @Render(new NotificationMessage { Message = settings.ErrorMessage }) 1559 </div> 1560 } 1561 @using System.Reflection 1562 @using Dynamicweb.Rapido.Blocks.Components.General 1563 @using Dynamicweb.Rapido.Blocks.Components 1564 1565 1566 @* Component *@ 1567 1568 @helper RenderRadioButtonListField(RadioButtonListField settings) 1569 { 1570 if (settings.Required && !String.IsNullOrEmpty(settings.Label)) { settings.Label += " <span class=\"required dw-mod\">*</span>"; } 1571 1572 <div class="form__field-group @settings.WrapperCssClass u-margin-bottom dw-mod" @ComponentMethods.AddAttributes(settings.ExtraAttributes)> 1573 @if (!string.IsNullOrEmpty(settings.Label)) 1574 { 1575 <label>@settings.Label</label> 1576 } 1577 @if (!string.IsNullOrEmpty(settings.HelpText)) 1578 { 1579 <small class="form__help-text">@settings.HelpText</small> 1580 } 1581 1582 @foreach (var item in settings.Options) 1583 { 1584 if (settings.Required) 1585 { 1586 item.Required = true; 1587 } 1588 if (settings.Disabled) 1589 { 1590 item.Disabled = true; 1591 } 1592 if (!string.IsNullOrEmpty(settings.Name)) 1593 { 1594 item.Name = settings.Name; 1595 } 1596 if (settings.Value != null && settings.Value == item.Value) 1597 { 1598 item.Checked = true; 1599 } 1600 if (!string.IsNullOrEmpty(settings.OnClick)) 1601 { 1602 item.OnClick += settings.OnClick; 1603 } 1604 if (!string.IsNullOrEmpty(settings.OnChange)) 1605 { 1606 item.OnChange += settings.OnChange; 1607 } 1608 if (!string.IsNullOrEmpty(settings.CssClass)) 1609 { 1610 item.CssClass += settings.CssClass; 1611 } 1612 @Render(item) 1613 } 1614 1615 @Render(new NotificationMessage { Message = settings.ErrorMessage }) 1616 </div> 1617 } 1618 @using System.Reflection 1619 @using Dynamicweb.Rapido.Blocks.Components.General 1620 @using Dynamicweb.Rapido.Blocks.Components 1621 1622 1623 @* Component *@ 1624 1625 @helper RenderNotificationMessage(NotificationMessage settings) 1626 { 1627 if (!string.IsNullOrEmpty(settings.Message)) 1628 { 1629 var attributes = new Dictionary<string, string>(); 1630 if (!string.IsNullOrEmpty(settings.Id)) { attributes.Add("id", settings.Id); } 1631 1632 string messageTypeClass = Enum.GetName(typeof(NotificationMessageType), settings.MessageType).ToLower(); 1633 string messageLayoutClass = Enum.GetName(typeof(NotificationMessageLayout), settings.MessageLayout).ToLower(); 1634 string minHeightClass = settings.Icon != null ? "u-min-h70px" : ""; 1635 1636 <div class="notification-message-@messageTypeClass notification-message-@messageLayoutClass @messageLayoutClass @minHeightClass @settings.CssClass u-full-width dw-mod" @ComponentMethods.AddAttributes(attributes)> 1637 @if (settings.Icon != null) { 1638 settings.Icon.Label = !string.IsNullOrEmpty(settings.Icon.Label) ? settings.Message + settings.Icon.Label : settings.Message; 1639 @Render(settings.Icon) 1640 } else { 1641 @settings.Message 1642 } 1643 </div> 1644 } 1645 } 1646 @using Dynamicweb.Rapido.Blocks.Components.General 1647 1648 1649 @* Component *@ 1650 1651 @helper RenderHandlebarsRoot(HandlebarsRoot settings) { 1652 string preRender = !String.IsNullOrEmpty(settings.PreRenderScriptTemplate) ? "data-pre-render-template=\"" + settings.PreRenderScriptTemplate + "\"" : ""; 1653 1654 <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> 1655 @if (settings.SubBlocks != null) { 1656 @RenderBlockList(settings.SubBlocks) 1657 } 1658 </div> 1659 } 1660 @using System.Reflection 1661 @using Dynamicweb.Rapido.Blocks.Components.General 1662 @using Dynamicweb.Rapido.Blocks.Components 1663 @using System.Text.RegularExpressions 1664 1665 1666 @* Component *@ 1667 1668 @helper RenderSticker(Sticker settings) { 1669 if (!String.IsNullOrEmpty(settings.Title)) { 1670 string size = settings.Size.ToString() != "None" ? "" + "stickers-container__tag--" + settings.Size.ToString().ToLower() : ""; 1671 string style = settings.Style.ToString() != "None" ? "" + "stickers-container__tag--" + settings.Style.ToString().ToLower() : ""; 1672 1673 Dictionary<String, String> optionalAttributes = new Dictionary<string, string>(); 1674 if (!String.IsNullOrEmpty(settings.Color) || !String.IsNullOrEmpty(settings.BackgroundColor)) { 1675 string styleTag = !String.IsNullOrEmpty(settings.Color) ? "color: " + settings.Color + "; " : ""; 1676 styleTag += !String.IsNullOrEmpty(settings.BackgroundColor) ? "background-color: " + settings.BackgroundColor + "; " : ""; 1677 optionalAttributes.Add("style", styleTag); 1678 } 1679 1680 <div class="stickers-container__tag @size @style @settings.CssClass dw-mod" @ComponentMethods.AddAttributes(optionalAttributes) @ComponentMethods.AddAttributes(settings.ExtraAttributes)>@settings.Title</div> 1681 } 1682 } 1683 1684 @using System.Reflection 1685 @using Dynamicweb.Rapido.Blocks.Components.General 1686 @using Dynamicweb.Rapido.Blocks.Components 1687 1688 1689 @* Component *@ 1690 1691 @helper RenderStickersCollection(StickersCollection settings) 1692 { 1693 if (settings.Stickers.Count > 0) 1694 { 1695 string position = "stickers-container--" + Regex.Replace(settings.Position.ToString(), "([a-z])([A-Z])", "$1-$2").ToLower(); 1696 1697 <div class="stickers-container @position @settings.CssClass dw-mod" @ComponentMethods.AddAttributes(settings.ExtraAttributes)> 1698 @foreach (Sticker sticker in settings.Stickers) 1699 { 1700 @Render(sticker) 1701 } 1702 </div> 1703 } 1704 } 1705 1706 @using Dynamicweb.Rapido.Blocks.Components.General 1707 1708 1709 @* Component *@ 1710 1711 @helper RenderForm(Form settings) { 1712 if (settings != null) 1713 { 1714 Dictionary<string, string> optionalAttributes = new Dictionary<string, string>(); 1715 if (!string.IsNullOrEmpty(settings.Action)) { optionalAttributes.Add("action", settings.Action); }; 1716 if (!string.IsNullOrEmpty(settings.Name)) { optionalAttributes.Add("name", settings.Name); }; 1717 if (!string.IsNullOrEmpty(settings.OnSubmit)) { optionalAttributes.Add("onsubmit", settings.OnSubmit); }; 1718 var enctypes = new Dictionary<string, string> 1719 { 1720 { "multipart", "multipart/form-data" }, 1721 { "text", "text/plain" }, 1722 { "application", "application/x-www-form-urlencoded" } 1723 }; 1724 if (settings.Enctype != FormEnctype.none) { optionalAttributes.Add("enctype", enctypes[Enum.GetName(typeof(FormEnctype), settings.Enctype).ToLower()]); }; 1725 optionalAttributes.Add("method", settings.Method.ToString()); 1726 1727 if (!string.IsNullOrEmpty(settings.FormStartMarkup)) 1728 { 1729 @settings.FormStartMarkup 1730 } 1731 else 1732 { 1733 @:<form class="@settings.CssClass u-no-margin dw-mod" @ComponentMethods.AddAttributes(optionalAttributes) @ComponentMethods.AddAttributes(settings.ExtraAttributes)> 1734 } 1735 1736 foreach (var field in settings.GetFields()) 1737 { 1738 @Render(field) 1739 } 1740 1741 @:</form> 1742 } 1743 } 1744 @using System.Reflection 1745 @using Dynamicweb.Rapido.Blocks.Components.General 1746 @using Dynamicweb.Rapido.Blocks.Components 1747 1748 1749 @* Component *@ 1750 1751 @helper RenderText(Text settings) 1752 { 1753 @settings.Content 1754 } 1755 @using System.Reflection 1756 @using Dynamicweb.Rapido.Blocks.Components.General 1757 @using Dynamicweb.Rapido.Blocks.Components 1758 1759 1760 @* Component *@ 1761 1762 @helper RenderContentModule(ContentModule settings) { 1763 if (!string.IsNullOrEmpty(settings.Content)) 1764 { 1765 @settings.Content 1766 } 1767 } 1768 @using System.Reflection 1769 @using Dynamicweb.Rapido.Blocks.Components.General 1770 @using Dynamicweb.Rapido.Blocks.Components 1771 1772 1773 @* Component *@ 1774 1775 @helper RenderModal(Modal settings) { 1776 if (settings != null) 1777 { 1778 string modalId = !string.IsNullOrEmpty(settings.Id) ? settings.Id : Guid.NewGuid().ToString("N"); 1779 1780 string onchange = !string.IsNullOrEmpty(settings.OnClose) ? "onchange=\"if(!this.checked){" + settings.OnClose + "}\"" : ""; 1781 1782 <input type="checkbox" id="@(modalId)ModalTrigger" class="modal-trigger" @onchange /> 1783 1784 <div class="modal-container"> 1785 @if (!settings.DisableDarkOverlay) 1786 { 1787 <label for="@(modalId)ModalTrigger" id="@(modalId)ModalOverlay" class="modal-overlay"></label> 1788 } 1789 <div class="modal [email protected]().ToLower() [email protected]().ToLower()" id="@(modalId)Modal"> 1790 @if (settings.Heading != null) 1791 { 1792 if (!string.IsNullOrEmpty(settings.Heading.Title)) 1793 { 1794 <div class="modal__header"> 1795 @Render(settings.Heading) 1796 </div> 1797 } 1798 } 1799 <div class="modal__body @(settings.Width.ToString().ToLower() == "full" ? "modal__body--full" : "")"> 1800 @if (!string.IsNullOrEmpty(settings.BodyText)) 1801 { 1802 @settings.BodyText 1803 } 1804 @if (settings.BodyTemplate != null) 1805 { 1806 @settings.BodyTemplate 1807 } 1808 @{ 1809 var actions = settings.GetActions(); 1810 } 1811 </div> 1812 @if (actions.Length > 0) 1813 { 1814 <div class="modal__footer"> 1815 @foreach (var action in actions) 1816 { 1817 if (Pageview.Device.ToString() != "Mobile") { 1818 action.CssClass += " u-no-margin"; 1819 } else { 1820 action.CssClass += " u-full-width u-margin-bottom"; 1821 } 1822 1823 @Render(action) 1824 } 1825 </div> 1826 } 1827 <label class="modal__close-btn" for="@(modalId)ModalTrigger"></label> 1828 </div> 1829 </div> 1830 } 1831 } 1832 @using Dynamicweb.Rapido.Blocks.Components.General 1833 1834 @* Component *@ 1835 1836 @helper RenderMediaListItem(MediaListItem settings) 1837 { 1838 <div class="media-list-item @settings.CssClass dw-mod" @(!string.IsNullOrEmpty(settings.Id) ? "id=\"" + settings.Id + "\"" : "")> 1839 @if (!string.IsNullOrEmpty(settings.Label)) 1840 { 1841 if (!string.IsNullOrEmpty(settings.Link)) 1842 { 1843 @Render(new Link 1844 { 1845 Href = settings.Link, 1846 CssClass = "media-list-item__sticker dw-mod", 1847 ButtonLayout = ButtonLayout.None, 1848 Title = settings.Label, 1849 OnClick = !string.IsNullOrEmpty(settings.OnClick) ? settings.OnClick : "" 1850 }) 1851 } 1852 else if (!string.IsNullOrEmpty(settings.OnClick)) 1853 { 1854 <span class="media-list-item__sticker dw-mod" onclick="@(settings.OnClick)"> 1855 <span class="u-uppercase">@settings.Label</span> 1856 </span> 1857 } 1858 else 1859 { 1860 <span class="media-list-item__sticker media-list-item__sticker--no-link dw-mod"> 1861 <span class="u-uppercase">@settings.Label</span> 1862 </span> 1863 } 1864 } 1865 <div class="media-list-item__wrap"> 1866 <div class="media-list-item__info dw-mod"> 1867 <div class="media-list-item__header dw-mod"> 1868 @if (!string.IsNullOrEmpty(settings.Title)) 1869 { 1870 if (!string.IsNullOrEmpty(settings.Link)) 1871 { 1872 @Render(new Link 1873 { 1874 Href = settings.Link, 1875 CssClass = "media-list-item__name dw-mod", 1876 ButtonLayout = ButtonLayout.None, 1877 Title = settings.Title, 1878 OnClick = !string.IsNullOrEmpty(settings.OnClick) ? settings.OnClick : "" 1879 }) 1880 } 1881 else if (!string.IsNullOrEmpty(settings.OnClick)) 1882 { 1883 <span class="media-list-item__name dw-mod" onclick="@(settings.OnClick)">@settings.Title</span> 1884 } 1885 else 1886 { 1887 <span class="media-list-item__name media-list-item__name--no-link dw-mod">@settings.Title</span> 1888 } 1889 } 1890 1891 @if (!string.IsNullOrEmpty(settings.Status)) 1892 { 1893 <div class="media-list-item__state dw-mod">@settings.Status</div> 1894 } 1895 </div> 1896 @{ 1897 settings.InfoTable.CssClass += " media-list-item__parameters-table"; 1898 } 1899 1900 @Render(settings.InfoTable) 1901 </div> 1902 <div class="media-list-item__actions dw-mod"> 1903 <div class="media-list-item__actions-list dw-mod"> 1904 @{ 1905 var actions = settings.GetActions(); 1906 1907 foreach (ButtonBase action in actions) 1908 { 1909 action.ButtonLayout = ButtonLayout.None; 1910 action.CssClass += " media-list-item__action link"; 1911 1912 @Render(action) 1913 } 1914 } 1915 </div> 1916 1917 @if (settings.SelectButton != null && !string.IsNullOrEmpty(settings.SelectButton.Title)) 1918 { 1919 settings.SelectButton.CssClass += " u-no-margin"; 1920 1921 <div class="media-list-item__action-button"> 1922 @Render(settings.SelectButton) 1923 </div> 1924 } 1925 </div> 1926 </div> 1927 </div> 1928 } 1929 @using Dynamicweb.Rapido.Blocks.Components.General 1930 @using Dynamicweb.Rapido.Blocks.Components 1931 1932 @helper RenderTable(Table settings) 1933 { 1934 Dictionary<string, string> attributes = new Dictionary<string, string>(); 1935 if (!string.IsNullOrEmpty(settings.Id)) { attributes.Add("id", settings.Id); } 1936 1937 var enumToClasses = new Dictionary<TableDesign, string> 1938 { 1939 { TableDesign.Clean, "table--clean" }, 1940 { TableDesign.Bordered, "table--bordered" }, 1941 { TableDesign.Striped, "table--striped" }, 1942 { TableDesign.Hover, "table--hover" }, 1943 { TableDesign.Compact, "table--compact" }, 1944 { TableDesign.Condensed, "table--condensed" }, 1945 { TableDesign.NoTopBorder, "table--no-top-border" } 1946 }; 1947 string tableDesignClass = ""; 1948 if (settings.Design != TableDesign.None) 1949 { 1950 tableDesignClass = enumToClasses[settings.Design]; 1951 } 1952 1953 if (!string.IsNullOrEmpty(settings.CssClass) || settings.Design != TableDesign.None) { attributes.Add("class", "table " + tableDesignClass + " " + settings.CssClass + " dw-mod"); } 1954 1955 var resultAttributes = attributes.Concat(settings.ExtraAttributes).GroupBy(d => d.Key).ToDictionary(d => d.Key, d => d.Last().Value); 1956 1957 <table @ComponentMethods.AddAttributes(resultAttributes)> 1958 @if (settings.Header != null) 1959 { 1960 <thead> 1961 @Render(settings.Header) 1962 </thead> 1963 } 1964 <tbody> 1965 @foreach (var row in settings.Rows) 1966 { 1967 @Render(row) 1968 } 1969 </tbody> 1970 @if (settings.Footer != null) 1971 { 1972 <tfoot> 1973 @Render(settings.Footer) 1974 </tfoot> 1975 } 1976 </table> 1977 } 1978 @using Dynamicweb.Rapido.Blocks.Components.General 1979 @using Dynamicweb.Rapido.Blocks.Components 1980 1981 @helper RenderTableRow(TableRow settings) 1982 { 1983 Dictionary<string, string> attributes = new Dictionary<string, string>(); 1984 if (!string.IsNullOrEmpty(settings.Id)) { attributes.Add("id", settings.Id); } 1985 1986 var enumToClasses = new Dictionary<TableRowDesign, string> 1987 { 1988 { TableRowDesign.NoBorder, "table__row--no-border" }, 1989 { TableRowDesign.Border, "table__row--border" }, 1990 { TableRowDesign.TopBorder, "table__row--top-line" }, 1991 { TableRowDesign.BottomBorder, "table__row--bottom-line" }, 1992 { TableRowDesign.Solid, "table__row--solid" } 1993 }; 1994 1995 string tableRowDesignClass = ""; 1996 if (settings.Design != TableRowDesign.None) 1997 { 1998 tableRowDesignClass = enumToClasses[settings.Design]; 1999 } 2000 2001 if (!string.IsNullOrEmpty(settings.CssClass) || settings.Design != TableRowDesign.None) { attributes.Add("class", "table__row " + tableRowDesignClass + " " + settings.CssClass + " dw-mod"); } 2002 2003 var resultAttributes = attributes.Concat(settings.ExtraAttributes).GroupBy(d => d.Key).ToDictionary(d => d.Key, d => d.Last().Value); 2004 2005 <tr @ComponentMethods.AddAttributes(resultAttributes)> 2006 @foreach (var cell in settings.Cells) 2007 { 2008 if (settings.IsHeaderRow) 2009 { 2010 cell.IsHeader = true; 2011 } 2012 @Render(cell) 2013 } 2014 </tr> 2015 } 2016 @using Dynamicweb.Rapido.Blocks.Components.General 2017 @using Dynamicweb.Rapido.Blocks.Components 2018 @using Dynamicweb.Core 2019 2020 @helper RenderTableCell(TableCell settings) 2021 { 2022 Dictionary<string, string> attributes = new Dictionary<string, string>(); 2023 if (!string.IsNullOrEmpty(settings.Id)) { attributes.Add("id", settings.Id); } 2024 if (settings.Colspan != 0) { attributes.Add("colspan", Converter.ToString(settings.Colspan)); } 2025 if (settings.Rowspan != 0) { attributes.Add("rowspan", Converter.ToString(settings.Rowspan)); } 2026 if (!string.IsNullOrEmpty(settings.CssClass)) { attributes.Add("class", settings.CssClass + " dw-mod"); } 2027 2028 var resultAttributes = attributes.Concat(settings.ExtraAttributes).GroupBy(d => d.Key).ToDictionary(d => d.Key, d => d.Last().Value); 2029 2030 string tagName = settings.IsHeader ? "th" : "td"; 2031 2032 @("<" + tagName + " " + ComponentMethods.AddAttributes(resultAttributes) + ">") 2033 @settings.Content 2034 @("</" + tagName + ">"); 2035 } 2036 @using System.Linq 2037 @using Dynamicweb.Rapido.Blocks.Components.General 2038 2039 @* Component *@ 2040 2041 @helper RenderPagination(Dynamicweb.Rapido.Blocks.Components.General.Pagination settings) 2042 { 2043 var pageNumberQueryStringName = Dynamicweb.Rapido.Services.Pagination.GetPageNumberQueryStringName(settings); // Get the proper 'page number' query string parameter 2044 var queryParameters = Dynamicweb.Rapido.Services.Url.GetQueryParameters(pageNumberQueryStringName); // Get the NameValueCollection from the querystring 2045 2046 if (settings.NumberOfPages > 1) 2047 { 2048 string url = HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Authority) + "/Default.aspx"; 2049 string ariaLabel = !string.IsNullOrWhiteSpace(settings.AriaLabel) ? settings.AriaLabel : Translate("Page navigation"); 2050 Dictionary<string, int> startAndEndPageNumber = Dynamicweb.Rapido.Services.Pagination.GetStartAndEndPageNumber(settings); 2051 2052 <div class="pager u-margin-top dw-mod @settings.CssClass" aria-label="@ariaLabel"> 2053 @if (settings.ShowPagingInfo) 2054 { 2055 <div class="pager__info dw-mod"> 2056 @Translate("Page") @settings.CurrentPageNumber @Translate("of") @settings.NumberOfPages 2057 </div> 2058 } 2059 <ul class="pager__list dw-mod"> 2060 @if (!string.IsNullOrWhiteSpace(settings.FirstPageUrl) && settings.ShowFirstAndLastControls) 2061 { 2062 @Render(new PaginationItem { Link = settings.FirstPageUrl, Icon = settings.FirstIcon }) 2063 } 2064 @if (!string.IsNullOrWhiteSpace(settings.PreviousPageUrl) && settings.ShowNextAndPrevControls) 2065 { 2066 @Render(new PaginationItem { Link = settings.PreviousPageUrl, Icon = settings.PrevIcon }) 2067 } 2068 @if (settings.GetPages().Any()) 2069 { 2070 foreach (var page in settings.GetPages()) 2071 { 2072 @Render(page) 2073 } 2074 } 2075 else 2076 { 2077 for (var page = startAndEndPageNumber["StartPage"]; page <= startAndEndPageNumber["EndPage"]; page++) 2078 { 2079 queryParameters = Dynamicweb.Rapido.Services.Url.UpdateQueryStringParameter(queryParameters, pageNumberQueryStringName, page.ToString()); 2080 @Render(new PaginationItem { Label = page.ToString(), Link = Dynamicweb.Rapido.Services.Url.BuildUri(url, queryParameters).PathAndQuery, IsActive = (settings.CurrentPageNumber == page) }); 2081 } 2082 } 2083 @if (!string.IsNullOrWhiteSpace(settings.NextPageUrl) && settings.ShowNextAndPrevControls) 2084 { 2085 @Render(new PaginationItem { Link = settings.NextPageUrl, Icon = settings.NextIcon }) 2086 } 2087 @if (!string.IsNullOrWhiteSpace(settings.LastPageUrl) && settings.ShowFirstAndLastControls) 2088 { 2089 @Render(new PaginationItem { Link = settings.LastPageUrl, Icon = settings.LastIcon }) 2090 } 2091 </ul> 2092 </div> 2093 } 2094 } 2095 2096 @helper RenderPaginationItem(PaginationItem settings) 2097 { 2098 if (settings.Icon == null) 2099 { 2100 settings.Icon = new Icon(); 2101 } 2102 2103 settings.Icon.Label = settings.Label; 2104 <li class="pager__btn dw-mod"> 2105 @if (settings.IsActive) 2106 { 2107 <span class="pager__num pager__num--current dw-mod"> 2108 @Render(settings.Icon) 2109 </span> 2110 } 2111 else 2112 { 2113 <a href="@settings.Link" class="pager__num dw-mod"> 2114 @Render(settings.Icon) 2115 </a> 2116 } 2117 </li> 2118 } 2119 2120 2121 @using Dynamicweb.Rapido.Blocks.Components.General 2122 @using Dynamicweb.Rapido.Blocks.Components.Ecommerce 2123 2124 2125 @using Dynamicweb.Rapido.Blocks.Components 2126 2127 @using Dynamicweb.Rapido.Blocks.Components.General 2128 @using Dynamicweb.Rapido.Blocks.Components.Ecommerce 2129 2130 2131 @using Dynamicweb.Rapido.Blocks.Components 2132 2133 @functions { 2134 public class WEHD365CEForm : ComponentBase 2135 { 2136 public string FormID { get; set; } 2137 public string FormDisplayLanguage { get; set; } 2138 public string FormHeaderText { get; set; } 2139 public string ProductID { get; set; } 2140 public string ProductName { get; set; } 2141 } 2142 } 2143 2144 @helper RenderWEHD365CEForm(WEHD365CEForm settings) 2145 { 2146 switch (settings.FormID) 2147 { 2148 case "frmLGTest1": // render form frmLGTest1 2149 <h6 style="text-align:center;">@settings.FormHeaderText</h6> 2150 <div data-form-block-id="c9425061-e4b7-eb11-8236-000d3abf1bff"></div> 2151 <script src="https://mktdplp102cdn.azureedge.net/public/latest/js/form-loader.js?v=1.72.2001.0"></script> 2152 <script> 2153 MsCrmMkt.MsCrmFormLoader.on('afterFormLoad', function(event) { 2154 var self = window.location.toString(); 2155 document.getElementById('f826b004-72ef-460c-bcc5-bd50e3b038bd').value = self; 2156 document.getElementById('7fb79639-35db-ea11-a813-000d3a23c7a8').value = "@settings.ProductName"; 2157 }); 2158 </script> 2159 <div id="dtWuwwn4OJIUNVclIs5anD-R5PxhY0Y2iU1gV4HWxbrA"></div> 2160 <script src="https://mktdplp102cdn.azureedge.net/public/latest/js/ws-tracking.js?v=1.72.2001.0"></script> 2161 <div class="d365-mkt-config" style="display:none" data-website-id="tWuwwn4OJIUNVclIs5anD-R5PxhY0Y2iU1gV4HWxbrA" data-hostname="d846845065e14e938c7919c162112442.svc.dynamics.com"> 2162 </div> 2163 break; 2164 case "frmLGTest2": // render form frmLGTest2 2165 <h6 style="text-align:center;">@settings.FormHeaderText</h6> 2166 <div data-form-block-id="c9425061-e4b7-eb11-8236-000d3abf1bff"></div> 2167 <script src="https://mktdplp102cdn.azureedge.net/public/latest/js/form-loader.js?v=1.72.2001.0"></script> 2168 <script> 2169 MsCrmMkt.MsCrmFormLoader.on('afterFormLoad', function(event) { 2170 var self = window.location.toString(); 2171 document.getElementById('f826b004-72ef-460c-bcc5-bd50e3b038bd').value = self; 2172 document.getElementById('7fb79639-35db-ea11-a813-000d3a23c7a8').value = "@settings.ProductName"; 2173 }); 2174 </script> 2175 <div id="dtWuwwn4OJIUNVclIs5anD-R5PxhY0Y2iU1gV4HWxbrA"></div> 2176 <script src="https://mktdplp102cdn.azureedge.net/public/latest/js/ws-tracking.js?v=1.72.2001.0"></script> 2177 <div class="d365-mkt-config" style="display:none" data-website-id="tWuwwn4OJIUNVclIs5anD-R5PxhY0Y2iU1gV4HWxbrA" data-hostname="d846845065e14e938c7919c162112442.svc.dynamics.com"> 2178 </div> 2179 break; 2180 default: 2181 break; 2182 } 2183 } 2184 2185 2186 2187 @using Dynamicweb.Frontend 2188 @using System.Reflection 2189 @using Dynamicweb.Content.Items 2190 @using System.Web.UI.HtmlControls 2191 @using Dynamicweb.Rapido.Blocks.Components 2192 @using Dynamicweb.Rapido.Blocks 2193 @using Dynamicweb.Rapido.Blocks.Components.Articles 2194 2195 @* Components for the articles *@ 2196 @using System.Reflection 2197 @using Dynamicweb.Rapido.Blocks.Components.Articles 2198 2199 2200 @* Component for the articles *@ 2201 2202 @helper RenderArticleBanner(dynamic settings) { 2203 string filterClasses = "image-filter image-filter--darken"; 2204 settings.Layout = ArticleHeaderLayout.Banner; 2205 2206 if (settings.Image != null) 2207 { 2208 if (settings.Image.Path != null) 2209 { 2210 <section class="multiple-paragraphs-container u-color-light paragraph-container--full-width"> 2211 <div class="background-image @filterClasses dw-mod"> 2212 <div class="background-image__wrapper @filterClasses dw-mod"> 2213 @{ 2214 settings.Image.CssClass += "background-image__cover dw-mod"; 2215 } 2216 @Render(settings.Image) 2217 </div> 2218 </div> 2219 <div class="center-container dw-mod"> 2220 <div class="grid"> 2221 <div class="grid__col-md-8 grid__col-xs-12 paragraph-container paragraph-container--height-lg"> 2222 <div class="u-left-middle"> 2223 <div> 2224 @if (!String.IsNullOrEmpty(settings.Heading)) 2225 { 2226 <h1 class="article__header article__header--giant dw-mod" style="color: @settings.TextColor">@settings.Heading</h1> 2227 } 2228 @if (!String.IsNullOrEmpty(settings.Subheading)) 2229 { 2230 <div class="article__leadtext dw-mod" style="color: @settings.TextColor">@settings.Subheading</div> 2231 } 2232 @if (!String.IsNullOrEmpty(settings.Author) || !String.IsNullOrEmpty(settings.Date)) 2233 { 2234 <small class="article__post-info u-margin-bottom--lg dw-mod" style="color: @settings.TextColor">@settings.Author @settings.Date</small> 2235 } 2236 @if (!String.IsNullOrEmpty(settings.Link)) { 2237 <div class="grid__cell"> 2238 @Render(new Link { Href = settings.Link, Title = settings.LinkText, ButtonLayout = settings.ButtonLayout }) 2239 </div> 2240 } 2241 </div> 2242 </div> 2243 </div> 2244 @if (settings.ExternalParagraphId != 0) 2245 { 2246 <div class="grid__col-md-4 grid__col-sm-12 grid__col-xs-12 paragraph-container paragraph-container--height-auto dw-mod"> 2247 <div class="u-color-light-gray--bg u-color-dark dw-mod"> 2248 @RenderParagraphContent(settings.ExternalParagraphId) 2249 </div> 2250 </div> 2251 } 2252 2253 </div> 2254 </div> 2255 </section> 2256 if (!String.IsNullOrEmpty(settings.Image.Caption)) { 2257 <div class="image-caption dw-mod">@settings.Image.Caption</div> 2258 } 2259 } 2260 else 2261 { 2262 settings.Layout = ArticleHeaderLayout.Clean; 2263 @RenderArticleCleanHeader(settings); 2264 } 2265 } 2266 else 2267 { 2268 settings.Layout = ArticleHeaderLayout.Clean; 2269 @RenderArticleCleanHeader(settings); 2270 } 2271 } 2272 @using System.Reflection 2273 @using Dynamicweb.Rapido.Blocks.Components 2274 @using Dynamicweb.Rapido.Blocks.Components.General 2275 @using Dynamicweb.Rapido.Blocks.Components.Articles 2276 @using Dynamicweb.Rapido.Blocks 2277 2278 2279 @* Component for the articles *@ 2280 2281 @helper RenderArticleHeader(ArticleHeader settings) { 2282 dynamic[] methodParameters = new dynamic[1]; 2283 methodParameters[0] = settings; 2284 MethodInfo customMethod = this.GetType().GetMethod("RenderArticleHeaderCustom"); 2285 2286 if (customMethod != null) 2287 { 2288 @customMethod.Invoke(this, methodParameters).ToString(); 2289 } else { 2290 switch (settings.Layout) 2291 { 2292 case ArticleHeaderLayout.Clean: 2293 @RenderArticleCleanHeader(settings); 2294 break; 2295 case ArticleHeaderLayout.Split: 2296 @RenderArticleSplitHeader(settings); 2297 break; 2298 case ArticleHeaderLayout.Banner: 2299 @RenderArticleBannerHeader(settings); 2300 break; 2301 case ArticleHeaderLayout.Overlay: 2302 @RenderArticleOverlayHeader(settings); 2303 break; 2304 default: 2305 @RenderArticleCleanHeader(settings); 2306 break; 2307 } 2308 } 2309 } 2310 2311 @helper RenderArticleCleanHeader(ArticleHeader settings) { 2312 dynamic[] methodParameters = new dynamic[1]; 2313 methodParameters[0] = settings; 2314 MethodInfo customMethod = this.GetType().GetMethod("RenderArticleCleanHeaderCustom"); 2315 2316 if (customMethod != null) 2317 { 2318 @customMethod.Invoke(this, methodParameters).ToString(); 2319 } 2320 else 2321 { 2322 string contentColumns = settings.TextLayout != ArticleHeaderTextLayout.Full ? "8" : "12"; 2323 2324 <div class="grid grid--align-content-start grid--justify-start"> 2325 <div class="grid__col-md-@contentColumns grid__col-sm-12 u-padding--lg dw-mod"> 2326 @if (!String.IsNullOrEmpty(settings.Category) || !String.IsNullOrEmpty(settings.Author) || !String.IsNullOrEmpty(settings.Date) || settings.RatingOutOf != 0) 2327 { 2328 <div class="u-border-bottom u-padding-bottom"> 2329 @if (!String.IsNullOrEmpty(settings.Category)) 2330 { 2331 <div class="u-pull--left"> 2332 <div class="article__category dw-mod" style="color: @settings.CategoryColor">@settings.Category</div> 2333 </div> 2334 } 2335 <div class="u-pull--right"> 2336 @if (!String.IsNullOrEmpty(settings.Author) || !String.IsNullOrEmpty(settings.Date)) 2337 { 2338 <small class="article__post-info dw-mod">@settings.Author @settings.Date</small> 2339 } 2340 @if (settings.RatingOutOf != 0) 2341 { 2342 @Render(new Rating { Score = settings.RatingScore, OutOf = settings.RatingOutOf }) 2343 } 2344 </div> 2345 </div> 2346 } 2347 2348 <div class="grid__cell"> 2349 @if (!String.IsNullOrEmpty(settings.Heading)) 2350 { 2351 <h1 class="article__header article__header--giant dw-mod">@settings.Heading</h1> 2352 } 2353 @if (settings.Image != null) 2354 { 2355 if (settings.Image.Path != null) 2356 { 2357 <div class="u-padding-bottom--lg"> 2358 @Render(settings.Image) 2359 </div> 2360 } 2361 } 2362 @if (!String.IsNullOrEmpty(settings.Subheading)) 2363 { 2364 <div class="article__leadtext dw-mod">@settings.Subheading</div> 2365 } 2366 @if (!String.IsNullOrEmpty(settings.Link)) 2367 { 2368 <div class="grid__cell"> 2369 @Render(new Link { Href = settings.Link, Title = settings.LinkText, ButtonLayout = settings.ButtonLayout }) 2370 </div> 2371 } 2372 </div> 2373 </div> 2374 @if (settings.ExternalParagraphId != 0) 2375 { 2376 <div class="grid__col-md-4 grid__col-sm-12 u-padding--lg u-color-light-gray--bg dw-mod"> 2377 @RenderParagraphContent(settings.ExternalParagraphId) 2378 </div> 2379 } 2380 </div> 2381 } 2382 } 2383 2384 @helper RenderArticleSplitHeader(ArticleHeader settings) { 2385 dynamic[] methodParameters = new dynamic[1]; 2386 methodParameters[0] = settings; 2387 MethodInfo customMethod = this.GetType().GetMethod("RenderArticleSplitHeaderCustom"); 2388 2389 if (customMethod != null) 2390 { 2391 @customMethod.Invoke(this, methodParameters).ToString(); 2392 } 2393 else 2394 { 2395 string headerColumnWidth = settings.ExternalParagraphId != 0 ? "4" : "6"; 2396 2397 if (settings.Image != null) 2398 { 2399 if (settings.Image.Path != null) 2400 { 2401 <section class="multiple-paragraphs-container paragraph-container--full-width"> 2402 <div class="grid"> 2403 <div class="grid__col-md-@headerColumnWidth grid__col-sm-12 grid__col-xs-12 paragraph-container paragraph-container--height-xl dw-mod"> 2404 <div class="u-left-middle u-padding--lg"> 2405 <div> 2406 @if (!String.IsNullOrEmpty(settings.Category)) 2407 { 2408 <div class="article__category dw-mod" style="color: @settings.CategoryColor">@settings.Category</div> 2409 } 2410 @if (!String.IsNullOrEmpty(settings.Heading)) 2411 { 2412 <h1 class="article__header article__header--giant dw-mod">@settings.Heading</h1> 2413 } 2414 @if (!String.IsNullOrEmpty(settings.Subheading)) 2415 { 2416 <div class="article__leadtext dw-mod">@settings.Subheading</div> 2417 } 2418 @if (!String.IsNullOrEmpty(settings.Author) || !String.IsNullOrEmpty(settings.Date)) 2419 { 2420 <small class="article__post-info u-pull--left dw-mod">@settings.Author @settings.Date</small> 2421 } 2422 @if (settings.RatingOutOf != 0) 2423 { 2424 <div class="u-pull--right"> 2425 @Render(new Rating { Score = settings.RatingScore, OutOf = settings.RatingOutOf }) 2426 </div> 2427 } 2428 @if (!String.IsNullOrEmpty(settings.Link)) { 2429 <div class="u-full-width u-pull--left u-margin-top"> 2430 @Render(new Link { Href = settings.Link, Title = settings.LinkText, ButtonLayout = settings.ButtonLayout }) 2431 </div> 2432 } 2433 </div> 2434 </div> 2435 </div> 2436 <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;[email protected]); background-position: center center; background-size: cover;"></div> 2437 @if (settings.ExternalParagraphId != 0) 2438 { 2439 <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"> 2440 @RenderParagraphContent(settings.ExternalParagraphId) 2441 </div> 2442 } 2443 </div> 2444 </section> 2445 } 2446 } 2447 else 2448 { 2449 @RenderArticleCleanHeader(settings); 2450 } 2451 } 2452 } 2453 2454 @helper RenderArticleOverlayHeader(ArticleHeader settings) { 2455 dynamic[] methodParameters = new dynamic[1]; 2456 methodParameters[0] = settings; 2457 MethodInfo customMethod = this.GetType().GetMethod("RenderArticleOverlayHeaderCustom"); 2458 2459 if (customMethod != null) 2460 { 2461 @customMethod.Invoke(this, methodParameters).ToString(); 2462 } 2463 else 2464 { 2465 string contentColumns = settings.TextLayout != ArticleHeaderTextLayout.Full ? "8" : "12"; 2466 string contentAlignment = settings.TextLayout == ArticleHeaderTextLayout.Center ? "grid--justify-center" : ""; 2467 2468 if (settings.Image != null) 2469 { 2470 if (settings.Image.Path != null) 2471 { 2472 if (settings.ExternalParagraphId == 0) 2473 { 2474 <section class="multiple-paragraphs-container u-color-light paragraph-container--full-width"> 2475 <div class="background-image image-filter image-filter--darken dw-mod"> 2476 <div class="background-image__wrapper image-filter image-filter--darken dw-mod"> 2477 @{ 2478 settings.Image.CssClass += "background-image__cover dw-mod"; 2479 } 2480 @Render(settings.Image) 2481 </div> 2482 </div> 2483 <div class="center-container dw-mod"> 2484 <div class="grid @contentAlignment"> 2485 <div class="grid__col-md-@contentColumns grid__col-xs-12 paragraph-container paragraph-container--height-xl dw-mod"> 2486 @if (!string.IsNullOrEmpty(settings.Heading)) 2487 { 2488 <h1 class="article__header article__header--giant u-padding-top--lg dw-mod" style="color: @settings.TextColor">@settings.Heading</h1> 2489 } 2490 @if (!String.IsNullOrEmpty(settings.Subheading)) 2491 { 2492 <div class="article__leadtext dw-mod" style="color: @settings.TextColor">@settings.Subheading</div> 2493 } 2494 <div class="u-margin-top"> 2495 @if (!String.IsNullOrEmpty(settings.Author) || !String.IsNullOrEmpty(settings.Date)) 2496 { 2497 <small class="article__post-info u-pull--left dw-mod" style="color: @settings.TextColor">@settings.Author @settings.Date</small> 2498 } 2499 @if (settings.RatingOutOf != 0) 2500 { 2501 <div class="u-pull--right"> 2502 @Render(new Rating { Score = settings.RatingScore, OutOf = settings.RatingOutOf }) 2503 </div> 2504 } 2505 </div> 2506 @if (!String.IsNullOrEmpty(settings.Link)) 2507 { 2508 <div class="grid__cell"> 2509 @Render(new Link { Href = settings.Link, Title = settings.LinkText, ButtonLayout = settings.ButtonLayout }) 2510 </div> 2511 } 2512 </div> 2513 </div> 2514 </div> 2515 </section> 2516 } 2517 else 2518 { 2519 @RenderArticleBanner(settings); 2520 } 2521 } 2522 } 2523 else 2524 { 2525 @RenderArticleCleanHeader(settings); 2526 } 2527 } 2528 } 2529 2530 @helper RenderArticleBannerHeader(dynamic settings) { 2531 dynamic[] methodParameters = new dynamic[1]; 2532 methodParameters[0] = settings; 2533 MethodInfo customMethod = this.GetType().GetMethod("RenderArticleBannerHeaderCustom"); 2534 2535 if (customMethod != null) 2536 { 2537 @customMethod.Invoke(this, methodParameters).ToString(); 2538 } 2539 else 2540 { 2541 @RenderArticleBanner(settings); 2542 } 2543 } 2544 @using System.Reflection 2545 @using System.Text.RegularExpressions; 2546 @using Dynamicweb.Frontend 2547 @using Dynamicweb.Content.Items 2548 @using Dynamicweb.Rapido.Blocks.Components 2549 @using Dynamicweb.Rapido.Blocks.Components.Articles 2550 @using Dynamicweb.Rapido.Blocks 2551 2552 @* Component for the articles *@ 2553 2554 @helper RenderArticleBodyRow(ArticleBodyRow settings) 2555 { 2556 string position = settings.TopLayout == "overlay" ? "article__overlay-offset" : ""; 2557 string contentAlignment = settings.TextLayout == "center" ? "grid--justify-center" : ""; 2558 2559 <div class="grid grid--align-content-start @contentAlignment @position dw-mod"> 2560 @RenderBlockList(settings.SubBlocks) 2561 </div> 2562 } 2563 @using System.Reflection 2564 @using Dynamicweb.Rapido.Blocks.Components 2565 @using Dynamicweb.Rapido.Blocks.Components.General 2566 @using Dynamicweb.Rapido.Blocks.Components.Articles 2567 @using Dynamicweb.Rapido.Blocks 2568 2569 @* Component for the articles *@ 2570 2571 @helper RenderArticleImage(ArticleImage settings) 2572 { 2573 if (settings.Image != null) 2574 { 2575 if (settings.Image.Path != null) 2576 { 2577 <div class="u-margin-bottom--lg"> 2578 @Render(settings.Image) 2579 </div> 2580 } 2581 } 2582 } 2583 @using System.Reflection 2584 @using Dynamicweb.Rapido.Blocks.Components 2585 @using Dynamicweb.Rapido.Blocks.Components.Articles 2586 2587 2588 @* Component for the articles *@ 2589 2590 @helper RenderArticleSubHeader(ArticleSubHeader settings) 2591 { 2592 if (!String.IsNullOrEmpty(settings.Title)) 2593 { 2594 <h2 class="article__header">@settings.Title</h2> 2595 } 2596 } 2597 @using System.Reflection 2598 @using Dynamicweb.Rapido.Blocks.Components 2599 @using Dynamicweb.Rapido.Blocks.Components.Articles 2600 @using Dynamicweb.Rapido.Blocks 2601 2602 2603 @* Component for the articles *@ 2604 2605 @helper RenderArticleText(ArticleText settings) 2606 { 2607 if (!String.IsNullOrEmpty(settings.Text)) 2608 { 2609 string greatTextClass = settings.EnableLargeText == true ? "article__paragraph--great-text" : ""; 2610 2611 <div class="article__paragraph @greatTextClass dw-mod"> 2612 @settings.Text 2613 </div> 2614 } 2615 } 2616 @using System.Reflection 2617 @using Dynamicweb.Rapido.Blocks.Components 2618 @using Dynamicweb.Rapido.Blocks.Components.Articles 2619 @using Dynamicweb.Rapido.Blocks 2620 2621 2622 @* Component for the articles *@ 2623 2624 @helper RenderArticleQuote(ArticleQuote settings) 2625 { 2626 string text = Regex.Replace(settings.Text, "<.*?>", String.Empty); 2627 2628 <div class="grid u-padding-bottom--lg"> 2629 @if (settings.Image != null) 2630 { 2631 if (settings.Image.Path != null) { 2632 <div class="grid__col-3"> 2633 <div class="grid__cell-img"> 2634 @{ 2635 settings.Image.Title = !String.IsNullOrEmpty(settings.Image.Title) ? settings.Image.Title : settings.Author; 2636 settings.Image.CssClass += " article__image article__image--ball"; 2637 settings.Image.ImageDefault.Width = 200; 2638 settings.Image.ImageDefault.Height = 200; 2639 } 2640 @Render(settings.Image) 2641 </div> 2642 </div> 2643 } 2644 } 2645 <div class="grid__col-auto"> 2646 @if (!String.IsNullOrEmpty(settings.Text)) 2647 { 2648 <div class="article__quote dw-mod"> 2649 <i class="fas fa-quote-right u-margin-bottom--lg"></i> 2650 @settings.Text 2651 <i class="fas fa-quote-right"></i> 2652 </div> 2653 } 2654 @if (!String.IsNullOrEmpty(settings.Author)) 2655 { 2656 <div class="article__quote-author dw-mod"> 2657 - @settings.Author 2658 </div> 2659 } 2660 </div> 2661 </div> 2662 } 2663 @using System.Reflection 2664 @using Dynamicweb.Rapido.Blocks.Components 2665 @using Dynamicweb.Rapido.Blocks.Components.Articles 2666 @using Dynamicweb.Rapido.Blocks 2667 2668 @* Component for the articles *@ 2669 2670 @helper RenderArticleInfoTable(ArticleInfoTable settings) 2671 { 2672 <table class="table table--clean"> 2673 @foreach (var row in settings.Rows) 2674 { 2675 string iconColor = row.IconColor != null ? row.IconColor : "u-brand-color-two"; 2676 2677 <tr> 2678 @if (!String.IsNullOrEmpty(row.Icon)) 2679 { 2680 <td class="u-w32px"><i class="@row.Icon fa-2x @row.IconColor"></i></td> 2681 } 2682 <td class="u-no-margin-on-p-elements"> 2683 <div class="u-bold">@row.Title</div> 2684 @if (!String.IsNullOrEmpty(row.SubTitle)) 2685 { 2686 if (row.Link == null) 2687 { 2688 <div>@row.SubTitle</div> 2689 } 2690 else 2691 { 2692 <a href="@row.Link" class="u-color-inherit">@row.SubTitle</a> 2693 } 2694 } 2695 </td> 2696 </tr> 2697 } 2698 </table> 2699 } 2700 @using System.Reflection 2701 @using Dynamicweb.Rapido.Blocks.Components 2702 @using Dynamicweb.Rapido.Blocks.Components.General 2703 @using Dynamicweb.Rapido.Blocks.Components.Articles 2704 @using Dynamicweb.Rapido.Blocks 2705 2706 @* Component for the articles *@ 2707 2708 @helper RenderArticleGalleryModal(ArticleGalleryModal settings) 2709 { 2710 Modal galleryModal = new Modal 2711 { 2712 Id = "ParagraphGallery", 2713 Width = ModalWidth.Full, 2714 BodyTemplate = RenderArticleGalleryModalContent() 2715 }; 2716 2717 @Render(galleryModal) 2718 } 2719 2720 @helper RenderArticleGalleryModalContent() { 2721 <div class="modal__image-min-size-wrapper"> 2722 @Render(new Image { 2723 Id = "ParagraphGallery", 2724 Path = "#", 2725 CssClass = "modal--full__img", 2726 DisableLazyLoad = true, 2727 DisableImageEngine = true 2728 }) 2729 </div> 2730 2731 <div class="modal__images-counter" id="ParagraphGallery_counter"></div> 2732 2733 @Render(new Button { 2734 Id = "ParagraphGallery_prev", 2735 ButtonType = ButtonType.Button, 2736 ButtonLayout = ButtonLayout.None, 2737 CssClass = "modal__prev-btn", 2738 Icon = new Icon { Prefix = "far", Name = "fa-angle-left", LabelPosition = IconLabelPosition.After }, 2739 OnClick = "Gallery.prevImage('ParagraphGallery')" 2740 }) 2741 2742 @Render(new Button { 2743 Id = "ParagraphGallery_next", 2744 ButtonType = ButtonType.Button, 2745 ButtonLayout = ButtonLayout.None, 2746 CssClass = "modal__next-btn", 2747 Icon = new Icon { Prefix = "far", Name = "fa-angle-right", LabelPosition = IconLabelPosition.After }, 2748 OnClick = "Gallery.nextImage('ParagraphGallery')" 2749 }) 2750 } 2751 @using System.Reflection 2752 @using Dynamicweb.Rapido.Blocks.Components 2753 @using Dynamicweb.Rapido.Blocks.Components.Articles 2754 @using Dynamicweb.Rapido.Blocks 2755 2756 2757 @* Component for the articles *@ 2758 2759 @helper RenderArticleRelated(ArticleRelated settings) 2760 { 2761 string cardClass = Pageview.Device.ToString() != "Tablet" ? "card u-color-light--bg u-full-height" : ""; 2762 string cardFooterClass = Pageview.Device.ToString() != "Tablet" ? "card-footer u-color-light--bg" : ""; 2763 2764 <section class="multiple-paragraphs-container u-color-light-gray--bg paragraph-container--full-width"> 2765 <div class="center-container dw-mod"> 2766 <div class="grid u-padding"> 2767 <div class="grid__col-md-12 grid__col-xs-12"> 2768 <h2 class="article__header u-no-margin u-margin-top">@settings.Title</h2> 2769 </div> 2770 </div> 2771 2772 <div class="js-handlebars-root u-padding" id="@settings.Title.Replace(" ", String.Empty)" data-template="RelatedSimpleTemplate" data-json-feed="/[email protected]&@settings.Query&[email protected]&[email protected]"></div> 2773 2774 <script id="RelatedSimpleTemplate" type="text/x-template"> 2775 {{#.}} 2776 <div class="grid u-padding-bottom--lg"> 2777 {{#Cases}} 2778 <div class="grid__col-lg-3 grid__col-sm-6 image-hover--zoom dw-mod"> 2779 <a href="{{link}}" class="u-full-height u-color-light--bg u-flex u-flex--column"> 2780 {{#if image}} 2781 <div class="u-color-light--bg u-no-padding dw-mod"> 2782 <div class="flex-img image-hover__wrapper"> 2783 <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}}" /> 2784 </div> 2785 </div> 2786 {{/if}} 2787 2788 <div class="card u-color-light--bg u-full-height dw-mod"> 2789 <h3 class="article-list__item-header u-truncate-text dw-mod">{{title}}</h3> 2790 <p class="article__short-summary dw-mod">{{summary}}</p> 2791 </div> 2792 </a> 2793 </div> 2794 {{/Cases}} 2795 </div> 2796 {{/.}} 2797 </script> 2798 </div> 2799 </section> 2800 } 2801 @using System.Reflection 2802 @using Dynamicweb.Rapido.Blocks.Components 2803 @using Dynamicweb.Rapido.Blocks.Components.Articles 2804 @using Dynamicweb.Rapido.Blocks 2805 2806 2807 @* Component for the articles *@ 2808 2809 @helper RenderArticleMenu(ArticleMenu settings) 2810 { 2811 if (!String.IsNullOrEmpty(settings.Title)) { 2812 <div class="u-margin u-border-bottom"> 2813 <h3 class="u-no-margin">@settings.Title</h3> 2814 </div> 2815 } 2816 2817 <ul class="menu-left u-margin-bottom dw-mod"> 2818 @foreach (var item in settings.Items) 2819 { 2820 @Render(item) 2821 } 2822 </ul> 2823 } 2824 2825 @helper RenderArticleMenuItem(ArticleMenuItem settings) 2826 { 2827 string link = !String.IsNullOrEmpty(settings.Link) ? settings.Link : "#"; 2828 2829 if (!String.IsNullOrEmpty(settings.Title)) { 2830 <li class="menu-left__item dw-mod"> 2831 <a href="@link" onclick="@settings.OnClick" class="menu-left__link dw-mod">@settings.Title</a> 2832 </li> 2833 } 2834 } 2835 @using System.Reflection 2836 @using Dynamicweb.Rapido.Blocks.Components 2837 @using Dynamicweb.Rapido.Blocks.Components.Articles 2838 @using Dynamicweb.Rapido.Blocks 2839 2840 @* Component for the articles *@ 2841 2842 @helper RenderArticleList(ArticleList settings) 2843 { 2844 if (Pageview != null) 2845 { 2846 bool isParagraph = Pageview.CurrentParagraph != null ? true : false; 2847 string[] sortArticlesListBy = new string[2]; 2848 2849 if (isParagraph) { 2850 sortArticlesListBy = Pageview.CurrentParagraph.Item["SortArticlesListBy"] != null && !string.IsNullOrEmpty(Pageview.CurrentParagraph.Item["SortArticlesListBy"].ToString()) ? Pageview.CurrentParagraph.Item["SortArticlesListBy"].ToString().Split('+') : new string[] { "Date", "ASC" }; 2851 } 2852 else { 2853 sortArticlesListBy = Pageview.Item["SortArticlesListBy"] != null && !string.IsNullOrEmpty(Pageview.Item["SortArticlesListBy"].ToString()) ? Pageview.Item["SortArticlesListBy"].ToString().Split('+') : new string[] { "Date", "ASC" }; 2854 } 2855 2856 string sourcePage = settings.SourcePage != null ? settings.SourcePage : Pageview.ID.ToString(); 2857 2858 if (!settings.DisablePagination) { 2859 @RenderItemList(new 2860 { 2861 ItemType = !String.IsNullOrEmpty(settings.ItemType) ? settings.ItemType : "DynamicArticle", 2862 ListSourceType = settings.SourceType, 2863 ListSourcePage = sourcePage, 2864 ItemFieldsList = "*", 2865 Filter = settings.Filter, 2866 ListOrderBy = sortArticlesListBy[0], 2867 ListOrderByDirection = sortArticlesListBy[1], 2868 ListSecondOrderBy = sortArticlesListBy[0] == "Date" ? "InFocusSortId" : "Date", 2869 ListSecondOrderByDirection = "ASC", 2870 IncludeAllChildItems = true, 2871 ListTemplate = settings.Template, 2872 ListPageSize = settings.PageSize.ToString() 2873 }); 2874 } else { 2875 @RenderItemList(new 2876 { 2877 ItemType = !String.IsNullOrEmpty(settings.ItemType) ? settings.ItemType : "DynamicArticle", 2878 ListSourceType = settings.SourceType, 2879 ListSourcePage = sourcePage, 2880 ItemFieldsList = "*", 2881 Filter = settings.Filter, 2882 ListOrderBy = sortArticlesListBy[0], 2883 ListOrderByDirection = sortArticlesListBy[1], 2884 ListSecondOrderBy = sortArticlesListBy[0] == "Date" ? "InFocusSortId" : "Date", 2885 ListSecondOrderByDirection = "ASC", 2886 IncludeAllChildItems = true, 2887 ListTemplate = settings.Template, 2888 ListPageSize = settings.PageSize.ToString(), 2889 ListViewMode = "Partial", 2890 ListShowTo = settings.PageSize + 1 2891 }); 2892 } 2893 } 2894 } 2895 @using System.Reflection 2896 @using Dynamicweb.Rapido.Blocks.Components.Articles 2897 2898 2899 @* Component for the articles *@ 2900 2901 @helper RenderArticleSummary(ArticleSummary settings) 2902 { 2903 if (!String.IsNullOrEmpty(settings.Text)) 2904 { 2905 <div class="article__summary dw-mod">@settings.Text</div> 2906 } 2907 } 2908 @using System.Reflection 2909 @using Dynamicweb.Rapido.Blocks.Components 2910 @using Dynamicweb.Rapido.Blocks.Components.Articles 2911 @using Dynamicweb.Rapido.Blocks 2912 2913 @* Component for the articles *@ 2914 2915 @helper RenderArticleListCategoryFilter(ArticleListCategoryFilter settings) 2916 { 2917 string pageId = Pageview.ID.ToString(); 2918 string selectedFilter = !String.IsNullOrEmpty(HttpContext.Current.Request.QueryString.Get("sourcePage")) ? HttpContext.Current.Request.QueryString.Get("sourcePage") : Translate("All"); 2919 var query = HttpUtility.ParseQueryString(HttpContext.Current.Request.QueryString.ToString()); 2920 2921 foreach (var option in settings.Categories) 2922 { 2923 selectedFilter = selectedFilter == option.Value ? option.Key : selectedFilter; 2924 } 2925 2926 if (selectedFilter == pageId) 2927 { 2928 selectedFilter = Translate("All"); 2929 } 2930 2931 if (Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet") 2932 { 2933 <div class="u-pull--right u-margin-left"> 2934 <div class="collection u-no-margin"> 2935 <h5>@Translate("Category")</h5> 2936 <input type="checkbox" id="CategorySelector" class="dropdown-trigger" /> 2937 <div class="dropdown u-w180px dw-mod"> 2938 <label class="dropdown__header dropdown__btn dw-mod" for="CategorySelector">@Translate(selectedFilter)</label> 2939 <div class="dropdown__content dw-mod"> 2940 @foreach (var option in settings.Categories) 2941 { 2942 <div class="dropdown__item" onclick="QueryArray.setParametersInCurrentURL({ sourceType: 'Page', sourcePage: '@(option.Key.ToLower() == "all" ? pageId : option.Value)' })">@Translate(option.Key)</div> 2943 } 2944 </div> 2945 <label class="dropdown-trigger-off" for="CategorySelector"></label> 2946 </div> 2947 </div> 2948 </div> 2949 } 2950 else 2951 { 2952 <div class="u-full-width u-margin-bottom"> 2953 <h5 class="u-no-margin">@Translate("Category")</h5> 2954 <input type="checkbox" id="CategorySelector" class="dropdown-trigger" /> 2955 <div class="dropdown u-full-width dw-mod"> 2956 <label class="dropdown__header dropdown__btn dw-mod" for="CategorySelector">@Translate(selectedFilter)</label> 2957 <div class="dropdown__content dw-mod"> 2958 @foreach (var option in settings.Categories) 2959 { 2960 <div class="dropdown__item" onclick="QueryArray.setParametersInCurrentURL({ sourceType: 'Page', sourcePage: '@(option.Key.ToLower() == "all" ? pageId : option.Value)' })">@Translate(option.Key)</div> 2961 } 2962 </div> 2963 <label class="dropdown-trigger-off" for="CategorySelector"></label> 2964 </div> 2965 </div> 2966 } 2967 } 2968 @using System.Reflection 2969 @using Dynamicweb.Rapido.Blocks.Components 2970 @using Dynamicweb.Rapido.Blocks.Components.Articles 2971 @using Dynamicweb.Rapido.Blocks 2972 @using System.Collections.Generic 2973 2974 @* Component for the articles *@ 2975 2976 @helper RenderArticleListFilter(ArticleListFilter settings) 2977 { 2978 string selectedFilter = !String.IsNullOrEmpty(HttpContext.Current.Request.QueryString.Get(settings.SystemName)) ? HttpContext.Current.Request.QueryString.Get(settings.SystemName) : Translate("All"); 2979 var query = HttpUtility.ParseQueryString(HttpContext.Current.Request.QueryString.ToString()); 2980 2981 if (settings.Options != null) 2982 { 2983 if (settings.Options is IEnumerable<dynamic>) 2984 { 2985 var options = (IEnumerable<dynamic>) settings.Options; 2986 settings.Options = options.OrderBy(item => item.Name); 2987 } 2988 2989 foreach (var option in settings.Options) 2990 { 2991 selectedFilter = selectedFilter == option.Value ? option.Name : selectedFilter; 2992 } 2993 2994 if (Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet") 2995 { 2996 <div class="u-pull--right u-margin-left"> 2997 <div class="collection u-no-margin"> 2998 <h5>@settings.Label</h5> 2999 <input type="checkbox" id="@(settings.SystemName)Selector" class="dropdown-trigger" /> 3000 <div class="dropdown u-w180px dw-mod"> 3001 <label class="dropdown__header dropdown__btn dw-mod" for="@(settings.SystemName)Selector">@Translate(selectedFilter)</label> 3002 <div class="dropdown__content dw-mod"> 3003 <div class="dropdown__item" onclick="QueryArray.setParameterInCurrentURL('@settings.SystemName', '')">@Translate("All")</div> 3004 @foreach (var option in settings.Options) 3005 { 3006 <div class="dropdown__item" onclick="QueryArray.setParameterInCurrentURL('@settings.SystemName', '@option.Value')">@Translate(option.Name)</div> 3007 } 3008 </div> 3009 <label class="dropdown-trigger-off" for="@(settings.SystemName)Selector"></label> 3010 </div> 3011 </div> 3012 </div> 3013 } 3014 else 3015 { 3016 <div class="u-full-width u-margin-bottom"> 3017 <h5 class="u-no-margin">@settings.Label</h5> 3018 <input type="checkbox" id="@(settings.SystemName)Selector" class="dropdown-trigger" /> 3019 <div class="dropdown u-full-width w-mod"> 3020 <label class="dropdown__header dropdown__btn dw-mod" for="@(settings.SystemName)Selector">@Translate(selectedFilter)</label> 3021 <div class="dropdown__content dw-mod"> 3022 <div class="dropdown__item" onclick="QueryArray.setParameterInCurrentURL('@settings.SystemName', '')">@Translate("All")</div> 3023 @foreach (var option in settings.Options) 3024 { 3025 <div class="dropdown__item" onclick="QueryArray.setParameterInCurrentURL('@settings.SystemName', '@option.Value')">@Translate(option.Name)</div> 3026 } 3027 </div> 3028 <label class="dropdown-trigger-off" for="@(settings.SystemName)Selector"></label> 3029 </div> 3030 </div> 3031 } 3032 } 3033 } 3034 @using System.Reflection 3035 @using Dynamicweb.Rapido.Blocks.Components 3036 @using Dynamicweb.Rapido.Blocks.Components.Articles 3037 @using Dynamicweb.Rapido.Blocks 3038 3039 @* Component for the articles *@ 3040 3041 @helper RenderArticleListSearch(ArticleListSearch settings) 3042 { 3043 string searchParameter = !string.IsNullOrEmpty(settings.SearchParameter) ? settings.SearchParameter : "Title"; 3044 string searchWord = HttpContext.Current.Request.QueryString.Get(searchParameter); 3045 string searchString = !string.IsNullOrEmpty(searchWord) ? searchWord.Trim('*') : ""; 3046 string className = "u-w340px u-pull--right u-margin-left"; 3047 3048 if (Pageview.Device.ToString() == "Mobile" || Pageview.Device.ToString() == "Tablet") 3049 { 3050 className = "u-full-width"; 3051 } 3052 3053 <div class="typeahead u-color-inherit u-margin-bottom dw-mod @className"> 3054 <input type="text" class="typeahead-search-field u-no-margin dw-mod" placeholder="@Translate("Search in list")" value="@searchString" id="ArticleListSearchInput" onchange="QueryArray.setParameterInCurrentURL('@searchParameter', '*' + document.getElementById('ArticleListSearchInput').value + '*')"> 3055 <button type="button" class="btn btn--condensed btn--primary u-no-margin dw-mod"><i class="fas fa-search"></i></button> 3056 </div> 3057 } 3058 @using System.Reflection 3059 @using Dynamicweb.Rapido.Blocks.Components 3060 @using Dynamicweb.Rapido.Blocks.Components.Articles 3061 @using Dynamicweb.Rapido.Blocks 3062 3063 @* Component for the articles *@ 3064 3065 @helper RenderArticleListNoResultsInfo(ArticleListNoResultsInfo settings) 3066 { 3067 <div class="u-margin-top--lg u-bold u-ta-center u-bold">@Translate(settings.Message)</div> 3068 } 3069 @using System.Reflection 3070 @using Dynamicweb.Rapido.Blocks.Components 3071 @using Dynamicweb.Rapido.Blocks.Components.General 3072 @using Dynamicweb.Rapido.Blocks.Components.Articles 3073 @using Dynamicweb.Rapido.Blocks 3074 @using System.Text.RegularExpressions 3075 3076 @* Component for the articles *@ 3077 3078 @helper RenderArticleListItem(ArticleListItem settings) 3079 { 3080 switch (settings.Type) { 3081 case ArticleListItemType.Card: 3082 @RenderArticleListItemCard(settings); 3083 break; 3084 case ArticleListItemType.List: 3085 @RenderArticleListItemList(settings); 3086 break; 3087 case ArticleListItemType.Simple: 3088 @RenderArticleListItemSimple(settings); 3089 break; 3090 default: 3091 @RenderArticleListItemCard(settings); 3092 break; 3093 } 3094 } 3095 3096 @helper RenderArticleListItemCard(ArticleListItem settings) { 3097 <a href="@settings.Link" class="u-full-height u-color-light--bg u-flex u-flex--column"> 3098 <div class="u-color-light--bg u-no-padding dw-mod"> 3099 @if (settings.Logo != null) 3100 { 3101 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;" : ""; 3102 settings.Logo.ImageDefault.Crop = 5; 3103 settings.Logo.ImageDefault.Width = settings.Logo.ImageDefault.Width == 1920 ? 240 : settings.Logo.ImageDefault.Width; 3104 settings.Logo.ImageDefault.Height = settings.Logo.ImageDefault.Height == 1080 ? 200 : settings.Logo.ImageDefault.Height; 3105 <div class="image-hover__wrapper layered-image layered-image--tinted dw-mod" style="@backgroundImage"> 3106 @if (settings.Stickers != null) 3107 { 3108 if (settings.Stickers.Position != StickersListPosition.Custom && settings.Stickers.Position != StickersListPosition.None) 3109 { 3110 @Render(settings.Stickers); 3111 } 3112 } 3113 @RenderImage(settings.Logo) 3114 </div> 3115 } else if (settings.Image != null) 3116 { 3117 <div class="flex-img image-hover__wrapper u-position-relative dw-mod"> 3118 @if (settings.Stickers != null) 3119 { 3120 if (settings.Stickers.Position != StickersListPosition.Custom && settings.Stickers.Position != StickersListPosition.None) 3121 { 3122 @Render(settings.Stickers); 3123 } 3124 } 3125 @Render(settings.Image) 3126 </div> 3127 } 3128 </div> 3129 3130 @if (!String.IsNullOrEmpty(settings.Title) || !String.IsNullOrEmpty(settings.Summary)) 3131 { 3132 <div class="card u-color-light--bg u-full-height dw-mod"> 3133 @if (settings.Stickers != null) 3134 { 3135 if (settings.Stickers.Position == StickersListPosition.Custom) 3136 { 3137 @Render(settings.Stickers); 3138 } 3139 } 3140 @if (!String.IsNullOrEmpty(settings.Title)) 3141 { 3142 <h3 class="article-list__item-header u-truncate-text dw-mod">@settings.Title</h3> 3143 } 3144 @if (!String.IsNullOrEmpty(settings.SubTitle)) 3145 { 3146 <div class="article-list__item-micro-info u-truncate-text dw-mod">@settings.SubTitle</div> 3147 } 3148 @if (!String.IsNullOrEmpty(settings.Summary)) 3149 { 3150 <p class="article__short-summary dw-mod">@settings.Summary</p> 3151 } 3152 </div> 3153 } 3154 </a> 3155 } 3156 3157 @helper RenderArticleListItemList(ArticleListItem settings) { 3158 <a href="@settings.Link"> 3159 <div class="grid u-color-light--bg u-no-padding dw-mod"> 3160 <div class="grid__col-md-3"> 3161 <div class="u-color-light--bg u-no-padding dw-mod"> 3162 @if (settings.Logo != null) 3163 { 3164 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;" : ""; 3165 settings.Logo.ImageDefault.Crop = 5; 3166 settings.Logo.ImageDefault.Width = settings.Logo.ImageDefault.Width == 1920 ? 240 : settings.Logo.ImageDefault.Width; 3167 settings.Logo.ImageDefault.Height = settings.Logo.ImageDefault.Height == 1080 ? 200 : settings.Logo.ImageDefault.Height; 3168 <div class="image-hover__wrapper layered-image layered-image--tinted dw-mod" style="@backgroundImage"> 3169 @if (settings.Stickers != null) 3170 { 3171 if (settings.Stickers.Position != StickersListPosition.Custom) 3172 { 3173 @Render(settings.Stickers); 3174 } 3175 } 3176 @RenderImage(settings.Logo) 3177 </div> 3178 } else if (settings.Image != null) 3179 { 3180 <div class="flex-img image-hover__wrapper dw-mod"> 3181 @if (settings.Stickers != null) 3182 { 3183 if (settings.Stickers.Position != StickersListPosition.Custom) 3184 { 3185 @Render(settings.Stickers); 3186 } 3187 } 3188 @Render(settings.Image) 3189 </div> 3190 } 3191 </div> 3192 </div> 3193 3194 @if (!String.IsNullOrEmpty(settings.Title) || !String.IsNullOrEmpty(settings.Summary)) 3195 { 3196 <div class="grid__col-md-9"> 3197 @if (!String.IsNullOrEmpty(settings.Title)) 3198 { 3199 <h3 class="article-list__item-header u-truncate-text dw-mod">@settings.Title</h3> 3200 } 3201 @if (settings.Stickers != null) 3202 { 3203 if (settings.Stickers.Position == StickersListPosition.Custom) 3204 { 3205 @Render(settings.Stickers); 3206 } 3207 } 3208 @if (!String.IsNullOrEmpty(settings.SubTitle)) 3209 { 3210 <div class="article-list__item-micro-info u-truncate-text dw-mod">@settings.SubTitle</div> 3211 } 3212 @if (!String.IsNullOrEmpty(settings.Summary)) 3213 { 3214 <p class="article__short-summary dw-mod">@settings.Summary</p> 3215 } 3216 </div> 3217 } 3218 </div> 3219 </a> 3220 } 3221 3222 @helper RenderArticleListItemSimple(ArticleListItem settings) { 3223 <a href="@settings.Link" class="u-color-inherit"> 3224 <div class="grid u-color-light--bg u-no-padding dw-mod"> 3225 <div class="grid__col-md-12"> 3226 @if (!String.IsNullOrEmpty(settings.Title)) 3227 { 3228 <div class="article-list-item__header u-truncate-text u-no-margin dw-mod">@settings.Title</div> 3229 } 3230 @if (!String.IsNullOrEmpty(settings.SubTitle)) 3231 { 3232 <div class="article-list__item-micro-info u-truncate-text dw-mod">@settings.SubTitle</div> 3233 } 3234 </div> 3235 </div> 3236 </a> 3237 } 3238 @using System.Reflection 3239 @using Dynamicweb.Rapido.Blocks.Components.Articles 3240 3241 3242 @* Component for the articles *@ 3243 3244 @helper RenderArticleAuthorAndDate(ArticleAuthorAndDate settings) 3245 { 3246 <small class="article__subscription"> 3247 @if (!(string.IsNullOrWhiteSpace(settings.Author) && string.IsNullOrWhiteSpace(settings.Date))) 3248 { 3249 <text>@Translate("Written")</text> 3250 } 3251 @if (!string.IsNullOrWhiteSpace(settings.Author)) 3252 { 3253 <text>@Translate("by") @settings.Author</text> 3254 } 3255 @if (!string.IsNullOrWhiteSpace(settings.Date)) 3256 { 3257 <text>@Translate("on") @settings.Date</text> 3258 } 3259 </small> 3260 } 3261 @using System.Reflection 3262 @using Dynamicweb.Rapido.Blocks.Components.Articles 3263 @using Dynamicweb.Rapido.Blocks.Components.General 3264 3265 3266 @* Component for the articles *@ 3267 3268 @helper RenderArticleLink(ArticleLink settings) 3269 { 3270 if (!string.IsNullOrEmpty(settings.Title)) 3271 { 3272 Button link = new Button { 3273 ConfirmText = settings.ConfirmText, 3274 ConfirmTitle = settings.ConfirmTitle, 3275 ButtonType = settings.ButtonType, 3276 Id = settings.Id, 3277 Title = settings.Title, 3278 AltText = settings.AltText, 3279 OnClick = settings.OnClick, 3280 CssClass = settings.CssClass, 3281 Disabled = settings.Disabled, 3282 Icon = settings.Icon, 3283 Name = settings.Name, 3284 Href = settings.Href, 3285 ButtonLayout = settings.ButtonLayout, 3286 ExtraAttributes = settings.ExtraAttributes 3287 }; 3288 <div class="grid__cell"> 3289 @Render(link) 3290 </div> 3291 } 3292 } 3293 @using System.Reflection 3294 @using Dynamicweb.Rapido.Blocks 3295 @using Dynamicweb.Rapido.Blocks.Components.Articles 3296 @using Dynamicweb.Rapido.Blocks.Components.General 3297 3298 3299 @* Component for the articles *@ 3300 3301 @helper RenderArticleCarousel(ArticleCarousel settings) 3302 { 3303 <div class="grid"> 3304 <div class="grid__col-12 u-no-padding u-margin-bottom"> 3305 <div class="carousel" id="[email protected]"> 3306 <div class="carousel__container js-carousel-slides dw-mod"> 3307 @RenderBlockList(settings.SubBlocks) 3308 </div> 3309 </div> 3310 </div> 3311 </div> 3312 3313 <script> 3314 document.addEventListener("DOMContentLoaded", function () { 3315 new CarouselModule("#[email protected]", { 3316 slideTime: 0, 3317 dots: true 3318 }); 3319 }); 3320 </script> 3321 } 3322 3323 @helper RenderArticleCarouselSlide(ArticleCarouselSlide settings) 3324 { 3325 string imageEngine = "/Admin/Public/GetImage.ashx?"; 3326 3327 string defaultImage = settings.ImageSettings != null ? imageEngine : settings.Image; 3328 if (settings.ImageSettings != null) 3329 { 3330 defaultImage += settings.ImageSettings.Width != 0 ? "Width=" + settings.ImageSettings.Width + "&" : ""; 3331 defaultImage += settings.ImageSettings.Height != 0 ? "Height=" + settings.ImageSettings.Height + "&" : ""; 3332 defaultImage += "Crop=" + settings.ImageSettings.Crop + "&"; 3333 defaultImage += "Compression=" + settings.ImageSettings.Compression + "&"; 3334 defaultImage += "DoNotUpscale=" + settings.ImageSettings.DoNotUpscale.ToString() + "&"; 3335 defaultImage += "FillCanvas=" + settings.ImageSettings.FillCanvas.ToString() + "&"; 3336 } 3337 defaultImage += "&Image=" + settings.Image; 3338 3339 <div class="carousel__slide u-min-h300px u-flex dw-mod" style="background-size:cover; background-image:url('@defaultImage')"> 3340 <a class="article-carousel-item__wrap" href="@settings.Link" title="@settings.Title"> 3341 <h2 class="article-list__item-header u-truncate-text u-color-light dw-mod">@settings.Title</h2> 3342 <div class="article-list__item-info"> 3343 @if (settings.Stickers != null) 3344 { 3345 settings.Stickers.Position = StickersListPosition.Custom; 3346 @Render(settings.Stickers); 3347 } 3348 3349 <small class="u-margin-top--lg u-color-light"> 3350 @if (!(string.IsNullOrWhiteSpace(settings.Author) && string.IsNullOrWhiteSpace(settings.Date))) 3351 { 3352 <text>@Translate("Written")</text> 3353 } 3354 @if (!string.IsNullOrWhiteSpace(settings.Author)) 3355 { 3356 <text>@Translate("by") @settings.Author</text> 3357 } 3358 @if (!string.IsNullOrWhiteSpace(settings.Date)) 3359 { 3360 <text>@Translate("on") @settings.Date</text> 3361 } 3362 </small> 3363 </div> 3364 3365 <h3 class="article__short-summary u-color-light">@settings.Summary</h3> 3366 </a> 3367 @if (settings.UseFilters == true) 3368 { 3369 <div class="background-image image-filter image-filter--darken dw-mod"></div> 3370 } 3371 </div> 3372 } 3373 @using System.Text.RegularExpressions 3374 @using Dynamicweb.Rapido.Blocks.Components 3375 @using Dynamicweb.Rapido.Blocks.Components.General 3376 @using Dynamicweb.Rapido.Blocks.Components.Articles 3377 @using Dynamicweb.Rapido.Blocks 3378 3379 @* Component for the articles *@ 3380 3381 @helper RenderArticleVideo(ArticleVideo settings) 3382 { 3383 if (settings.Url != null) 3384 { 3385 //getting video ID from youtube URL 3386 string videoCode = settings.Url; 3387 Regex regex = new Regex(@".be\/(.[^?]*)"); 3388 Match match = regex.Match(videoCode); 3389 string videoId = ""; 3390 if (match.Success) 3391 { 3392 videoId = match.Groups[1].Value; 3393 } 3394 else 3395 { 3396 regex = new Regex(@"v=([^&]+)"); 3397 match = regex.Match(videoCode); 3398 if (match.Success) 3399 { 3400 videoId = match.Groups[1].Value; 3401 } 3402 } 3403 3404 int autoPlay = settings.AutoPlay == "true" ? 1 : 0; 3405 3406 <div class="video-wrapper"> 3407 <div class="js-youtube-video" data-video="@videoId" id="ytPlayer@(Guid.NewGuid().ToString("N"))" data-auto-play="@autoPlay" data-enable-controls="1"></div> 3408 </div> 3409 } 3410 } 3411 3412 3413 3414 @* Simple helpers *@ 3415 3416 @*Requires the Gallery ItemType that comes with Rapido*@ 3417 @helper RenderArticleItemGallery(IList<ItemViewModel> gallery) { 3418 if (gallery != null && gallery.Count > 0) 3419 { 3420 int count = 1; 3421 3422 foreach (var item in gallery) 3423 { 3424 if (item.GetFile("ImagePath") != null) 3425 { 3426 string image = item.GetFile("ImagePath").PathUrlEncoded; 3427 string imagePrefix = "/Admin/Public/GetImage.ashx?width=1200&amp;height=820&amp;crop=5&amp;Compression=75&amp;DoNotUpscale=1&amp;image="; 3428 int imagesCount = gallery.Count; 3429 3430 if (count == 1) 3431 { 3432 <label class="gallery" for="ParagraphGalleryModalTrigger" onclick="Gallery.openImage(this.querySelector('.js-gallery'))"> 3433 <span class="gallery__main-image"> 3434 <img src="/Files/Images/placeholder.gif" data-src="/Admin/Public/GetImage.ashx?width=992&amp;height=760&amp;crop=0&amp;Compression=75&amp;DoNotUpscale=1&amp;image=@image" class="b-lazy flex-img js-gallery" alt="" data-for="ParagraphGallery" data-image="@imagePrefix@image" /> 3435 </span> 3436 <span class="gallery__image-counter"> 3437 <i class="fas fa-camera fa-2x"></i> <span class="gallery__image-counter__number">@imagesCount</span> 3438 <span class="gallery__image-counter__text">@Translate("See all") <i class="fas fa-angle-right"></i></span> 3439 </span> 3440 </label> 3441 } 3442 else 3443 { 3444 <div class="u-hidden js-gallery" data-for="ParagraphGallery" data-image="@imagePrefix@image"></div> 3445 } 3446 3447 count++; 3448 } 3449 } 3450 3451 @Render(new ArticleGalleryModal()) 3452 } 3453 } 3454 3455 @helper RenderMobileFilters(List<Block> subBlocks) 3456 { 3457 if (subBlocks.Count > 0) 3458 { 3459 <div class="grid__col-12"> 3460 <input type="checkbox" id="CheckFilters" class="js-remember-state u-hidden" data-expand="CheckFilters" /> 3461 <div class="grid u-margin-bottom dw-mod" data-trigger="CheckFilters"> 3462 @RenderBlockList(subBlocks) 3463 </div> 3464 <label for="CheckFilters" class="btn btn--secondary btn--full dw-mod js-expand-hide" data-trigger="CheckFilters">@Translate("Select filters")</label> 3465 <label for="CheckFilters" class="btn btn--secondary btn--full dw-mod expandable--collapsed" data-trigger="CheckFilters">@Translate("Close filters")</label> 3466 </div> 3467 } 3468 }