Error executing template "/Designs/Rapido/Paragraph/PIMFiles.cshtml"
System.ArgumentException: The requested block ID can not be found
Parameter name: TopNavigation
   at Dynamicweb.Rapido.Blocks.BlocksPage.GetBlockListById(String childId)
   at CompiledRazorTemplates.Dynamic.RazorEngine_43defb0ffeb24a0b8e5d828bca6769c6.Execute() in f:\Domains\Sites\asibrake.com\Files\Templates\Designs\Rapido\Paragraph\PIMFiles.cshtml:line 383
   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.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> @using Dynamicweb.Frontend.Devices @using Dynamicweb.Extensibility @using Dynamicweb.Content @using Dynamicweb.Core @using System @using System.IO @using System.Web @using System.Collections.Generic; @using System.Linq @using System.Text.RegularExpressions @using Dynamicweb.Rapido.Blocks @using Dynamicweb.Rapido.Blocks.Components.General @functions { BlocksPage filesPage = BlocksPage.GetBlockPage("FilesList"); } @{ Block pageContainer = new Block() { Id = "PageContainer", Template = RenderPageContainer(), SortId = 20 }; filesPage.Add(pageContainer); Block filesScript = new Block() { Id = "ScriptTemplates", SortId = 30, BlocksList = new List<Block> { new Block() { Id = "FilesContainerScript", SortId = 10, Template = RenderFilesContainerScript(), SkipRenderBlocksList = true, BlocksList = new List<Block> { new Block() { Id = "LeftNavigation", SortId = 10, Design = new Design { RenderType = RenderType.Column, Size = "3" } }, new Block() { Id = "FilesList", SortId = 20, Design = new Design { RenderType = RenderType.Column, Size = "auto" }, BlocksList = new List<Block> { new Block() { Id = "Top", SortId = 10 }, new Block() { Id = "Files", SortId = 20, Template = RenderFiles() }, new Block() { Id = "LoadMoreRow", SortId = 30, Design = new Design { RenderType = RenderType.Row }, BlocksList = new List<Block> { new Block() { Id = "LoadMore", SortId = 10, Design = new Design { RenderType = RenderType.Column, Size = "12" }, Template = RenderLoadMore() } } } } } } }, new Block() { Id = "preRenderTemplate", Template = RenderPreRenderTemplate() }, new Block() { Id = "PIMJavascript", Template = RenderJavascript() } } }; filesPage.Add(filesScript); } @using Dynamicweb.Rapido.Blocks; @using Dynamicweb.Rapido.Blocks.Components.General; @functions { BlocksPage downloadModalPage = BlocksPage.GetBlockPage("FilesList"); } @{ Block downloadModal = new Block() { Id = "DownloadModal", Component = new Modal { Id = "Download", Width = ModalWidth.Sm, Heading = new Heading { Title = Translate("Download"), Level = 2 }, BodyTemplate = RenderDownloadModal() } }; downloadModalPage.Add(downloadModal); } @helper RenderDownloadModal() { int exportPageId = GetPageIdByNavigationTag("PIMAssetExport"); Form downloadForm = new Form { Action = "/Default.aspx?ID=" + exportPageId, Method = FormMethod.Post, CssClass = "u-no-margin" }; downloadForm.Add(new HiddenField { Id = "assetPath", Name = "assetPath" }); downloadForm.Add(new HiddenField { Id = "siteUrl", Name = "siteUrl", Value = string.Format("{0}://{1}", GetGlobalValue("Global:Request.Scheme"), GetGlobalValue("Global:Request.Host")) }); SelectField purposeSelect = new SelectField { Id = "purpose", Name = "purpose", Label = Translate("Purpose"), CssClass = "u-full-width", Options = new List<SelectFieldOption> { new SelectFieldOption { Value = "Office", Label = Translate("Office") }, new SelectFieldOption { Value = "Original", Label = Translate("Original") }, new SelectFieldOption { Value = "Print", Label = Translate("Print") }, new SelectFieldOption { Value = "Web", Label = Translate("Web") } } }; downloadForm.Add(purposeSelect); downloadForm.Add(new Button { ButtonType = ButtonType.Submit, Title = Translate("Export asset"), CssClass = "u-pull--right" }); @Render(downloadForm) } @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> @using Dynamicweb.Rapido.Blocks @using Dynamicweb.Rapido.Blocks.Components.General @functions { BlocksPage imageModalPage = BlocksPage.GetBlockPage("FilesList"); } @{ Block imageModal = new Block() { Id = "ImageModal", Template = RenderImageModal() }; imageModalPage.Add(imageModal); Block imageModalTemplates = new Block() { Id = "imageModalTemplates", Template = RenderImageModalTemplates() }; imageModalPage.Add("ScriptTemplates", imageModalTemplates); Block imageModalScripts = new Block() { Id = "imageModalScripts", Template = RenderImageModalScripts() }; imageModalPage.Add("ScriptTemplates", imageModalScripts); } @helper RenderImageModal() { <!-- Trigger for the gallery modal --> <input type="checkbox" id="PreviewModalTrigger" class="modal-trigger" /> <!-- Gallery modal --> <div class="modal-container"> <label for="PreviewModalTrigger" id="PreviewModalOverlay" class="modal-overlay"></label> <div class="modal modal--full-width" id="PreviewModal"> <div class="modal__body modal__body--file-preview"> <div class="grid"> <div class="grid__col-md-6 grid--align-center"> @Render(new Image { Id = "PreviewImage", CssClass = "js-gallery-image modal__image--file-preview", DisableLazyLoad = true, Path = "" }) </div> <div class="grid__col-md-6"> <div id="ImageMetadataContainer" data-template="FileInformationTemplate"></div> </div> </div> <label class="modal__close-btn" for="PreviewModalTrigger"></label> </div> </div> </div> } @helper RenderImageModalTemplates() { <script id="ImageMetadataItemTemplate" type="text/x-template"> {{#.}} <tr> <th>{{Key}}</th> <td class="u-ta-left"><span id="Value">{{Value}}</span></td> </tr> {{/.}} </script> <script id="FileInformationTemplate" type="text/x-template"> <div class="tabs dw-mod"> <input type="radio" class="tabs__trigger" name="imageInfoTabs" id="FileInformation" checked=""> {{#if IPTC.length}} <input type="radio" class="tabs__trigger" name="imageInfoTabs" id="IPTC"> {{/if}} {{#if XMP.length}} <input type="radio" class="tabs__trigger" name="imageInfoTabs" id="XMP"> {{/if}} {{#if EXIF.length}} <input type="radio" class="tabs__trigger" name="imageInfoTabs" id="EXIF"> {{/if}} <div class="tabs__list dw-mod"> <label for="FileInformation" class="tabs__label dw-mod">File information</label> {{#if IPTC.length}} <label for="IPTC" class="tabs__label dw-mod">IPTC</label> {{/if}} {{#if XMP.length}} <label for="XMP" class="tabs__label dw-mod">XMP</label> {{/if}} {{#if EXIF.length}} <label for="EXIF" class="tabs__label dw-mod">EXIF</label> {{/if}} </div> <div class="tabs__blocks dw-mod"> <div class="tabs__block dw-mod" data-title="File information"> <div class="u-padding u-border-top"> <table class="table table--clean table--compact"> {{#ImageData}} {{>ImageMetadataItemTemplate}} {{/ImageData}} </table> {{#if DynamicwebMetadata.length}} <h3>Custom metadata (Dynamicweb metadata)</h3> <table class="table table--clean table--compact"> {{#DynamicwebMetadata}} {{>ImageMetadataItemTemplate}} {{/DynamicwebMetadata}} </table> {{/if}} </div> </div> {{#if IPTC.length}} <div class="tabs__block dw-mod" data-title="IPTC"> <div class="u-padding u-border-top"> <table class="table table--clean table--compact"> {{#IPTC}} {{>ImageMetadataItemTemplate}} {{/IPTC}} </table> </div> </div> {{/if}} {{#if XMP.length}} <div class="tabs__block dw-mod" data-title="XMP"> <div class="u-padding u-border-top"> <table class="table table--clean table--compact"> {{#XMP}} {{>ImageMetadataItemTemplate}} {{/XMP}} </table> </div> </div> {{/if}} {{#if EXIF.length}} <div class="tabs__block dw-mod" data-title="EXIF"> <div class="u-padding u-border-top"> <table class="table table--clean table--compact"> {{#EXIF}} {{>ImageMetadataItemTemplate}} {{/EXIF}} </table> </div> </div> {{/if}} </div> </div> </script> } @helper RenderImageModalScripts() { <script> function getPreview(fileId) { let file = handlebarsBoltCache.Files.find((file) => (file.id == fileId)); var previewImage = document.getElementById("PreviewImage"); previewImage.classList.remove('u-w220px'); if (file.icon) { previewImage.src = file.icon; previewImage.classList.add('u-w220px'); } else { previewImage.src = "/Admin/Public/GetImage.ashx?Width=900&Compression=75&image=/" + file.path; } previewImage.alt = file.name; HandlebarsBolt.CreateItemsFromJson(JSON.parse(file.fileInfo), 'ImageMetadataContainer'); } </script> } @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> @using Dynamicweb.Rapido.Blocks @using Dynamicweb.Rapido.Blocks.Components.General @functions { BlocksPage facetsPage = BlocksPage.GetBlockPage("FilesList"); } @{ string facetsBlockViewMode = !string.IsNullOrEmpty(Pageview.AreaSettings.GetItem("ProductList").GetString("FacetsViewMode")) ? Pageview.AreaSettings.GetItem("ProductList").GetString("FacetsViewMode").ToLower() : "left"; Block leftFacets = new Block() { Id = "LeftFacets", Template = RenderLeftFacets() }; Block topFacets = new Block() { Id = "TopFacets", Template = RenderTopFacets() }; if (facetsBlockViewMode == "left") { facetsPage.GetBlockListById("LeftNavigation").Add(leftFacets); } else { facetsPage.GetBlockListById("TopNavigation").Add(topFacets); } Block facetSelection = new Block() { Id = "FacetSelection", Template = RenderFacetSelection() }; facetsPage.GetBlockListById("Top").Add(facetSelection); Block facetSelectionTemplates = new Block() { Id = "FacetSelectionTemplates", Template = RenderFacetSelectionTemplates() }; facetSelection.SortId = 30; facetsPage.Add("ScriptTemplates", facetSelectionTemplates); } @helper RenderLeftFacets() { <div class="u-margin-bottom--lg"> @Render(new Heading { Level = 2, Title = Translate("Filters"), CssClass = "u-no-margin" }) </div> <input type="checkbox" id="CheckFacetGroups" class="js-remember-state u-hidden" data-expand="CheckFacetGroups" /> <div class="facets-container facets-container--left expandable--collapsed dw-mod" data-trigger="CheckFacetGroups"> {{#FacetGroups}} <input type="checkbox" id="OptionsGroup_{{name}}" class="expand-trigger js-remember-state" {{defaultState}} /> <div class="expand-container facets-container__box dw-mod js-filter"> <label class="expand-container__btn facets-container__header dw-mod" for="OptionsGroup_{{name}}">{{name}}</label> <div class="expand-container__content dw-mod"> <div class="u-margin {{showFilter}}"> <input type="text" class="u-full-width u-no-margin" onkeyup="Filter.FilterItems(event)" placeholder="@Translate("Search")" /> </div> <div class="facets-container__list dw-mod"> {{#FacetOptions}} {{#ifCond template "===" "Checkboxes"}} {{>Checkboxes}} {{/ifCond}} {{#ifCond template "===" "Range"}} {{>Checkboxes}} {{/ifCond}} {{#ifCond template "===" "Weight"}} {{>Checkboxes}} {{/ifCond}} {{#ifCond template "===" "Tags"}} {{>Tags}} {{/ifCond}} {{#ifCond template "===" "Colors"}} {{>Colors}} {{/ifCond}} {{/FacetOptions}} <div class="u-hidden js-filter-not-found"> @Translate("Your search gave 0 results") </div> </div> </div> </div> {{/FacetGroups}} </div> <label for="CheckFacetGroups" class="btn btn--primary btn--full dw-mod js-expand-hide facets-container-trigger" data-trigger="CheckFacetGroups">@Translate("Select filters")</label> <label for="CheckFacetGroups" class="btn btn--primary btn--full dw-mod expandable--collapsed facets-container-trigger" data-trigger="CheckFacetGroups">@Translate("Close filters")</label> } @helper RenderTopFacets() { <input type="checkbox" id="CheckFacetGroups" class="js-remember-state u-hidden" data-expand="CheckFacetGroups" /> <div class="grid grid--external-bleed-x dw-mod expandable--collapsed facets-container facets-container--top" data-trigger="CheckFacetGroups"> {{#FacetGroups}} <div class="grid__col-lg-3 grid__col-md-3 grid__col-sm-4 grid__col-xs-12"> <input type="checkbox" id="OptionsGroup_{{counter}}" class="dropdown-trigger" /> <div class="dropdown dw-mod js-filter"> <label class="dropdown__header dropdown__btn dw-mod" for="OptionsGroup_{{counter}}">{{name}}</label> <div class="dropdown__content dropdown__content--padding dw-mod"> <div class="u-margin-bottom {{showFilter}}"> <input type="text" class="u-full-width u-no-margin" onkeyup="Filter.FilterItems(event)" placeholder="@Translate("Search")" /> </div> {{#FacetOptions}} {{#ifCond template "===" "Checkboxes"}} {{>Checkboxes}} {{/ifCond}} {{#ifCond template "===" "Range"}} {{>Checkboxes}} {{/ifCond}} {{#ifCond template "===" "Weight"}} {{>Checkboxes}} {{/ifCond}} {{#ifCond template "===" "Tags"}} {{>Tags}} {{/ifCond}} {{#ifCond template "===" "Colors"}} {{>Colors}} {{/ifCond}} {{/FacetOptions}} <div class="u-hidden js-filter-not-found"> @Translate("Your search gave 0 results") </div> </div> <label class="dropdown-trigger-off" for="OptionsGroup_{{counter}}"></label> </div> </div> {{/FacetGroups}} </div> <label for="CheckFacetGroups" class="btn btn--primary btn--full dw-mod js-expand-hide facets-container-trigger" data-trigger="CheckFacetGroups">@Translate("Select filters")</label> <label for="CheckFacetGroups" class="btn btn--primary btn--full dw-mod expandable--collapsed facets-container-trigger" data-trigger="CheckFacetGroups">@Translate("Close filters")</label> } @helper RenderFacetSelection() { <text> {{#if FacetSelections}} <div class="buttons-collection u-margin-bottom" id="selectedFacets"> {{#FacetSelections}} {{>(lookup . 'template')}} {{/FacetSelections}} </div> {{/if}} </text> } @helper RenderFacetSelectionTemplates() { @*Facets*@ <script id="Checkboxes" type="text/x-template"> <input type="checkbox" class="{{selected}} checkbox-facet__checkbox form__control dw-mod" onclick="Facets.UpdateFacets(this);" id="{{queryParameter}}{{value}}" name="{{queryParameter}}" value="[{{value}}]" {{selected}} {{disabled}}> <label class="{{disabled}} checkbox-facet dw-mod" data-filter-value="{{label}}" for="{{queryParameter}}{{value}}"> <span class="checkbox-facet__label dw-mod">{{label}}</span> <span class="checkbox-facet__count dw-mod">({{count}})</span> </label> </script> <script id="Tags" type="text/x-template"> <button type="button" class="btn btn--tag {{selected}} {{disabled}}" data-filter-value="{{label}}" data-check="{{selected}}" onclick="Facets.UpdateFacets(this);" name="{{queryParameter}}" value="[{{value}}]" {{disabled}}> {{label}} <span class="facets-group__counter">({{count}})</span> </button> </script> <script id="Colors" type="text/x-template"> <button type="button" class="btn btn--colorbox u-margin-right {{selected}} {{disabled}}" data-filter-value="{{label}}" style="background-color: {{value}}" title="{{label}}" data-check="{{selected}}" onclick="Facets.UpdateFacets(this);" name="{{queryParameter}}" value="[{{value}}]" {{disabled}}></button> </script> @*Facet selections*@ <script id="SelectedFilter" type="text/x-template"> <button type="button" class="btn btn--tag" data-check="checked" onclick="Facets.UpdateFacets(this);" name="{{queryParameter}}" value="[{{value}}]" title="@Translate("Remove filter")"> {{group}}: {{label}} <i class="fas fa-times"></i> </button> </script> <script id="SelectedColorFilter" type="text/x-template"> <button type="button" class="btn btn--tag" data-check="checked" onclick="Facets.UpdateFacets(this);" name="{{queryParameter}}" value="[{{value}}]" title="@Translate("Remove filter")"> {{group}}: <div class="btn__colorbox" style="background-color: {{label}}"></div> <i class="fas fa-times"></i> </button> </script> <script id="ResetFilters" type="text/x-template"> <button type="button" class="btn btn--tag" onclick="Facets.ResetFacets();"> @Translate("Reset all filters") <i class="fas fa-redo"></i> </button> </script> } @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> @using Dynamicweb.Rapido.Blocks @using Dynamicweb.Rapido.Blocks.Components.General @functions { BlocksPage topNavigationPage = BlocksPage.GetBlockPage("FilesList"); } @{ Block topNavigation = new Block() { Id = "TopNavigation", SortId = 10, Template = RenderTopNavigation() }; topNavigationPage.GetBlockListById("Top").Add(topNavigation); Block listViewSelectListener = new Block() { Id = "ListViewSelectListener", Template = RenderListViewSelectListener() }; topNavigationPage.Add("ScriptTemplates", listViewSelectListener); Block searchTemplates = new Block() { Id = "SearchTemplates", Template = RenderSearchTemplates() }; topNavigationPage.Add("ScriptTemplates", searchTemplates); } @helper RenderTopNavigation() { int feedPageId = GetPageIdByNavigationTag("FilesFeed"); <div class="grid__cell"> <div class="u-pull--left"> <div class="u-margin-bottom--lg"> @Render(new Heading { Level = 2, Title = Translate("Files found") + ": {{filesCount}}", CssClass = "u-no-margin" }) </div> </div> <div class="grid__col--bleed grid__col-6 u-pull--right"> <div class="grid__cell"> <div class="collection u-no-margin u-pull--right"> <input type="radio" class="tag-btn-trigger" id="ListViewBtn_FileItemContainer" name="ViewBtnGroup"> <label for="ListViewBtn_FileItemContainer" class="btn btn--tag btn--sm u-no-margin" onclick="HandlebarsBolt.UpdateTemplate('Files', 'FileItemContainer')"><i class="fas fa-th-list"></i></label> <input type="radio" class="tag-btn-trigger" id="ListViewBtn_FileGridItemContainer" name="ViewBtnGroup"> <label for="ListViewBtn_FileGridItemContainer" class="btn btn--tag btn--sm u-no-margin" onclick="HandlebarsBolt.UpdateTemplate('Files', 'FileGridItemContainer')"><i class="fas fa-th"></i></label> <input type="radio" class="tag-btn-trigger" id="ListViewBtn_FileDetailsItemContainer" name="ViewBtnGroup"> <label for="ListViewBtn_FileDetailsItemContainer" class="btn btn--tag btn--sm u-no-margin" onclick="HandlebarsBolt.UpdateTemplate('Files', 'FileDetailsItemContainer')"><i class="fas fa-list"></i></label> </div> @RenderSearch() </div> </div> </div> } @helper RenderSearch() { int filesFeedPageId = GetPageIdByNavigationTag("FilesFeed"); string filesSearchPageId = filesFeedPageId + "&LayoutTemplate=Json.cshtml&DisableStatistics=True"; string filesPageId = GetGlobalValue("Global:Page.ID"); string searchPlaceholder = Translate("Search files"); string searchValue = HttpContext.Current.Request.QueryString.Get("Search") ?? ""; <div class="typeahead u-color-inherit js-typeahead u-margin-bottom u-pull--right u-w220px u-margin-right" data-page-size="10" id="FilesSearch" data-search-feed-id="@filesSearchPageId" data-result-page-id="@filesPageId"> <input type="text" class="typeahead-search-field u-no-margin u-full-width js-typeahead-search-field" placeholder="@searchPlaceholder" value="@searchValue"> <ul class="dropdown dropdown--absolute-position u-full-width js-handlebars-root js-typeahead-search-content u-min-w220px u-full-width dw-mod" id="FilesSearchContent" data-template="SearchContentTemplate" data-json-feed="/Default.aspx?ID=@filesSearchPageId" data-init-onload="false" data-preloader="minimal"></ul> <button type="button" class="btn btn--condensed btn--primary u-no-margin dw-mod js-typeahead-enter-btn"><i class="fas fa-search"></i></button> </div> } @helper RenderSearchTemplates() { @* Templates for Typeahead *@ <script id="SearchGroupsTemplate" type="text/x-template"> {{#.}} <li class="dropdown__item dw-mod" onclick="Search.UpdateGroupSelection(this)" data-group-id="{{id}}">{{name}}</li> {{/.}} </script> <script id="SearchContentTemplate" type="text/x-template"> {{#.}} {{#ifCond template "!==" "SearchMore"}} <li class="dropdown__item dw-mod"> <div onclick="getPreview('{{id}}'); document.getElementById('PreviewModalTrigger').checked=true"> <div class="u-margin-right u-pull--left u-hidden-xs u-hidden-xxs"> <img src="/Admin/Public/GetImage.ashx?width=45&height=38&crop=1&Compression=75&image={{path}}" alt="{{name}}"> </div> <div class="u-pull--left"> <div class="u-bold u-max-w220px u-truncate-text js-typeahead-name">{{name}}</div> <div class="item-number u-max-w300px dw-mod">{{path}}</div> </div> </div> <div class="u-margin-left u-pull--right"> <button type="button" class="btn btn--primary btn--condensed u-pull--right dw-mod u-no-margin js-ignore-click-outside" onclick="addFileToDownloads('{{path}}');"> <i class="fas fa-upload"></i> </button> </div> </li> {{/ifCond}} {{#ifCond template "===" "SearchMore"}} {{>SearchMore}} {{/ifCond}} {{/.}} {{^.}} <li class="dropdown__item dropdown__item--seperator dropdown__item--not-selectable js-no-result dw-mod"> @Translate("Your search gave 0 results") </li> {{/.}} </script> <script id="SearchMore" type="text/x-template"> <li class="dropdown__item dropdown__item--not-selectable dw-mod"> <a href="/Default.aspx?ID=@GetGlobalValue("Global:Page.ID")&Search={{searchParameter}}" class="btn btn--primary btn--full u-no-margin dw-mod js-typeahead-link"> @Translate("View all") </a> </li> </script> <script id="SearchEmpty" type="text/x-template"> <li class="u-margin u-padding-left"> @Translate("Your search gave 0 results") </li> </script> } @helper RenderListViewSelectListener() { <script> let defaultTemplate = 'FileItemContainer'; let container = 'FilesListContainer'; let cookieName = 'FilesTemplate'; document.addEventListener('DOMContentLoaded', function (event) { document.getElementById(container).addEventListener('contentLoaded', function () { let selectedMode = RememberState.GetCookie(cookieName); let element = document.getElementById('ListViewBtn_' + (selectedMode != null ? selectedMode : defaultTemplate)); if (element != null) { element.checked = true; } }, false); }); </script> } @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> @using Dynamicweb.Rapido.Blocks @using Dynamicweb.Rapido.Blocks.Components.General @functions { BlocksPage viewGridPage = BlocksPage.GetBlockPage("FilesList"); } @{ Block gridViewTemplate = new Block() { Id = "GridViewTemplate", Template = RenderGridViewTemplate() }; viewGridPage.Add("ScriptTemplates", gridViewTemplate); } @helper RenderGridViewTemplate() { @* Grid view *@ <script id="FileGridItemContainer" type="text/x-template"> {{#.}} <div id="File{{id}}" class="grid__col-lg-4 grid__col-md-4 grid__col-sm-4 grid__col-xs-6 product-list__grid-item dw-mod"> <div class="grid__cell product-list__grid-item__image dw-mod"> <label for="PreviewModalTrigger" onclick="getPreview('{{id}}')" {{#if icon}}class="u-padding--lg"{{/if}}> {{#if icon}} @Render(new Image { Path = "{{icon}}", Title = "{{name}}", CssClass = "grid__cell-img--centered u-padding--lg" }) {{else}} @Render(new Image { Path = "{{path}}", Title = "{{name}}", CssClass = "grid__cell-img--centered u-padding", ImageDefault = new ImageSettings { Width = 300, Height = 300, Crop = 5, FillCanvas = true } }) {{/if}} </label> </div> <div class="grid__cell product-list__grid-item__price-info dw-mod"> <h6 class="u-condensed-text"> <label for="PreviewModalTrigger" onclick="getPreview('{{id}}')">{{name}}</label> </h6> <div class="item-number u-margin-bottom dw-mod">{{path}}</div> </div> @if (Pageview.User != null) { <div class="product-list__grid-item__footer dw-mod"> @Render(new Button { ButtonType = ButtonType.Button, ButtonLayout = ButtonLayout.Primary, OnClick = "addFileToDownloads('{{path}}');", CssClass = "u-no-margin btn--condensed u-no-margin u-pull--right", Icon = new Icon { Prefix = "fas", Name = "fa-download", LabelPosition = IconLabelPosition.After } }) </div> } </div> {{/.}} </script> } @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> @using Dynamicweb.Rapido.Blocks @using Dynamicweb.Rapido.Blocks.Components.General @functions { BlocksPage viewDetailsPage = BlocksPage.GetBlockPage("FilesList"); } @{ Block detailsViewTemplate = new Block() { Id = "DetailsViewTemplate", Template = RenderDetailsViewTemplate() }; viewDetailsPage.Add("ScriptTemplates", detailsViewTemplate); } @helper RenderDetailsViewTemplate() { @* Details view *@ <script id="FileDetailsItemContainer" type="text/x-template"> {{#.}} <div id="File{{id}}" class="grid__col-12 u-no-padding-y"> <div class="product-list__details-item grid__col-12 grid--direction-row grid--align-center dw-mod"> <div class="product-list__details-item__left grid__cell dw-mod"> <div class="lightbox u-hidden-xxs"> <label for="PreviewModalTrigger" onclick="getPreview('{{id}}')"> {{#if icon}} @Render(new Image { Path = "{{icon}}", Title = "{{name}}", CssClass = "u-w50px u-margin-right" }) {{else}} @Render(new Image { Path = "{{path}}", Title = "{{name}}", CssClass = "lightbox__image", ImageDefault = new ImageSettings { Width = 220, Height = 222, Crop = 5, FillCanvas = true }, DisableLazyLoad = true }) @Render(new Image { Path = "{{path}}", Title = "{{name}}", CssClass = "u-margin-right", ImageDefault = new ImageSettings { Width = 50, Height = 50, Crop = 5, FillCanvas = true } }) {{/if}} </label> </div> <div class="u-margin-left u-margin-right"> <h6 class="u-no-margin"> <label for="PreviewModalTrigger" onclick="getPreview('{{id}}')">{{name}}</label> </h6> <div class="item-number dw-mod">{{path}}</div> </div> </div> <div class="product-list__details-item__right grid__cell dw-mod"> @if (Pageview.User != null) { @Render(new Button { ButtonType = ButtonType.Button, ButtonLayout = ButtonLayout.Primary, OnClick = "addFileToDownloads('{{path}}');", CssClass = "u-no-margin btn--condensed u-margin-left u-margin-right", Icon = new Icon { Prefix = "fas", Name = "fa-download", LabelPosition = IconLabelPosition.After } }) } </div> </div> </div> {{/.}} </script> } @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> @using Dynamicweb.Rapido.Blocks @using Dynamicweb.Rapido.Blocks.Components.General @functions { BlocksPage viewListPage = BlocksPage.GetBlockPage("FilesList"); } @{ Block listViewTemplate = new Block() { Id = "ListViewTemplate", Template = RenderListViewTemplate() }; viewListPage.Add("ScriptTemplates", listViewTemplate); } @helper RenderListViewTemplate() { @* List view *@ <script id="FileItemContainer" type="text/x-template"> {{#.}} <div id="File{{id}}" class="grid__col-12 dw-mod"> <div class="grid product-list__list-item dw-mod"> <div class="grid__col-md-4 {{noImage}} product-list__list-item__left u-no-padding u-color-light--bg dw-mod"> <div class="grid__cell"> <label for="PreviewModalTrigger" onclick="getPreview('{{id}}')" class="u-flex u-full-height"> {{#if icon}} @Render(new Image { Path = "{{icon}}", Title = "{{name}}", CssClass = "grid__cell-img--centered u-padding--lg" }) {{else}} @Render(new Image { Path = "{{path}}", Title = "{{name}}", CssClass = "grid__cell-img--centered u-padding", ImageDefault = new ImageSettings { Width = 300, Height = 300, Crop = 5, FillCanvas = true } }) {{/if}} </label> </div> </div> <div class="grid__col-md-auto product-list__list-item__right dw-mod"> <div class="grid__cell"> <h2 class="u-no-margin"> <label for="PreviewModalTrigger" onclick="getPreview('{{id}}')">{{name}}</label> </h2> <div class="item-number dw-mod">{{path}}</div> <ul class="list list--clean u-margin-top dw-mod"> <li><strong>@Translate("Updated"):</strong> {{lastWriteTime}}</li> <li><strong>@Translate("File size"):</strong> {{size}} KB</li> <li><strong>@Translate("File type"):</strong> {{extension}}</li> {{#if dimension}} <li><strong>@Translate("Dimension"):</strong> {{dimension}}</li> {{/if}} {{#if colors}} <li><strong>@Translate("Colors"):</strong> {{colors}}</li> {{/if}} </ul> </div> @if (Pageview.User != null) { <div class="grid__cell-footer"> <div class="grid__cell"> @Render(new Button { ButtonType = ButtonType.Button, ButtonLayout = ButtonLayout.Primary, OnClick = "addFileToDownloads('{{path}}');", CssClass = "u-no-margin btn--condensed u-no-margin u-pull--right", Icon = new Icon { Prefix = "fas", Name = "fa-download", LabelPosition = IconLabelPosition.After } }) </div> </div> } </div> </div> </div> {{/.}} </script> } @* Include the required Grid builder (Contains the methods @RenderBlockList and @RenderBlock) *@ @using System.Text.RegularExpressions @using System.Collections.Generic @using System.Reflection @using System.Web @using System.Web.UI.HtmlControls @using Dynamicweb.Rapido.Blocks.Components @using Dynamicweb.Rapido.Blocks.Components.Articles @using Dynamicweb.Rapido.Blocks.Components.Documentation @using Dynamicweb.Rapido.Blocks @*--- START: Base block renderers ---*@ @helper RenderBlockList(List<Block> blocks) { bool debug = !String.IsNullOrEmpty(HttpContext.Current.Request.QueryString.Get("debug")) ? Convert.ToBoolean(HttpContext.Current.Request.QueryString.Get("debug")) : false; blocks = blocks.OrderBy(item => item.SortId).ToList(); foreach (Block item in blocks) { if (debug) { <!-- Block START: @item.Id --> } if (item.Design == null) { @RenderBlock(item) } else if (item.Design.RenderType == RenderType.None) { string cssClass = item.Design.CssClass != null ? item.Design.CssClass : ""; <div class="@cssClass dw-mod"> @RenderBlock(item) </div> } else if (item.Design.RenderType != RenderType.Hide) { string cssClass = item.Design.CssClass != null ? item.Design.CssClass : ""; if (!item.SkipRenderBlocksList) { if (item.Design.RenderType == RenderType.Row) { <div class="grid grid--align-content-start @cssClass dw-mod" id="Block__@item.Id"> @RenderBlock(item) </div> } if (item.Design.RenderType == RenderType.Column) { string hidePadding = item.Design.HidePadding ? "u-no-padding" : ""; string size = item.Design.Size ?? "12"; size = Regex.IsMatch(size, @"\d") ? "md-" + item.Design.Size : item.Design.Size; <div class="grid__col-lg-@item.Design.Size grid__col-md-@item.Design.Size grid__col-sm-12 grid__col-xs-12 @hidePadding @cssClass dw-mod" id="Block__@item.Id"> @RenderBlock(item) </div> } if (item.Design.RenderType == RenderType.Table) { <table class="table @cssClass dw-mod" id="Block__@item.Id"> @RenderBlock(item) </table> } if (item.Design.RenderType == RenderType.TableRow) { <tr class="@cssClass dw-mod" id="Block__@item.Id"> @RenderBlock(item) </tr> } if (item.Design.RenderType == RenderType.TableColumn) { <td class="@cssClass dw-mod" id="Block__@item.Id"> @RenderBlock(item) </td> } if (item.Design.RenderType == RenderType.CardHeader) { <div class="card-header @cssClass dw-mod"> @RenderBlock(item) </div> } if (item.Design.RenderType == RenderType.CardBody) { <div class="card @cssClass dw-mod"> @RenderBlock(item) </div> } if (item.Design.RenderType == RenderType.CardFooter) { <div class="card-footer @cssClass dw-mod"> @RenderBlock(item) </div> } } else { @RenderBlock(item) } } if (debug) { <!-- Block END: @item.Id --> } } } @helper RenderBlock(Block item) { bool debug = !String.IsNullOrEmpty(HttpContext.Current.Request.QueryString.Get("debug")) ? Convert.ToBoolean(HttpContext.Current.Request.QueryString.Get("debug")) : false; if (item.Template != null) { @BlocksPage.RenderTemplate(item.Template) } if (item.Component != null) { string customSufix = "Custom"; string methodName = item.Component.HelperName; ComponentBase[] methodParameters = new ComponentBase[1]; methodParameters[0] = item.Component; Type methodType = this.GetType(); MethodInfo customMethod = methodType.GetMethod(methodName + customSufix); MethodInfo generalMethod = methodType.GetMethod(methodName); try { if (debug) { <!-- Component: @methodName.Replace("Render", "") --> } @customMethod.Invoke(this, methodParameters).ToString(); } catch { try { @generalMethod.Invoke(this, methodParameters).ToString(); } catch(Exception ex) { throw new Exception(item.Component.GetType().Name + " method '" + methodName +"' could not be invoked", ex); } } } if (item.BlocksList.Count > 0 && !item.SkipRenderBlocksList) { @RenderBlockList(item.BlocksList) } } @*--- END: Base block renderers ---*@ @* Include the components *@ @using Dynamicweb.Rapido.Blocks.Components @using Dynamicweb.Rapido.Blocks.Components.General @using Dynamicweb.Rapido.Blocks @using System.IO @* Required *@ @using Dynamicweb.Rapido.Blocks.Components @using Dynamicweb.Rapido.Blocks.Components.General @using Dynamicweb.Rapido.Blocks @helper Render(ComponentBase component) { if (component != null) { @component.Render(this) } } @* Components *@ @using System.Reflection @using Dynamicweb.Rapido.Blocks.Components.General @* Component *@ @helper RenderIcon(Icon settings) { if (settings != null) { string color = settings.Color != null ? "style=\"color: " + settings.Color + "\"" : ""; if (settings.Name != null) { if (string.IsNullOrEmpty(settings.Label)) { <i class="@settings.Prefix @settings.Name @settings.CssClass" @color></i> } else { if (settings.LabelPosition == IconLabelPosition.Before) { <span>@settings.Label <i class="@settings.Prefix @settings.Name @settings.CssClass" @color></i></span> } else { <span><i class="@settings.Prefix @settings.Name @settings.CssClass" @color></i> @settings.Label</span> } } } else if (!string.IsNullOrEmpty(settings.Label)) { @settings.Label } } } @using System.Reflection @using Dynamicweb.Rapido.Blocks.Components.General @using Dynamicweb.Rapido.Blocks.Components @using Dynamicweb.Core @* Component *@ @helper RenderButton(Button settings) { if (settings != null && (!string.IsNullOrEmpty(settings.Title) || settings.Icon != null)) { Dictionary<string, string> attributes = new Dictionary<string, string>(); List<string> classList = settings.CssClass != null ? settings.CssClass.Split(' ').ToList() : new List<string>(); if (settings.Disabled) { attributes.Add("disabled", "true"); classList.Add("disabled"); } if (!string.IsNullOrEmpty(settings.ConfirmText) || !string.IsNullOrEmpty(settings.ConfirmTitle)) { settings.Id = !string.IsNullOrEmpty(settings.Id) ? settings.Id : Guid.NewGuid().ToString("N"); @RenderConfirmDialog(settings); settings.OnClick = "document.getElementById('" + settings.Id + "ModalTrigger').checked = true"; } if (!string.IsNullOrEmpty(settings.Id)) { attributes.Add("id", settings.Id); } if (!string.IsNullOrEmpty(settings.Name)) { attributes.Add("name", settings.Name); } if (!string.IsNullOrEmpty(settings.AltText)) { attributes.Add("title", settings.AltText); } else if (!string.IsNullOrEmpty(settings.Title)) { attributes.Add("title", settings.Title); } var onClickEvents = new List<string>(); if (!string.IsNullOrEmpty(settings.OnClick)) { onClickEvents.Add(settings.OnClick); } if (!string.IsNullOrEmpty(settings.Href)) { onClickEvents.Add("location.href='" + settings.Href + "'"); } if (onClickEvents.Count > 0) { attributes.Add("onClick", string.Join(";", onClickEvents)); } if (settings.ButtonLayout != ButtonLayout.None) { classList.Add("btn"); string btnLayout = Enum.GetName(typeof(ButtonLayout), settings.ButtonLayout).ToLower(); if (btnLayout == "linkclean") { btnLayout = "link-clean"; //fix } classList.Add("btn--" + btnLayout); } if (settings.Icon == null) { settings.Icon = new Icon(); } settings.Icon.Label = settings.Title; attributes.Add("type", Enum.GetName(typeof(ButtonType), settings.ButtonType).ToLower()); <button class="@string.Join(" ", classList) dw-mod" @ComponentMethods.AddAttributes(attributes) @ComponentMethods.AddAttributes(settings.ExtraAttributes)>@Render(settings.Icon)</button> } } @helper RenderConfirmDialog(Button settings) { Modal confirmDialog = new Modal { Id = settings.Id, Width = ModalWidth.Sm, Heading = new Heading { Level = 2, Title = settings.ConfirmTitle }, BodyText = settings.ConfirmText }; confirmDialog.AddAction(new Button { Title = Translate("Cancel"), ButtonLayout = ButtonLayout.Secondary, OnClick = "document.getElementById('" + settings.Id + "ModalTrigger').checked = false"}); confirmDialog.AddAction(new Button { Title = Translate("OK"), ButtonLayout = ButtonLayout.Primary, OnClick = "document.getElementById('" + settings.Id + "ModalTrigger').checked = false;" + settings.OnClick }); @Render(confirmDialog) } @using Dynamicweb.Rapido.Blocks.Components.General @using Dynamicweb.Rapido.Blocks.Components @using Dynamicweb.Core @helper RenderDashboard(Dashboard settings) { var widgets = settings.GetWidgets(); if (!string.IsNullOrEmpty(settings.WidgetsBaseBackgroundColor)) { //set bg color for them System.Drawing.Color color = System.Drawing.ColorTranslator.FromHtml(settings.WidgetsBaseBackgroundColor); int r = Convert.ToInt16(color.R); int g = Convert.ToInt16(color.G); int b = Convert.ToInt16(color.B); var count = widgets.Length; var max = Math.Max(r, Math.Max(g, b)); double step = 255.0 / (max * count); var i = 0; foreach (var widget in widgets) { i++; var shade = "rgb(" + Converter.ToString(r * step * i).Replace(",", ".") + ", " + Converter.ToString(g * step * i).Replace(",", ".") + ", " + Converter.ToString(b * step * i).Replace(",", ".") + ")"; widget.BackgroundColor = shade; } } <div class="dashboard @settings.CssClass dw-mod" @ComponentMethods.AddAttributes(settings.ExtraAttributes)> @foreach (var widget in widgets) { <div class="dashboard__widget"> @Render(widget) </div> } </div> } @using Dynamicweb.Rapido.Blocks.Components.General @using Dynamicweb.Rapido.Blocks.Components @helper RenderDashboardWidgetLink(DashboardWidgetLink settings) { if (!string.IsNullOrEmpty(settings.Link)) { var backgroundStyles = ""; if (!string.IsNullOrEmpty(settings.BackgroundColor)) { backgroundStyles = "style=\"background-color:" + settings.BackgroundColor + "\""; } <a href="@settings.Link" class="widget widget--link @settings.CssClass dw-mod" @backgroundStyles title="@settings.Title" @ComponentMethods.AddAttributes(settings.ExtraAttributes)> <div class="u-center-middle u-color-light"> @if (settings.Icon != null) { settings.Icon.CssClass += "widget__icon"; @Render(settings.Icon) } <div class="widget__title">@settings.Title</div> </div> </a> } } @using Dynamicweb.Rapido.Blocks.Components.General @using Dynamicweb.Rapido.Blocks.Components @helper RenderDashboardWidgetCounter(DashboardWidgetCounter settings) { var backgroundStyles = ""; if (!string.IsNullOrEmpty(settings.BackgroundColor)) { backgroundStyles = "style='background-color:" + settings.BackgroundColor + "'"; } <div class="widget @settings.CssClass dw-mod" @backgroundStyles @ComponentMethods.AddAttributes(settings.ExtraAttributes)> <div class="u-center-middle u-color-light"> @if (settings.Icon != null) { settings.Icon.CssClass += "widget__icon"; @Render(settings.Icon) } <div class="widget__counter">@settings.Count</div> <div class="widget__title">@settings.Title</div> </div> </div> } @using System.Reflection @using Dynamicweb.Rapido.Blocks.Components.General @using Dynamicweb.Rapido.Blocks.Components @using Dynamicweb.Core @* Component *@ @helper RenderLink(Link settings) { if (settings != null && !string.IsNullOrEmpty(settings.Href) && (!string.IsNullOrEmpty(settings.Title) || settings.Icon != null)) { Dictionary<string, string> attributes = new Dictionary<string, string>(); List<string> classList = settings.CssClass != null ? settings.CssClass.Split(' ').ToList() : new List<string>(); if (settings.Disabled) { attributes.Add("disabled", "true"); classList.Add("disabled"); } if (!string.IsNullOrEmpty(settings.AltText)) { attributes.Add("title", settings.AltText); } else if (!string.IsNullOrEmpty(settings.Title)) { attributes.Add("title", settings.Title); } if (!string.IsNullOrEmpty(settings.Id)) { attributes.Add("id", settings.Id); } if (!string.IsNullOrEmpty(settings.Name)) { attributes.Add("name", settings.Name); } if (!string.IsNullOrEmpty(settings.OnClick)) { attributes.Add("onClick", settings.OnClick); } attributes.Add("href", settings.Href); if (settings.ButtonLayout != ButtonLayout.None) { classList.Add("btn"); string btnLayout = Enum.GetName(typeof(ButtonLayout), settings.ButtonLayout).ToLower(); if (btnLayout == "linkclean") { btnLayout = "link-clean"; //fix } classList.Add("btn--" + btnLayout); } if (settings.Icon == null) { settings.Icon = new Icon(); } settings.Icon.Label = settings.Title; if (settings.Target == LinkTargetType.Blank && settings.Rel == LinkRelType.None) { settings.Rel = LinkRelType.Noopener; } if (settings.Target != LinkTargetType.None) { attributes.Add("target", "_" + Enum.GetName(typeof(LinkTargetType), settings.Target).ToLower()); } if (settings.Download) { attributes.Add("download", "true"); } if (settings.Rel != LinkRelType.None) { attributes.Add("rel", Enum.GetName(typeof(LinkRelType), settings.Rel).ToLower()); } <a class="@string.Join(" ", classList) dw-mod" @ComponentMethods.AddAttributes(attributes) @ComponentMethods.AddAttributes(settings.ExtraAttributes)>@Render(settings.Icon)</a> } } @using System.Reflection @using Dynamicweb.Rapido.Blocks.Components @using Dynamicweb.Rapido.Blocks.Components.General @using Dynamicweb.Rapido.Blocks @* Component *@ @helper RenderRating(Rating settings) { if (settings.Score > 0) { int rating = settings.Score; string iconType = "fa-star"; switch (settings.Type.ToString()) { case "Stars": iconType = "fa-star"; break; case "Hearts": iconType = "fa-heart"; break; case "Lemons": iconType = "fa-lemon"; break; case "Bombs": iconType = "fa-bomb"; break; } <div class="u-ta-right"> @for (int i = 0; i < settings.OutOf; i++) { <i class="@(rating > i ? "fas" : "far") @iconType"></i> } </div> } } @using System.Reflection @using Dynamicweb.Rapido.Blocks.Components.General @using Dynamicweb.Rapido.Blocks.Components @* Component *@ @helper RenderSelectFieldOption(SelectFieldOption settings) { Dictionary<string, string> attributes = new Dictionary<string, string>(); if (settings.Checked) { attributes.Add("selected", "true"); } if (settings.Disabled) { attributes.Add("disabled", "true"); } if (settings.Value != null) { attributes.Add("value", settings.Value); } if (!string.IsNullOrEmpty(settings.Id)) { attributes.Add("id", settings.Id); } <option @ComponentMethods.AddAttributes(attributes) @ComponentMethods.AddAttributes(settings.ExtraAttributes)>@settings.Label</option> } @using System.Reflection @using Dynamicweb.Rapido.Blocks.Components.General @using Dynamicweb.Rapido.Blocks.Components @* Component *@ @helper RenderNavigation(Navigation settings) { @RenderNavigation(new { id = settings.Id, cssclass = settings.CssClass, startLevel = settings.StartLevel, endlevel = settings.EndLevel, expandmode = settings.Expandmode, sitemapmode = settings.SitemapMode, template = settings.Template }) } @using Dynamicweb.Rapido.Blocks.Components.General @using Dynamicweb.Rapido.Blocks.Components @* Component *@ @helper RenderBreadcrumbNavigation(BreadcrumbNavigation settings) { settings.Id = String.IsNullOrEmpty(settings.Id) ? "breadcrumb" : settings.Id; settings.Template = String.IsNullOrEmpty(settings.Template) ? "Breadcrumb.xslt" : settings.Template; settings.StartLevel = settings.StartLevel == 0 ? 1 : settings.StartLevel; settings.EndLevel = settings.EndLevel == 10 ? 1 : settings.EndLevel; settings.Expandmode = String.IsNullOrEmpty(settings.Expandmode) ? "all" : settings.Expandmode; settings.SitemapMode = false; @RenderNavigation(settings) } @using Dynamicweb.Rapido.Blocks.Components.General @using Dynamicweb.Rapido.Blocks.Components @* Component *@ @helper RenderLeftNavigation(LeftNavigation settings) { settings.Id = String.IsNullOrEmpty(settings.Id) ? "breadcrumb" : settings.Id; settings.Template = String.IsNullOrEmpty(settings.Template) ? "Breadcrumb.xslt" : settings.Template; settings.StartLevel = settings.StartLevel == 0 ? 1 : settings.StartLevel; settings.EndLevel = settings.EndLevel == 10 ? 1 : settings.EndLevel; settings.Expandmode = String.IsNullOrEmpty(settings.Expandmode) ? "all" : settings.Expandmode; <div class="grid__cell"> @RenderNavigation(settings) </div> } @using System.Reflection @using Dynamicweb.Rapido.Blocks.Components.General @using Dynamicweb.Core @* Component *@ @helper RenderHeading(Heading settings) { if (settings != null && !string.IsNullOrEmpty(settings.Title)) { string color = settings.Color != null ? "style=\"color: " + settings.Color + "\"" : ""; string tagName = settings.Level != 0 ? "h" + settings.Level.ToString() : "div"; @("<" + tagName + " class=\"" + settings.CssClass + " dw-mod\" " + color + ">") if (!string.IsNullOrEmpty(settings.Link)) { @Render(new Link { Href = settings.Link, Icon = settings.Icon, Title = settings.Title, ButtonLayout = ButtonLayout.None }) } else { if (settings.Icon == null) { settings.Icon = new Icon(); } settings.Icon.Label = settings.Title; @Render(settings.Icon) } @("</" + tagName + ">"); } } @using Dynamicweb.Rapido.Blocks.Components @using Dynamicweb.Rapido.Blocks.Components.General @using Dynamicweb.Rapido.Blocks @* Component *@ @helper RenderImage(Image settings) { if (settings.FilterPrimary != ImageFilter.None || settings.FilterSecondary != ImageFilter.None) { Dictionary<string, string> optionalAttributes = new Dictionary<string, string>(); if (!string.IsNullOrEmpty(settings.FilterColor)) { optionalAttributes.Add("style", "background-color: " + settings.FilterColor); } if (settings.Caption != null) { @:<div> } var primaryFilterClass = settings.FilterPrimary.ToString().ToLower(); var secondaryFilterClass = settings.FilterSecondary.ToString().ToLower(); <div class="image-filter image-filter--@primaryFilterClass u-position-relative dw-mod" @ComponentMethods.AddAttributes(optionalAttributes)> <div class="image-filter image-filter--@secondaryFilterClass dw-mod"> @if (settings.Link != null) { <a href="@settings.Link"> @RenderTheImage(settings) </a> } else { @RenderTheImage(settings) } </div> </div> if (settings.Caption != null) { <span class="image-caption dw-mod">@settings.Caption</span> @:</div> } } else { if (settings.Caption != null) { @:<div> } if (!string.IsNullOrEmpty(settings.Link)) { <a href="@settings.Link"> @RenderTheImage(settings) </a> } else { @RenderTheImage(settings) } if (settings.Caption != null) { <span class="image-caption dw-mod">@settings.Caption</span> @:</div> } } } @helper RenderTheImage(Image settings) { if (settings != null) { string placeholderImage = "/Files/Images/placeholder.gif"; string imageEngine = "/Admin/Public/GetImage.ashx?"; string imageStyle = ""; switch (settings.Style) { case ImageStyle.Ball: imageStyle = "grid__cell-img--ball"; break; } if (settings.Style == ImageStyle.Ball || settings.Style == ImageStyle.Circle) { if (settings.ImageDefault != null) { settings.ImageDefault.Height = settings.ImageDefault.Width; } if (settings.ImageMedium != null) { settings.ImageMedium.Height = settings.ImageMedium.Width; } if (settings.ImageSmall != null) { settings.ImageSmall.Height = settings.ImageSmall.Width; } } string defaultImage = imageEngine; string imageSmall = ""; string imageMedium = ""; if (settings.DisableImageEngine) { defaultImage = settings.Path; } else { if (settings.ImageDefault != null) { defaultImage += Dynamicweb.Rapido.Services.Images.GetImagePathFromSettings(settings.ImageDefault); if (settings.Path.GetType() != typeof(string)) { defaultImage += settings.Path != null ? "Image=" + settings.Path.PathUrlEncoded : ""; defaultImage += settings.Path != null ? "&" + settings.Path.GetFocalPointParameters() : ""; } else { defaultImage += settings.Path != null ? "Image=" + settings.Path : ""; } } if (settings.ImageSmall != null) { imageSmall = "data-src-small=\"" + imageEngine; imageSmall += Dynamicweb.Rapido.Services.Images.GetImagePathFromSettings(settings.ImageSmall); if (settings.Path.GetType() != typeof(string)) { imageSmall += settings.Path != null ? "Image=" + settings.Path.PathUrlEncoded : ""; imageSmall += settings.Path != null ? "&" + settings.Path.GetFocalPointParameters() : ""; } else { imageSmall += settings.Path != null ? "Image=" + settings.Path : ""; } imageSmall += "\""; } if (settings.ImageMedium != null) { imageMedium = "data-src-medium=\"" + imageEngine; imageMedium += Dynamicweb.Rapido.Services.Images.GetImagePathFromSettings(settings.ImageMedium); if (settings.Path.GetType() != typeof(string)) { imageMedium += settings.Path != null ? "Image=" + settings.Path.PathUrlEncoded : ""; imageMedium += settings.Path != null ? "&" + settings.Path.GetFocalPointParameters() : ""; } else { imageMedium += settings.Path != null ? "Image=" + settings.Path : ""; } imageMedium += "\""; } } Dictionary<string, string> optionalAttributes = new Dictionary<string, string>(); if (!string.IsNullOrEmpty(settings.OnClick)) { optionalAttributes.Add("onclick", settings.OnClick); } if (!string.IsNullOrEmpty(settings.Title)) { optionalAttributes.Add("alt", settings.Title); optionalAttributes.Add("title", settings.Title); } if (settings.DisableLazyLoad) { <img id="@settings.Id" class="@imageStyle @settings.CssClass dw-mod" src="@defaultImage" @ComponentMethods.AddAttributes(optionalAttributes) @ComponentMethods.AddAttributes(settings.ExtraAttributes) /> } else { <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) /> } } } @using System.Reflection @using Dynamicweb.Rapido.Blocks.Components.General @using Dynamicweb.Rapido.Blocks.Components @* Component *@ @helper RenderFileField(FileField settings) { var attributes = new Dictionary<string, string>(); if (string.IsNullOrEmpty(settings.Id)) { settings.Id = Guid.NewGuid().ToString("N"); } if (!string.IsNullOrEmpty(settings.Id)) { attributes.Add("id", settings.Id); } if (settings.Disabled) { attributes.Add("disabled", "true"); } if (settings.Required) { attributes.Add("required", "true"); } if (settings.Multiple) { attributes.Add("multiple", "true"); } if (!string.IsNullOrEmpty(settings.Name)) { attributes.Add("name", settings.Name); } if (string.IsNullOrEmpty(settings.ChooseFileText)) { settings.ChooseFileText = Translate("Choose file"); } if (string.IsNullOrEmpty(settings.NoFilesChosenText)) { settings.NoFilesChosenText = Translate("No files chosen..."); } if (!string.IsNullOrEmpty(settings.OnClick)) { attributes.Add("onclick", settings.OnClick); } string setValueToFakeInput = "FileUpload.setValueToFakeInput(this)"; attributes.Add("onchange", setValueToFakeInput + (!string.IsNullOrEmpty(settings.OnChange) ? settings.OnChange : "")); attributes.Add("type", "file"); if (!string.IsNullOrEmpty(settings.Value)) { attributes.Add("value", settings.Value); } settings.CssClass = "u-full-width " + settings.CssClass; var resultAttributes = attributes.Concat(settings.ExtraAttributes).GroupBy(d => d.Key).ToDictionary (d => d.Key, d => d.Last().Value); <div class="form__field-group u-full-width @settings.WrapperCssClass dw-mod"> @if (!string.IsNullOrEmpty(settings.Label)) { <label for="@settings.Id">@settings.Label</label> } @if (!string.IsNullOrEmpty(settings.HelpText)) { <small class="form__help-text">@settings.HelpText</small> } <div class="form__field-combi file-input u-no-margin dw-mod"> <input @ComponentMethods.AddAttributes(resultAttributes) class="file-input__real-input" data-no-files-text="@settings.NoFilesChosenText" data-many-files-text="@Translate("files")" /> <label for="@settings.Id" class="file-input__btn btn--secondary btn dw-mod">@settings.ChooseFileText</label> <label for="@settings.Id" class="@settings.CssClass file-input__fake-input js-fake-input dw-mod">@settings.NoFilesChosenText</label> @if (settings.UploadButton != null) { settings.UploadButton.CssClass += " btn--condensed u-no-margin"; @Render(settings.UploadButton) } </div> @Render(new NotificationMessage { Message = settings.ErrorMessage }) </div> } @using System.Reflection @using Dynamicweb.Rapido.Blocks.Components.General @using Dynamicweb.Rapido.Blocks.Components @using Dynamicweb.Core @using System.Linq @* Component *@ @helper RenderDateTimeField(DateTimeField settings) { if (string.IsNullOrEmpty(settings.Id)) { settings.Id = Guid.NewGuid().ToString("N"); } var textField = new TextField { Name = settings.Name, Id = settings.Id, Label = settings.Label, HelpText = settings.HelpText, Value = settings.Value, Disabled = settings.Disabled, Required = settings.Required, ErrorMessage = settings.ErrorMessage, CssClass = settings.CssClass, WrapperCssClass = settings.WrapperCssClass, OnChange = settings.OnChange, OnClick = settings.OnClick, ExtraAttributes = settings.ExtraAttributes, // Placeholder = settings.Placeholder }; @Render(textField) List<string> jsAttributes = new List<string>(); jsAttributes.Add("mode: '" + Enum.GetName(typeof(DateTimeFieldMode), settings.Mode).ToLower() + "'"); if (!string.IsNullOrEmpty(settings.DateFormat)) { jsAttributes.Add("dateFormat: '" + settings.DateFormat + "'"); } if (!string.IsNullOrEmpty(settings.MinDate)) { jsAttributes.Add("minDate: '" + settings.MinDate + "'"); } if (!string.IsNullOrEmpty(settings.MaxDate)) { jsAttributes.Add("maxDate: '" + settings.MaxDate + "'"); } if (settings.IsInline) { jsAttributes.Add("inline: " + Converter.ToString(settings.IsInline).ToLower()); } if (settings.EnableTime) { jsAttributes.Add("enableTime: " + Converter.ToString(settings.EnableTime).ToLower()); } if (settings.EnableWeekNumbers) { jsAttributes.Add("weekNumbers: " + Converter.ToString(settings.EnableWeekNumbers).ToLower()); } jsAttributes.AddRange(settings.GetFlatPickrOptions().Select(x => x.Key + ": " + x.Value)); <script> document.addEventListener("DOMContentLoaded", function () { flatpickr("#@textField.Id", { @string.Join(",", jsAttributes) }); }); </script> } @using System.Reflection @using Dynamicweb.Rapido.Blocks.Components.General @using Dynamicweb.Rapido.Blocks.Components @* Component *@ @helper RenderTextField(TextField settings) { var attributes = new Dictionary<string, string>(); if (!string.IsNullOrEmpty(settings.Label) && string.IsNullOrEmpty(settings.Id)) { settings.Id = Guid.NewGuid().ToString("N"); } /*base settings*/ if (!string.IsNullOrEmpty(settings.Id)) { attributes.Add("id", settings.Id); } if (!string.IsNullOrEmpty(settings.OnClick)) { attributes.Add("onclick", settings.OnClick); } if (!string.IsNullOrEmpty(settings.OnChange)) { attributes.Add("onchange", settings.OnChange); } if (settings.Disabled) { attributes.Add("disabled", "true"); } if (settings.Required) { attributes.Add("required", "true"); } if (!string.IsNullOrEmpty(settings.Name)) { attributes.Add("name", settings.Name); } /*end*/ if (!string.IsNullOrEmpty(settings.OnKeyUp)) { attributes.Add("onkeyup", settings.OnKeyUp); } if (!string.IsNullOrEmpty(settings.OnInput)) { attributes.Add("oninput", settings.OnInput); } if (!string.IsNullOrEmpty(settings.OnFocus)) { attributes.Add("onfocus", settings.OnFocus); } if (settings.ReadOnly) { attributes.Add("readonly", "true"); } if (settings.MaxLength != 0) { attributes.Add("maxlength", settings.MaxLength.ToString()); } if (!string.IsNullOrEmpty(settings.Placeholder)) { attributes.Add("placeholder", settings.Placeholder); } attributes.Add("type", Enum.GetName(typeof(TextFieldType), settings.Type).ToLower()); if (settings.Type == TextFieldType.Password) { attributes.Add("autocomplete", "off"); }; if (!string.IsNullOrEmpty(settings.Value)) { attributes.Add("value", settings.Value); } settings.CssClass = "u-full-width " + settings.CssClass; var resultAttributes = attributes.Concat(settings.ExtraAttributes).GroupBy(d => d.Key).ToDictionary (d => d.Key, d => d.Last().Value); string noMargin = "u-no-margin"; if (!settings.ReadOnly) { noMargin = ""; } <div class="form__field-group u-full-width @noMargin @settings.WrapperCssClass dw-mod"> @if (!string.IsNullOrEmpty(settings.Label)) { <label for="@settings.Id">@settings.Label</label> } @if (!string.IsNullOrEmpty(settings.HelpText)) { <small class="form__help-text">@settings.HelpText</small> } @if (settings.ActionButton != null) { settings.ActionButton.CssClass += " btn--condensed u-no-margin"; <div class="form__field-combi u-no-margin dw-mod"> <input @ComponentMethods.AddAttributes(resultAttributes) class="@settings.CssClass dw-mod" /> @Render(settings.ActionButton) </div> } else { <input @ComponentMethods.AddAttributes(resultAttributes) class="@settings.CssClass dw-mod" /> } @Render(new NotificationMessage { Message = settings.ErrorMessage }) </div> } @using System.Reflection @using Dynamicweb.Rapido.Blocks.Components.General @using Dynamicweb.Rapido.Blocks.Components @* Component *@ @helper RenderNumberField(NumberField settings) { var attributes = new Dictionary<string, string>(); if (!string.IsNullOrEmpty(settings.Label) && string.IsNullOrEmpty(settings.Id)) { settings.Id = Guid.NewGuid().ToString("N"); } /*base settings*/ if (!string.IsNullOrEmpty(settings.Id)) { attributes.Add("id", settings.Id); } if (!string.IsNullOrEmpty(settings.OnClick)) { attributes.Add("onclick", settings.OnClick); } if (!string.IsNullOrEmpty(settings.OnChange)) { attributes.Add("onchange", settings.OnChange); } if (settings.Disabled) { attributes.Add("disabled", "true"); } if (settings.Required) { attributes.Add("required", "true"); } if (!string.IsNullOrEmpty(settings.Name)) { attributes.Add("name", settings.Name); } /*end*/ if (!string.IsNullOrEmpty(settings.OnKeyUp)) { attributes.Add("onkeyup", settings.OnKeyUp); } if (!string.IsNullOrEmpty(settings.OnInput)) { attributes.Add("oninput", settings.OnInput); } if (!string.IsNullOrEmpty(settings.OnFocus)) { attributes.Add("onfocus", settings.OnFocus); } if (settings.ReadOnly) { attributes.Add("readonly", "true"); } if (settings.Max != null) { attributes.Add("max", settings.Max.ToString()); } if (settings.Min != null) { attributes.Add("min", settings.Min.ToString()); } if (settings.Step != 0) { attributes.Add("step", settings.Step.ToString()); } if (settings.Value != null && !string.IsNullOrEmpty(settings.Value.ToString())) { attributes.Add("value", settings.Value.ToString()); } attributes.Add("type", "number"); var resultAttributes = attributes.Concat(settings.ExtraAttributes).GroupBy(d => d.Key).ToDictionary (d => d.Key, d => d.Last().Value); <div class="form__field-group u-full-width @settings.WrapperCssClass dw-mod"> @if (!string.IsNullOrEmpty(settings.Label)) { <label for="@settings.Id">@settings.Label</label> } @if (!string.IsNullOrEmpty(settings.HelpText)) { <small class="form__help-text">@settings.HelpText</small> } @if (settings.ActionButton != null) { settings.ActionButton.CssClass += " btn--condensed u-no-margin"; <div class="form__field-combi u-no-margin dw-mod"> <input @ComponentMethods.AddAttributes(resultAttributes) class="@settings.CssClass dw-mod" /> @Render(settings.ActionButton) </div> } else { <input @ComponentMethods.AddAttributes(resultAttributes) class="@settings.CssClass dw-mod" /> } @Render(new NotificationMessage { Message = settings.ErrorMessage }) </div> } @using System.Reflection @using Dynamicweb.Rapido.Blocks.Components.General @using Dynamicweb.Rapido.Blocks.Components @* Component *@ @helper RenderTextareaField(TextareaField settings) { Dictionary<string, string> attributes = new Dictionary<string, string>(); string id = settings.Id; if (!string.IsNullOrEmpty(settings.Label) && string.IsNullOrEmpty(id)) { id = Guid.NewGuid().ToString("N"); } if (!string.IsNullOrEmpty(id)) { attributes.Add("id", id); } if (!string.IsNullOrEmpty(settings.OnClick)) { attributes.Add("onclick", settings.OnClick); } if (!string.IsNullOrEmpty(settings.OnKeyUp)) { attributes.Add("onkeyup", settings.OnKeyUp); } if (!string.IsNullOrEmpty(settings.OnInput)) { attributes.Add("oninput", settings.OnInput); } if (!string.IsNullOrEmpty(settings.OnFocus)) { attributes.Add("onfocus", settings.OnFocus); } if (!string.IsNullOrEmpty(settings.OnChange)) { attributes.Add("onchange", settings.OnChange); } if (!string.IsNullOrEmpty(settings.Placeholder)) { attributes.Add("placeholder", settings.Placeholder); } if (settings.Disabled) { attributes.Add("disabled", "true"); } if (settings.Required) { attributes.Add("required", "true"); } if (settings.ReadOnly) { attributes.Add("readonly", "true"); } if (settings.MaxLength != 0) { attributes.Add("maxlength", settings.MaxLength.ToString()); } if (settings.Rows != 0) { attributes.Add("rows", settings.Rows.ToString()); } attributes.Add("name", settings.Name); <div class="form__field-group @settings.WrapperCssClass dw-mod"> @if (!string.IsNullOrEmpty(settings.Label)) { <label for="@id">@settings.Label</label> } @if (!string.IsNullOrEmpty(settings.HelpText)) { <small class="form__help-text">@settings.HelpText</small> } <textarea class="u-full-width @settings.CssClass dw-mod" @ComponentMethods.AddAttributes(attributes) @ComponentMethods.AddAttributes(settings.ExtraAttributes)>@settings.Value</textarea> @Render(new NotificationMessage { Message = settings.ErrorMessage }) </div> } @using System.Reflection @using Dynamicweb.Rapido.Blocks.Components.General @using Dynamicweb.Rapido.Blocks.Components @* Component *@ @helper RenderHiddenField(HiddenField settings) { var attributes = new Dictionary<string, string>(); attributes.Add("type", "hidden"); if (!string.IsNullOrEmpty(settings.Id)) { attributes.Add("id", settings.Id); } if (!string.IsNullOrEmpty(settings.Value)) { attributes.Add("value", settings.Value); } if (!string.IsNullOrEmpty(settings.Name)) { attributes.Add("name", settings.Name); } <input @ComponentMethods.AddAttributes(attributes) @ComponentMethods.AddAttributes(settings.ExtraAttributes)/> } @using System.Reflection @using Dynamicweb.Rapido.Blocks.Components.General @using Dynamicweb.Rapido.Blocks.Components @* Component *@ @helper RenderCheckboxField(CheckboxField settings) { var attributes = new Dictionary<string, string>(); if (!string.IsNullOrEmpty(settings.Label) && string.IsNullOrEmpty(settings.Id)) { settings.Id = Guid.NewGuid().ToString("N"); } /*base settings*/ if (!string.IsNullOrEmpty(settings.Id)) { attributes.Add("id", settings.Id); } if (!string.IsNullOrEmpty(settings.OnClick)) { attributes.Add("onclick", settings.OnClick); } if (!string.IsNullOrEmpty(settings.OnChange)) { attributes.Add("onchange", settings.OnChange); } if (settings.Disabled) { attributes.Add("disabled", "true"); } if (settings.Required) { attributes.Add("required", "true"); } if (!string.IsNullOrEmpty(settings.Name)) { attributes.Add("name", settings.Name); } /*end*/ attributes.Add("type", "checkbox"); if (settings.Checked) { attributes.Add("checked", "true"); } settings.CssClass = "form__control " + settings.CssClass; if (!string.IsNullOrEmpty(settings.Value)) { attributes.Add("value", settings.Value); } var resultAttributes = attributes.Concat(settings.ExtraAttributes).GroupBy(d => d.Key).ToDictionary (d => d.Key, d => d.Last().Value); <div class="form__field-group @settings.WrapperCssClass dw-mod"> <input @ComponentMethods.AddAttributes(resultAttributes) class="@settings.CssClass dw-mod" /> @if (!string.IsNullOrEmpty(settings.Label)) { <label for="@settings.Id" class="dw-mod">@settings.Label</label> } @if (!string.IsNullOrEmpty(settings.HelpText)) { <small class="form__help-text">@settings.HelpText</small> } @Render(new NotificationMessage { Message = settings.ErrorMessage }) </div> } @using System.Reflection @using Dynamicweb.Rapido.Blocks.Components.General @using Dynamicweb.Rapido.Blocks.Components @* Component *@ @helper RenderCheckboxListField(CheckboxListField settings) { <div class="form__field-group @settings.WrapperCssClass u-margin-bottom dw-mod" @ComponentMethods.AddAttributes(settings.ExtraAttributes)> @if (!string.IsNullOrEmpty(settings.Label)) { <label>@settings.Label</label> } @if (!string.IsNullOrEmpty(settings.HelpText)) { <small class="form__help-text">@settings.HelpText</small> } @foreach (var item in settings.Options) { if (settings.Required) { item.Required = true; } if (settings.Disabled) { item.Disabled = true; } if (!string.IsNullOrEmpty(settings.Name)) { item.Name = settings.Name; } if (!string.IsNullOrEmpty(settings.CssClass)) { item.CssClass += settings.CssClass; } /* value is not supported */ if (!string.IsNullOrEmpty(settings.OnClick)) { item.OnClick += settings.OnClick; } if (!string.IsNullOrEmpty(settings.OnChange)) { item.OnChange += settings.OnChange; } @Render(item) } @Render(new NotificationMessage { Message = settings.ErrorMessage }) </div> } @using System.Reflection @using Dynamicweb.Rapido.Blocks.Components.General @using Dynamicweb.Rapido.Blocks.Components @* Component *@ @helper RenderSelectField(SelectField settings) { if (!string.IsNullOrEmpty(settings.Label) && string.IsNullOrEmpty(settings.Id)) { settings.Id = Guid.NewGuid().ToString("N"); } <div class="form__field-group u-full-width @settings.WrapperCssClass dw-mod"> @if (!string.IsNullOrEmpty(settings.Label)) { <label for="@settings.Id">@settings.Label</label> } @if (!string.IsNullOrEmpty(settings.HelpText)) { <small class="form__help-text">@settings.HelpText</small> } @if (settings.ActionButton != null) { settings.ActionButton.CssClass += " btn--condensed u-no-margin"; <div class="form__field-combi u-no-margin dw-mod"> @RenderSelectBase(settings) @Render(settings.ActionButton) </div> } else { @RenderSelectBase(settings) } @Render(new NotificationMessage { Message = settings.ErrorMessage }) </div> } @helper RenderSelectBase(SelectField settings) { var attributes = new Dictionary<string, string>(); /*base settings*/ if (!string.IsNullOrEmpty(settings.Id)) { attributes.Add("id", settings.Id); } if (!string.IsNullOrEmpty(settings.OnClick)) { attributes.Add("onclick", settings.OnClick); } if (!string.IsNullOrEmpty(settings.OnChange)) { attributes.Add("onchange", settings.OnChange); } if (settings.Disabled) { attributes.Add("disabled", "true"); } if (settings.Required) { attributes.Add("required", "true"); } if (!string.IsNullOrEmpty(settings.Name)) { attributes.Add("name", settings.Name); } /*end*/ var resultAttributes = attributes.Concat(settings.ExtraAttributes).GroupBy(d => d.Key).ToDictionary (d => d.Key, d => d.Last().Value); <select @ComponentMethods.AddAttributes(resultAttributes) class="u-full-width @settings.CssClass dw-mod"> @if (settings.Default != null) { @Render(settings.Default) } @foreach (var item in settings.Options) { if (!string.IsNullOrEmpty(settings.Value)) { item.Checked = item.Value == settings.Value; } @Render(item) } </select> } @using System.Reflection @using Dynamicweb.Rapido.Blocks.Components.General @using Dynamicweb.Rapido.Blocks.Components @* Component *@ @helper RenderRadioButtonField(RadioButtonField settings) { var attributes = new Dictionary<string, string>(); if (!string.IsNullOrEmpty(settings.Label) && string.IsNullOrEmpty(settings.Id)) { settings.Id = Guid.NewGuid().ToString("N"); } /*base settings*/ if (!string.IsNullOrEmpty(settings.Id)) { attributes.Add("id", settings.Id); } if (!string.IsNullOrEmpty(settings.OnClick)) { attributes.Add("onclick", settings.OnClick); } if (!string.IsNullOrEmpty(settings.OnChange)) { attributes.Add("onchange", settings.OnChange); } if (settings.Disabled) { attributes.Add("disabled", "true"); } if (settings.Required) { attributes.Add("required", "true"); } if (!string.IsNullOrEmpty(settings.Name)) { attributes.Add("name", settings.Name); } /*end*/ attributes.Add("type", "radio"); if (settings.Checked) { attributes.Add("checked", "true"); } settings.CssClass = "form__control " + settings.CssClass; if (!string.IsNullOrEmpty(settings.Value)) { attributes.Add("value", settings.Value); } var resultAttributes = attributes.Concat(settings.ExtraAttributes).GroupBy(d => d.Key).ToDictionary (d => d.Key, d => d.Last().Value); <div class="form__field-group @settings.WrapperCssClass dw-mod"> <input @ComponentMethods.AddAttributes(resultAttributes) class="@settings.CssClass dw-mod" /> @if (!string.IsNullOrEmpty(settings.Label)) { <label for="@settings.Id" class="dw-mod">@settings.Label</label> } @if (!string.IsNullOrEmpty(settings.HelpText)) { <small class="form__help-text">@settings.HelpText</small> } @Render(new NotificationMessage { Message = settings.ErrorMessage }) </div> } @using System.Reflection @using Dynamicweb.Rapido.Blocks.Components.General @using Dynamicweb.Rapido.Blocks.Components @* Component *@ @helper RenderRadioButtonListField(RadioButtonListField settings) { <div class="form__field-group @settings.WrapperCssClass u-margin-bottom dw-mod" @ComponentMethods.AddAttributes(settings.ExtraAttributes)> @if (!string.IsNullOrEmpty(settings.Label)) { <label>@settings.Label</label> } @if (!string.IsNullOrEmpty(settings.HelpText)) { <small class="form__help-text">@settings.HelpText</small> } @foreach (var item in settings.Options) { if (settings.Required) { item.Required = true; } if (settings.Disabled) { item.Disabled = true; } if (!string.IsNullOrEmpty(settings.Name)) { item.Name = settings.Name; } if (!string.IsNullOrEmpty(settings.Value) && settings.Value == item.Value) { item.Checked = true; } if (!string.IsNullOrEmpty(settings.OnClick)) { item.OnClick += settings.OnClick; } if (!string.IsNullOrEmpty(settings.OnChange)) { item.OnChange += settings.OnChange; } if (!string.IsNullOrEmpty(settings.CssClass)) { item.CssClass += settings.CssClass; } @Render(item) } @Render(new NotificationMessage { Message = settings.ErrorMessage }) </div> } @using System.Reflection @using Dynamicweb.Rapido.Blocks.Components.General @using Dynamicweb.Rapido.Blocks.Components @* Component *@ @helper RenderNotificationMessage(NotificationMessage settings) { if (!string.IsNullOrEmpty(settings.Message)) { var attributes = new Dictionary<string, string>(); if (!string.IsNullOrEmpty(settings.Id)) { attributes.Add("id", settings.Id); } string messageTypeClass = Enum.GetName(typeof(NotificationMessageType), settings.MessageType).ToLower(); <div class="field-@messageTypeClass @settings.CssClass u-full-width dw-mod" @ComponentMethods.AddAttributes(attributes)>@settings.Message</div> } } @using Dynamicweb.Rapido.Blocks.Components.General @* Component *@ @helper RenderHandlebarsRoot(HandlebarsRoot settings) { string preRender = !String.IsNullOrEmpty(settings.PreRenderScriptTemplate) ? "data-pre-render-template=\"" + settings.PreRenderScriptTemplate + "\"" : ""; <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> @if (settings.SubBlocks != null) { @RenderBlockList(settings.SubBlocks) } </div> } @using System.Reflection @using Dynamicweb.Rapido.Blocks.Components.General @using Dynamicweb.Rapido.Blocks.Components @using System.Text.RegularExpressions @* Component *@ @helper RenderSticker(Sticker settings) { if (!String.IsNullOrEmpty(settings.Title)) { string size = settings.Size.ToString() != "None" ? "" + "stickers-container__tag--" + settings.Size.ToString().ToLower() : ""; string style = settings.Style.ToString() != "None" ? "" + "stickers-container__tag--" + settings.Style.ToString().ToLower() : ""; Dictionary<String, String> optionalAttributes = new Dictionary<string, string>(); if (!String.IsNullOrEmpty(settings.Color) || !String.IsNullOrEmpty(settings.BackgroundColor)) { string styleTag = !String.IsNullOrEmpty(settings.Color) ? "color: " + settings.Color + "; " : ""; styleTag += !String.IsNullOrEmpty(settings.BackgroundColor) ? "background-color: " + settings.BackgroundColor + "; " : ""; optionalAttributes.Add("style", styleTag); } <div class="stickers-container__tag @size @style @settings.CssClass dw-mod" @ComponentMethods.AddAttributes(optionalAttributes) @ComponentMethods.AddAttributes(settings.ExtraAttributes)>@settings.Title</div> } } @using System.Reflection @using Dynamicweb.Rapido.Blocks.Components.General @using Dynamicweb.Rapido.Blocks.Components @* Component *@ @helper RenderStickersCollection(StickersCollection settings) { if (settings.Stickers.Count > 0) { string position = "stickers-container--" + Regex.Replace(settings.Position.ToString(), "([a-z])([A-Z])", "$1-$2").ToLower(); <div class="stickers-container @position @settings.CssClass dw-mod" @ComponentMethods.AddAttributes(settings.ExtraAttributes)> @foreach (Sticker sticker in settings.Stickers) { @Render(sticker) } </div> } } @using Dynamicweb.Rapido.Blocks.Components.General @* Component *@ @helper RenderForm(Form settings) { if (settings != null) { Dictionary<string, string> optionalAttributes = new Dictionary<string, string>(); if (!string.IsNullOrEmpty(settings.Action)) { optionalAttributes.Add("action", settings.Action); }; if (!string.IsNullOrEmpty(settings.Name)) { optionalAttributes.Add("name", settings.Name); }; if (!string.IsNullOrEmpty(settings.OnSubmit)) { optionalAttributes.Add("onsubmit", settings.OnSubmit); }; var enctypes = new Dictionary<string, string> { { "multipart", "multipart/form-data" }, { "text", "text/plain" }, { "application", "application/x-www-form-urlencoded" } }; if (settings.Enctype != FormEnctype.none) { optionalAttributes.Add("enctype", enctypes[Enum.GetName(typeof(FormEnctype), settings.Enctype).ToLower()]); }; optionalAttributes.Add("method", settings.Method.ToString()); if (!string.IsNullOrEmpty(settings.FormStartMarkup)) { @settings.FormStartMarkup } else { @:<form class="@settings.CssClass u-no-margin dw-mod" @ComponentMethods.AddAttributes(optionalAttributes) @ComponentMethods.AddAttributes(settings.ExtraAttributes)> } foreach (var field in settings.GetFields()) { @Render(field) } @:</form> } } @using System.Reflection @using Dynamicweb.Rapido.Blocks.Components.General @using Dynamicweb.Rapido.Blocks.Components @* Component *@ @helper RenderText(Text settings) { @settings.Content } @using System.Reflection @using Dynamicweb.Rapido.Blocks.Components.General @using Dynamicweb.Rapido.Blocks.Components @* Component *@ @helper RenderContentModule(ContentModule settings) { if (!string.IsNullOrEmpty(settings.Content)) { @settings.Content } } @using System.Reflection @using Dynamicweb.Rapido.Blocks.Components.General @using Dynamicweb.Rapido.Blocks.Components @* Component *@ @helper RenderModal(Modal settings) { if (settings != null) { string modalId = !string.IsNullOrEmpty(settings.Id) ? settings.Id : Guid.NewGuid().ToString("N"); string onchange = !string.IsNullOrEmpty(settings.OnClose) ? "onchange=\"if(!this.checked){" + settings.OnClose + "}\"" : ""; <input type="checkbox" id="@(modalId)ModalTrigger" class="modal-trigger" @onchange /> <div class="modal-container"> @if (!settings.DisableDarkOverlay) { <label for="@(modalId)ModalTrigger" id="@(modalId)ModalOverlay" class="modal-overlay"></label> } <div class="modal modal--@settings.Width.ToString().ToLower() modal-height--@settings.Height.ToString().ToLower()" id="@(modalId)Modal"> @if (settings.Heading != null) { if (!string.IsNullOrEmpty(settings.Heading.Title)) { <div class="modal__header"> @Render(settings.Heading) </div> } } <div class="modal__body @(settings.Width.ToString().ToLower() == "full" ? "modal__body--full" : "")"> @if (!string.IsNullOrEmpty(settings.BodyText)) { @settings.BodyText } @if (settings.BodyTemplate != null) { @settings.BodyTemplate } @{ var actions = settings.GetActions(); } </div> @if (actions.Length > 0) { <div class="modal__footer"> @foreach (var action in actions) { action.CssClass += " u-no-margin"; @Render(action) } </div> } <label class="modal__close-btn" for="@(modalId)ModalTrigger"></label> </div> </div> } } @using Dynamicweb.Rapido.Blocks.Components.General @* Component *@ @helper RenderMediaListItem(MediaListItem settings) { <div class="media-list-item @settings.CssClass dw-mod" @(!string.IsNullOrEmpty(settings.Id) ? "id=\"" + settings.Id + "\"" : "")> @if (!string.IsNullOrEmpty(settings.Label)) { if (!string.IsNullOrEmpty(settings.Link)) { @Render(new Link { Href = settings.Link, CssClass = "media-list-item__sticker dw-mod", ButtonLayout = ButtonLayout.None, Title = settings.Label, OnClick = !string.IsNullOrEmpty(settings.OnClick) ? settings.OnClick : "" }) } else if (!string.IsNullOrEmpty(settings.OnClick)) { <span class="media-list-item__sticker dw-mod" onclick="@(settings.OnClick)"> <span class="u-uppercase">@settings.Label</span> </span> } else { <span class="media-list-item__sticker media-list-item__sticker--no-link dw-mod"> <span class="u-uppercase">@settings.Label</span> </span> } } <div class="media-list-item__wrap"> <div class="media-list-item__info dw-mod"> <div class="media-list-item__header dw-mod"> @if (!string.IsNullOrEmpty(settings.Title)) { if (!string.IsNullOrEmpty(settings.Link)) { @Render(new Link { Href = settings.Link, CssClass = "media-list-item__name dw-mod", ButtonLayout = ButtonLayout.None, Title = settings.Title, OnClick = !string.IsNullOrEmpty(settings.OnClick) ? settings.OnClick : "" }) } else if (!string.IsNullOrEmpty(settings.OnClick)) { <span class="media-list-item__name dw-mod" onclick="@(settings.OnClick)">@settings.Title</span> } else { <span class="media-list-item__name media-list-item__name--no-link dw-mod">@settings.Title</span> } } @if (!string.IsNullOrEmpty(settings.Status)) { <div class="media-list-item__state dw-mod">@settings.Status</div> } </div> @{ settings.InfoTable.CssClass += " media-list-item__parameters-table"; } @Render(settings.InfoTable) </div> <div class="media-list-item__actions dw-mod"> <div class="media-list-item__actions-list dw-mod"> @{ var actions = settings.GetActions(); foreach (ButtonBase action in actions) { action.ButtonLayout = ButtonLayout.None; action.CssClass += " media-list-item__action link"; @Render(action) } } </div> @if (settings.SelectButton != null && !string.IsNullOrEmpty(settings.SelectButton.Title)) { settings.SelectButton.CssClass += " u-no-margin"; <div class="media-list-item__action-button"> @Render(settings.SelectButton) </div> } </div> </div> </div> } @using Dynamicweb.Rapido.Blocks.Components.General @using Dynamicweb.Rapido.Blocks.Components @helper RenderTable(Table settings) { Dictionary<string, string> attributes = new Dictionary<string, string>(); if (!string.IsNullOrEmpty(settings.Id)) { attributes.Add("id", settings.Id); } var enumToClasses = new Dictionary<TableDesign, string> { { TableDesign.Clean, "table--clean" }, { TableDesign.Bordered, "table--bordered" }, { TableDesign.Striped, "table--striped" }, { TableDesign.Hover, "table--hover" }, { TableDesign.Compact, "table--compact" }, { TableDesign.Condensed, "table--condensed" }, { TableDesign.NoTopBorder, "table--no-top-border" } }; string tableDesignClass = ""; if (settings.Design != TableDesign.None) { tableDesignClass = enumToClasses[settings.Design]; } if (!string.IsNullOrEmpty(settings.CssClass) || settings.Design != TableDesign.None) { attributes.Add("class", "table " + tableDesignClass + " " + settings.CssClass + " dw-mod"); } var resultAttributes = attributes.Concat(settings.ExtraAttributes).GroupBy(d => d.Key).ToDictionary(d => d.Key, d => d.Last().Value); <table @ComponentMethods.AddAttributes(resultAttributes)> @if (settings.Header != null) { <thead> @Render(settings.Header) </thead> } <tbody> @foreach (var row in settings.Rows) { @Render(row) } </tbody> @if (settings.Footer != null) { <tfoot> @Render(settings.Footer) </tfoot> } </table> } @using Dynamicweb.Rapido.Blocks.Components.General @using Dynamicweb.Rapido.Blocks.Components @helper RenderTableRow(TableRow settings) { Dictionary<string, string> attributes = new Dictionary<string, string>(); if (!string.IsNullOrEmpty(settings.Id)) { attributes.Add("id", settings.Id); } var enumToClasses = new Dictionary<TableRowDesign, string> { { TableRowDesign.NoBorder, "table__row--no-border" }, { TableRowDesign.Border, "table__row--border" }, { TableRowDesign.TopBorder, "table__row--top-line" }, { TableRowDesign.BottomBorder, "table__row--bottom-line" }, { TableRowDesign.Solid, "table__row--solid" } }; string tableRowDesignClass = ""; if (settings.Design != TableRowDesign.None) { tableRowDesignClass = enumToClasses[settings.Design]; } if (!string.IsNullOrEmpty(settings.CssClass) || settings.Design != TableRowDesign.None) { attributes.Add("class", "table__row " + tableRowDesignClass + " " + settings.CssClass + " dw-mod"); } var resultAttributes = attributes.Concat(settings.ExtraAttributes).GroupBy(d => d.Key).ToDictionary(d => d.Key, d => d.Last().Value); <tr @ComponentMethods.AddAttributes(resultAttributes)> @foreach (var cell in settings.Cells) { if (settings.IsHeaderRow) { cell.IsHeader = true; } @Render(cell) } </tr> } @using Dynamicweb.Rapido.Blocks.Components.General @using Dynamicweb.Rapido.Blocks.Components @using Dynamicweb.Core @helper RenderTableCell(TableCell settings) { Dictionary<string, string> attributes = new Dictionary<string, string>(); if (!string.IsNullOrEmpty(settings.Id)) { attributes.Add("id", settings.Id); } if (settings.Colspan != 0) { attributes.Add("colspan", Converter.ToString(settings.Colspan)); } if (settings.Rowspan != 0) { attributes.Add("rowspan", Converter.ToString(settings.Rowspan)); } if (!string.IsNullOrEmpty(settings.CssClass)) { attributes.Add("class", settings.CssClass + " dw-mod"); } var resultAttributes = attributes.Concat(settings.ExtraAttributes).GroupBy(d => d.Key).ToDictionary(d => d.Key, d => d.Last().Value); string tagName = settings.IsHeader ? "th" : "td"; @("<" + tagName + " " + ComponentMethods.AddAttributes(resultAttributes) + ">") @settings.Content @("</" + tagName + ">"); } @using System.Linq @using Dynamicweb.Rapido.Blocks.Components.General @* Component *@ @helper RenderPagination(Dynamicweb.Rapido.Blocks.Components.General.Pagination settings) { var pageNumberQueryStringName = Dynamicweb.Rapido.Services.Pagination.GetPageNumberQueryStringName(settings); // Get the proper 'page number' query string parameter var queryParameters = Dynamicweb.Rapido.Services.Url.GetQueryParameters(pageNumberQueryStringName); // Get the NameValueCollection from the querystring if (settings.NumberOfPages > 1) { string url = HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Authority) + "/Default.aspx"; string ariaLabel = !string.IsNullOrWhiteSpace(settings.AriaLabel) ? settings.AriaLabel : Translate("Page navigation"); Dictionary<string, int> startAndEndPageNumber = Dynamicweb.Rapido.Services.Pagination.GetStartAndEndPageNumber(settings); <div class="pager u-margin-top dw-mod @settings.CssClass" aria-label="@ariaLabel"> @if (settings.ShowPagingInfo) { <div class="pager__info dw-mod"> @Translate("Page") @settings.CurrentPageNumber @Translate("of") @settings.NumberOfPages </div> } <ul class="pager__list dw-mod"> @if (!string.IsNullOrWhiteSpace(settings.FirstPageUrl) && settings.ShowFirstAndLastControls) { @Render(new PaginationItem { Link = settings.FirstPageUrl, Icon = settings.FirstIcon }) } @if (!string.IsNullOrWhiteSpace(settings.PreviousPageUrl) && settings.ShowNextAndPrevControls) { @Render(new PaginationItem { Link = settings.PreviousPageUrl, Icon = settings.PrevIcon }) } @if (settings.GetPages().Any()) { foreach (var page in settings.GetPages()) { @Render(page) } } else { for (var page = startAndEndPageNumber["StartPage"]; page <= startAndEndPageNumber["EndPage"]; page++) { queryParameters = Dynamicweb.Rapido.Services.Url.UpdateQueryStringParameter(queryParameters, pageNumberQueryStringName, page.ToString()); @Render(new PaginationItem { Label = page.ToString(), Link = Dynamicweb.Rapido.Services.Url.BuildUri(url, queryParameters).PathAndQuery, IsActive = (settings.CurrentPageNumber == page) }); } } @if (!string.IsNullOrWhiteSpace(settings.NextPageUrl) && settings.ShowNextAndPrevControls) { @Render(new PaginationItem { Link = settings.NextPageUrl, Icon = settings.NextIcon }) } @if (!string.IsNullOrWhiteSpace(settings.LastPageUrl) && settings.ShowFirstAndLastControls) { @Render(new PaginationItem { Link = settings.LastPageUrl, Icon = settings.LastIcon }) } </ul> </div> } } @helper RenderPaginationItem(PaginationItem settings) { if (settings.Icon == null) { settings.Icon = new Icon(); } settings.Icon.Label = settings.Label; <li class="pager__btn dw-mod"> @if (settings.IsActive) { <span class="pager__num pager__num--current dw-mod"> @Render(settings.Icon) </span> } else { <a href="@settings.Link" class="pager__num dw-mod"> @Render(settings.Icon) </a> } </li> } @using Dynamicweb.Rapido.Blocks.Components.General 2 @using Dynamicweb.Rapido.Blocks.Components.Ecommerce 3 4 5 @using System.Linq 6 @using Dna.Rizzo.Components 7 @using Dynamicweb.Core 8 @using Dynamicweb.Rapido.Blocks.Components.General 9 10 @helper RenderMonthYearField(DateTimeField settings) 11 { 12 if (string.IsNullOrEmpty(settings.Id)) 13 { 14 settings.Id = Guid.NewGuid().ToString("N"); 15 } 16 17 var textField = new TextField { 18 Name = settings.Name, 19 Id = settings.Id, 20 Label = settings.Label, 21 HelpText = settings.HelpText, 22 Value = settings.Value, 23 Disabled = settings.Disabled, 24 Required = settings.Required, 25 ErrorMessage = settings.ErrorMessage, 26 CssClass = settings.CssClass, 27 WrapperCssClass = settings.WrapperCssClass, 28 OnChange = settings.OnChange, 29 OnClick = settings.OnClick, 30 ExtraAttributes = settings.ExtraAttributes, 31 // 32 Placeholder = settings.Placeholder 33 }; 34 35 @Render(textField) 36 37 List<string> jsAttributes = new List<string>(); 38 39 jsAttributes.Add("mode: '" + Enum.GetName(typeof(DateTimeFieldMode), settings.Mode).ToLower() + "'"); 40 41 if (!string.IsNullOrEmpty(settings.DateFormat)) 42 { 43 jsAttributes.Add("dateFormat: '" + settings.DateFormat + "'"); 44 } 45 if (!string.IsNullOrEmpty(settings.MinDate)) 46 { 47 jsAttributes.Add("minDate: '" + settings.MinDate + "'"); 48 } 49 if (!string.IsNullOrEmpty(settings.MaxDate)) 50 { 51 jsAttributes.Add("maxDate: '" + settings.MaxDate + "'"); 52 } 53 if (settings.IsInline) 54 { 55 jsAttributes.Add("inline: " + Converter.ToString(settings.IsInline).ToLower()); 56 } 57 if (settings.EnableTime) 58 { 59 jsAttributes.Add("enableTime: " + Converter.ToString(settings.EnableTime).ToLower()); 60 } 61 if (settings.EnableWeekNumbers) 62 { 63 jsAttributes.Add("weekNumbers: " + Converter.ToString(settings.EnableWeekNumbers).ToLower()); 64 } 65 jsAttributes.Add("plugins: " + "[new monthSelectPlugin({shorthand: true, dateFormat: 'F Y', altFormat: 'F Y'})]"); 66 67 jsAttributes.AddRange(settings.GetFlatPickrOptions().Select(x => x.Key + ": " + x.Value)); 68 69 <script> 70 document.addEventListener("DOMContentLoaded", function () { 71 flatpickr("#@textField.Id", { 72 @string.Join(",", jsAttributes) 73 }); 74 }); 75 </script> 76 } 77 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> @using Dynamicweb.Rapido.Blocks @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> @using Dynamicweb.Rapido.Blocks @RenderBlockList(filesPage.BlocksRoot.BlocksList) @helper RenderPageContainer() { int feedPageId = GetPageIdByNavigationTag("FilesFeed"); string pageUrl = GetGlobalValue("Global:Pageview.Url.Raw"); string feedPageUrl = new Regex("([?&]ID)=[^?&]+").Replace(pageUrl, "?ID=" + feedPageId); <div class="grid grid--align-content-start u-padding js-handlebars-root" id="FilesListContainer" data-template="FilesContainerScript" data-pre-render-template="FilesPreRenderContainer" data-json-feed="@feedPageUrl" data-save-cookie="true" data-preloader="overlay"></div> } @helper RenderFilesContainerScript() { List<Block> subBlocks = this.filesPage.GetBlockListById("FilesContainerScript").OrderBy(item => item.SortId).ToList(); <script id="FilesContainerScript" type="text/x-template"> {{#each .}} @RenderBlockList(subBlocks) {{else}} <div class="grid__col-12"> @Render(new Heading { Level = 2, Title = Translate("Your search gave 0 results"), CssClass = "u-ta-center" }) </div> {{/each}} </script> } @helper RenderFiles() { <div id="Files" data-template="{{listTemplate}}" class="grid product-list grid--external-bleed-x dw-mod" data-save-cookie="true"> {{#Files}} {{> (lookup . 'template') }} {{/Files}} </div> } @helper RenderLoadMore() { int feedPageId = GetPageIdByNavigationTag("FilesFeed"); Button loadMore = new Button { Title = Translate("Load") + " {{pageSize}} " + Translate("more"), OnClick = "LoadMore.Next(this)", ButtonLayout = ButtonLayout.Primary, CssClass = "btn--full {{nextdisabled}}", Disabled = !String.IsNullOrEmpty("{{nextdisabled}}") ? false : true }; loadMore.ExtraAttributes.Add("data-current", "{{currentPage}}"); loadMore.ExtraAttributes.Add("data-page-size", "{{pageSize}}"); loadMore.ExtraAttributes.Add("data-total", "{{totalPages}}"); loadMore.ExtraAttributes.Add("data-container", "Files"); loadMore.ExtraAttributes.Add("data-feed-url", "/Default.aspx?ID=" + feedPageId); @Render(loadMore) @Render(new Button { Title = Translate("Return to top"), ButtonLayout = ButtonLayout.Clean, OnClick = "window.scroll(0, 0)" }) } @helper RenderPreRenderTemplate() { <script id="FilesPreRenderContainer" type="text/x-template"> <div class="grid__col-3"> <div class="pre-render-element pre-render-element--xs"></div> <div class="pre-render-element pre-render-element--md"></div> <div class="pre-render-element pre-render-element--md"></div> <div class="pre-render-element pre-render-element--md"></div> </div> <div class="grid__col-auto"> <div class="pre-render-element pre-render-element--xs"></div> <div class="pre-render-element pre-render-element--xs"></div> <div class="pre-render-element pre-render-element--lg"></div> <div class="pre-render-element pre-render-element--lg"></div> <div class="pre-render-element pre-render-element--lg"></div> <div class="pre-render-element pre-render-element--lg"></div> </div> </script> } @helper RenderJavascript() { int filesFeedPageId = GetPageIdByNavigationTag("FilesFeed"); <script> document.addEventListener("DOMContentLoaded", function (event) { document.getElementById("FilesListContainer").addEventListener('contentLoaded', function (e) { if (getTarget(e).id === "FilesListContainer") { Search.Init(); Facets.Init("selectedFacets", "FilesListContainer"); } }, false); }); function addFileToDownloads(path) { document.getElementById('assetPath').value = path; document.getElementById('DownloadModalTrigger').checked = true; } </script> }