Here it is! But I think issue is in menu generator which generates links to masterpages instead of language layer!
@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
@functions {
BlocksPage productListPage = BlocksPage.GetBlockPage("ProductList");
string favoriteListId = HttpContext.Current.Request.QueryString.Get("ListID");
bool isFavoriteList = !string.IsNullOrEmpty(HttpContext.Current.Request.QueryString.Get("ListID"));
}
@{
Block pageContainer = new Block()
{
Id = "PageContainer",
Template = RenderPageContainer(),
SkipRenderBlocksList = true
};
productListPage.Add(pageContainer);
Block productListNavigation = new Block()
{
Id = "Navigation",
SortId = 20,
Design = new Design
{
RenderType = RenderType.Column,
Size = "3"
}
};
productListPage.Add("PageContainer", productListNavigation);
Block productListContainer = new Block()
{
Id = "ProductList",
SortId = 30,
Template = RenderProductList(),
SkipRenderBlocksList = true,
BlocksList = new List<Block>
{
new Block
{
Id = "ProductListHeader",
SortId = 10,
Design = new Design
{
RenderType = RenderType.Row,
CssClass = "grid--justify-end grid--bleed u-margin-bottom--lg grid--wrap u-flex-grow--0"
},
BlocksList = new List<Block>
{
new Block
{
Id = "ProductListTitle",
SortId = 10,
Design = new Design
{
CssClass = "grid__col-sm-6"
},
Template = RenderProductListTitle()
}
}
}
}
};
productListPage.Add("PageContainer", productListContainer);
if (isFavoriteList)
{
productListPage.Add("ProductListHeader", new Block
{
Id = "FavoriteListSearch",
SortId = 20,
Template = RenderFavoriteListSearch(),
Design = new Design
{
CssClass = "grid__col-sm-6 u-margin-bottom u-margin-top grid--align-self-center"
}
});
}
Block productListSnippets = new Block()
{
Id = "BottomSnippets",
SortId = 40
};
productListPage.Add(productListSnippets);
}
@* This is required for the product list feed to work *@
@GetValue("DoNotRenderProductListTemplate")
@* Include the required Grid builder (Contains the methods @RenderBlockList and @RenderBlock) *@
@Include("../../Components/GridBuilder.cshtml")
@Include("../../Components/GeneralComponents.cshtml")
@Include("../../Components/EcommerceComponents.cshtml")
@* Include the Blocks for the page *@
@Include("Blocks/Products.cshtml")
@Include("Blocks/ViewList.cshtml")
@Include("Blocks/ViewGrid.cshtml")
@Include("Blocks/ViewDetails.cshtml")
@Include("Blocks/Promotions.cshtml")
@Include("Blocks/Menu.cshtml")
@Include("Blocks/Facets.cshtml")
@Include("Blocks/ListMore.cshtml")
@Include("Blocks/BottomSnippets.cshtml")
@Include("Blocks/ListActions.cshtml")
@Include("Blocks/Custom__Blocks.cshtml")
@if (productListNavigation.BlocksList.Count == 0)
{
productListNavigation.Design.RenderType = RenderType.Hide;
}
<form name="multiForm" id="multiForm" method="post" onkeypress="return event.keyCode != 13;">
@* onkeypress is the fix for disabling submit form on Enter key from any field in product list *@
<input type="hidden" name="CartCmd" id="CartCmd" value="addMulti" />
@* The @RenderBlockList base helper is included in Components/GridBuilder.cshtml *@
@RenderBlockList(productListPage.BlocksRoot.BlocksList)
</form>
@helper RenderPageContainer()
{
List<Block> subBlocks = this.productListPage.GetBlockListById("PageContainer").OrderBy(item => item.SortId).ToList();
string pageUrl = GetGlobalValue("Global:Pageview.Url.Raw");
string feedFullUrl = pageUrl + "&feed=true";
feedFullUrl += !isFavoriteList ? "&DoNotShowVariantsAsSingleProducts=True" : "";
string smallDeviceCss = Pageview.Device.ToString() == "Mobile" ? "" : "u-padding";
<div class="grid grid--align-content-start @smallDeviceCss js-handlebars-root" id="productList" data-template="ProductContainer" data-pre-render-template="ProductPreRenderContainer" data-json-feed="@feedFullUrl" data-preloader="overlay"></div>
<script id="ProductContainer" type="text/x-template">
{{#each .}}
@RenderBlockList(subBlocks)
{{else}}
<div class="grid__col-12">
<h2 class="u-ta-center">@Translate("Your search gave 0 results")</h2>
</div>
{{/each}}
</script>
}
@helper RenderProductList()
{
@*This is part of a script template *@
List<Block> subBlocks = productListPage.GetBlockListById("ProductList").OrderBy(item => item.SortId).ToList();
string smallDeviceCss = Pageview.Device.ToString() == "Mobile" ? "u-no-padding" : "";
string columnClass = "auto";
if (productListPage.GetBlockListById("Navigation").Count == 0)
{
columnClass = "12";
}
<div class="grid__col-@columnClass @smallDeviceCss">
@RenderBlockList(subBlocks)
</div>
}
@helper RenderProductListTitle()
{
var header = new Heading { Title = "{{{header}}}", CssClass = "u-no-margin" };
if (isFavoriteList)
{
var selectedFavoriteIcon = Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("FavoriteIcon") != null ? Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("FavoriteIcon").SelectedValue : "star";
header.Icon = new Icon { Prefix = "fas", Name = "fa-" + selectedFavoriteIcon };
}
@Render(header)
}
@helper RenderFavoriteListSearch()
{
string pageId = GetGlobalValue("Global:Page.ID");
string pageUrl = GetGlobalValue("Global:Pageview.Url.Raw");
string feedFullUrl = pageUrl + "&feed=true";
string searchPlaceholder = Translate("Search favorite products");
string searchValue = HttpContext.Current.Request.QueryString.Get("Search") ?? "";
<div class="typeahead u-color-inherit typeahead--favorites js-typeahead" data-page-size="10" id="FavoritesSearch" data-list-id="@favoriteListId" data-search-feed-id="@pageId&feed=true" data-result-page-id="@pageId">
<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="FavoritesSearchContent" data-template="SearchProductsTemplate" data-json-feed="@feedFullUrl&ListID=@favoriteListId" 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>
}