Error executing template "Designs/SermanTipsmark/_parsed/Basic_News.parsed.cshtml"
System.ArgumentException: An item with the same key has already been added.
   at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at Dynamicweb.Ecommerce.Products.GroupRelation.get_GroupRelationsByChildId(String childId)
   at Dynamicweb.Ecommerce.Products.Group.get_IsTopGroup()
   at Dynamicweb.Ecommerce.Shops.Shop.get_TopLevelGroups(String languageId)
   at Dynamicweb.Ecommerce.Frontend.NavigationProviders.GroupNavigationProvider.MakeGroupTree(Page page, NavigationItem parentNode)
   at Dynamicweb.Ecommerce.Frontend.NavigationProviders.GroupNavigationProvider.Process(NavigationItem node)
   at Dynamicweb.Ecommerce.Frontend.NavigationProviders.GroupNavigationProvider.ProcessTree(RootNavigationItem rootNode, NavigationType navigationType)
   at Dynamicweb.Frontend.XmlNavigation.MakeXml(Int32 parentId, Int32 levelStart, Int32 levelStop, Expand expand, Int32 selectedAreaId)
   at Dynamicweb.Frontend.XmlNavigation.GetNavigationHtml(Int32 parentId, Int32 levelStart, Int32 levelStop, Expand expand, String name, String xsltPath, Int32 selectedAreaId, Boolean sitemapMode, NameValueCollection settings, NameValueCollection attributes, IncludeMode mode)
   at Dynamicweb.Frontend.XmlNavigation.GetNavigationHtml(NameValueCollection settings, NameValueCollection attributes)
   at CompiledRazorTemplates.Dynamic.RazorEngine_20c1a029732a4883bd9c79b0f8e154d9.Execute() in C:\Solutions\SermanTipsmark\Live\Web\Files\Templates\Designs\SermanTipsmark\_parsed\Basic_News.parsed.cshtml:line 240
   at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context, TextWriter reader)
   at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
   at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass16_0.b__0(TextWriter writer)
   at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
   at Dynamicweb.Rendering.Template.RenderRazorTemplate()

1 @using System.Globalization 2 @using Dynamicweb.Content 3 @using Dynamicweb.Content.Items 4 @using Dynamicweb.Frontend; 5 @using Newtonsoft.Json 6 @using Newtonsoft.Json.Serialization 7 @using NLWI.Core.Factory 8 @using SermanTipsmark.Web.CustomCode.Items.Settings 9 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 10 <!DOCTYPE html> 11 <html lang="@Pageview.Area.Culture"> 12 <head> 13 14 <meta charset='utf-8' /> 15 <meta name="description" content="@Model.Description" /> 16 <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=5, user-scalable=yes, shrink-to-fit=no" /> 17 <meta http-equiv="x-ua-compatible" content="ie=edge"> 18 <meta name="theme-color" content="#0067a8" /> 19 @Model.MetaTags 20 @if (Model.Area.Item.GetBoolean("NoIndex")) 21 { 22 <!-- TODO: remove on launch--> 23 <meta name="robots" content="noindex, nofollow" /> 24 } 25 @{ 26 var websiteSettings = Item.GetItemById(Model.Area.ItemType, Model.Area.ItemId).ToCodeFirstItem<Websites>(); 27 28 } 29 <title>@Model.Title</title> 30 <link rel="preload" href="@NORRIQ.Common8.Razor.TimestampSource.GetSourceWithTimestamp("/Files/dist/css/SermanTipsmark-min.css")" as="style" /> 31 <link href="@NORRIQ.Common8.Razor.TimestampSource.GetSourceWithTimestamp("/Files/dist/css/SermanTipsmark-min.css")" rel="stylesheet" /> 32 <style type="text/css"> 33 @@media print { 34 .table .thead-dark th, 35 .border-bottom, 36 .table td, 37 .summary > li { 38 color: black; 39 border-color: gray; 40 } 41 a { 42 color: black; 43 text-decoration: none; 44 } 45 .basic_header, 46 .basic_footer, 47 .checkout .btn, 48 .step-list { 49 display: none; 50 } 51 } 52 </style> 53 <!-- <script id="CookieConsent" src="https://policy.app.cookieinformation.com/uc.js" data-culture="@Pageview.Area.CultureInfo.TwoLetterISOLanguageName.ToUpper()" type="text/javascript"></script> --> 54 55 <script id="Cookiebot" src="https://consent.cookiebot.com/uc.js" data-cbid="6728b80b-1637-43f6-beb9-4dbe9b0f742f" data-blockingmode="auto" type="text/javascript"></script> 56 57 58 59 @if (websiteSettings.TrackGoogleTrackManager) 60 { 61 <!-- Google Tag Manager --> 62 <script> 63 (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': 64 new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], 65 j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= 66 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); 67 })(window,document,'script','dataLayer','@websiteSettings.GoogleTrackManager');</script> 68 <!-- End Google Tag Manager --> 69 } 70 @if (websiteSettings.TrackGa) 71 { 72 73 <!-- Google Analytics --> 74 <script async src="https://www.googletagmanager.com/gtag/js?id=@websiteSettings.GoogleGATracking"></script> 75 <script> 76 window.dataLayer = window.dataLayer || []; 77 function gtag(){dataLayer.push(arguments);} 78 gtag('js', new Date()); 79 80 gtag('config', '@websiteSettings.GoogleGATracking'); 81 @if (websiteSettings.TrackAdWords) 82 { 83 <text> 84 gtag('config', '@websiteSettings.GoogleAdWords'); 85 </text> 86 } 87 </script> 88 <!-- End Google Analytics --> 89 90 } 91 <meta name="google-site-verification" content="SaJjE7mf1ymiZ-SUHzOUHxp5EW1q1vNTHFODGrYIwDg" /> 92 93 94 @if (websiteSettings.EnableHeaderScript) 95 { 96 @websiteSettings.HeaderScript 97 } 98 99 <!-- Facebook Pixel Code --> 100 <script> 101 !function(f,b,e,v,n,t,s) 102 {if(f.fbq)return;n=f.fbq=function(){n.callMethod? 103 n.callMethod.apply(n,arguments):n.queue.push(arguments)}; 104 if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0'; 105 n.queue=[];t=b.createElement(e);t.async=!0; 106 t.src=v;s=b.getElementsByTagName(e)[0]; 107 s.parentNode.insertBefore(t,s)}(window,document,'script', 108 'https://connect.facebook.net/en_US/fbevents.js'); 109 fbq('init', '259009103521898'); 110 fbq('track', 'PageView'); 111 </script> 112 <noscript> 113 <img height="1" width="1" 114 src="https://www.facebook.com/tr?id=259009103521898&ev=PageView 115 &noscript=1"/> 116 </noscript> 117 <!-- End Facebook Pixel Code --> 118 119 </head> 120 <body> 121 <div id="app"> 122 <header class="basic_header bg-primary w-100 position-relative elevation-3"> 123 @{ 124 string basicHeaderPrefix = "Header "; 125 } 126 @if (Pageview.User != null) 127 { 128 <div class="basic_header-top bg-primary text-white py-1"> 129 <div class="container d-flex justify-content-end align-items-center"> 130 <p class="font-size-xs nowrap"> 131 <b-icon-person-fill class="mr-1"></b-icon-person-fill> 132 <span class="mr-1 nowrap ellipsis">@Pageview.User.Name</span> 133 <span class="mr-1">-</span> 134 <a href="/admin/public/extranetlogoff.aspx?ID=@(NORRIQ.Common8.Razor.Navigation.GetPageIdByNavigationTag("home"))" class="text-light" v-clear-cache:click.user.cart>@Translate(basicHeaderPrefix + "Sign out", "Sign out")</a> 135 </p> 136 </div> 137 </div> 138 } 139 <div class="basic_header-main position-relative"> 140 <div class="container d-flex justify-content-between align-items-center"> 141 <a href="@Translate(basicHeaderPrefix + "logo url", "/")" class="basic_header-logo d-flex align-items-center py-3" title="@Translate(basicHeaderPrefix + "Go to frontpage", "Go to frontpage")"> 142 @if (Model.Area.Item.GetFile("Logo") != null) 143 { 144 <img class="img-fluid" src="@Model.Area.Item.GetFile("Logo")" alt="@Translate(basicHeaderPrefix + "Website Logo Alttext", "Website Logo Alttext")" /> 145 } 146 else 147 { 148 <i>@Translate(basicHeaderPrefix + "No logo found", "No logo found, please configure it in the Dynamicweb Administration")</i> 149 } 150 </a> 151 <form class="basic_header-search position-relative d-flex justify-content-end flex-grow-1" action="/Default.aspx"> 152 <input name="Id" type="hidden" value="@NORRIQ.Common8.Razor.Navigation.GetPageIdByNavigationTag("searchresult")"> 153 <label for="productsearch" class="sr-only">@Translate(basicHeaderPrefix + "Search", "Search")</label> 154 <input type="search" class="form-control position-relative border-0" placeholder="@Translate(basicHeaderPrefix + "Search", "Search")" id="productsearch" name="productsearch"> 155 <button type="submit" class="btn btn-square position-absolute position-top-right" aria-label="@Translate(basicHeaderPrefix + "Search", "Search")"> 156 <b-icon-search font-scale="1.25"></b-icon-search> 157 </button> 158 </form> 159 <div class="basic_header-functions d-flex align-items-center"> 160 <button type="button" 161 class="btn btn-square btn-burger" 162 aria-label="@Translate(basicHeaderPrefix + "Open main navigation", "Open main navigation")" 163 v-b-toggle.basic_navigation> 164 <b-icon-list font-scale="2" style="margin-top:4px;"></b-icon-list> 165 </button> 166 <b-dropdown variant="square" right no-caret id="langSelector"> 167 <template v-slot:button-content> 168 <img src="@Pageview.Area.Flag32X32" alt="@Pageview.Area.CultureInfo.EnglishName" /> 169 <span class="sr-only">@Pageview.Area.CultureInfo.EnglishName</span> 170 </template> 171 <template> 172 @{ 173 var groupId = System.Web.HttpContext.Current.Request["GroupId"]; 174 var productId = System.Web.HttpContext.Current.Request["ProductId"]; 175 var variantId = System.Web.HttpContext.Current.Request["VariantId"]; 176 } 177 @foreach (var lang in Model.Languages) 178 { 179 var langCode = lang.Culture.Split('-').Last(); 180 var cultureInfo = CultureInfo.GetCultureInfo(lang.Culture); 181 var language = cultureInfo.NativeName.Split('(')[0]; 182 language = cultureInfo.TextInfo.ToTitleCase(language); 183 var url = $"/Default.aspx?Id={lang.Page.ID}"; 184 var query = System.Web.HttpUtility.ParseQueryString(System.Web.HttpContext.Current.Request.QueryString.ToString()); 185 query.Remove("Id"); 186 query.Remove("GroupId"); 187 query.Remove("ProductId"); 188 query.Remove("VariantId"); 189 if (!string.IsNullOrWhiteSpace(groupId)) 190 { 191 url += $"&GroupId={groupId}"; 192 } 193 if (!string.IsNullOrWhiteSpace(productId)) 194 { 195 url += $"&ProductId={productId}"; 196 } 197 if (!string.IsNullOrWhiteSpace(variantId)) 198 { 199 url += $"&VariantId={variantId}"; 200 } 201 var urlencodedQuery = url; 202 if (query.HasKeys()) 203 { 204 urlencodedQuery += "&" + query.ToString(); 205 206 } 207 <b-dropdown-item href="@urlencodedQuery" link-class="d-flex align-items-center"><img src="@($"/Admin/Images/Flags/flag_{langCode}.png")" alt="@Translate(basicHeaderPrefix + language, language)" /><span class="font-size-sm ml-2">@Translate(basicHeaderPrefix + language, language)</span></b-dropdown-item> 208 } 209 @*<b-dropdown-item href="/admin/public/extranetlogoff.aspx?ID=@(NORRIQ.Common8.Razor.Navigation.GetPageIdByNavigationTag("home"))" v-clear-cache:click.user.cart class="border-top bg-light">@Translate(basicHeaderPrefix + "Sign out", "Sign out")</b-dropdown-item>*@ 210 </template> 211 </b-dropdown> 212 @if (Pageview.User == null) 213 { 214 <a href="@NORRIQ.Common8.Razor.Navigation.GetUrlByNavigationTag("selfservice")" class="btn btn-square" aria-label="@Translate(basicHeaderPrefix + "Login", "Login")"> 215 <b-icon-person font-scale="2"></b-icon-person> 216 </a> 217 } 218 else 219 { 220 <b-dropdown variant="square" right no-caret> 221 <template v-slot:button-content> 222 <b-icon-person font-scale="2"></b-icon-person> 223 <span class="sr-only">User</span> 224 </template> 225 <template> 226 @RenderNavigation(new { Template = "dropdown.xslt", Expandmode = "all", StartLevel = 1, EndLevel = 4, NavigationTag = "selfservice" }) 227 @*<b-dropdown-item href="/admin/public/extranetlogoff.aspx?ID=@(NORRIQ.Common8.Razor.Navigation.GetPageIdByNavigationTag("home"))" v-clear-cache:click.user.cart class="border-top bg-light">@Translate(basicHeaderPrefix + "Sign out", "Sign out")</b-dropdown-item>*@ 228 </template> 229 </b-dropdown> 230 } 231 @if (Pageview.User != null) 232 { 233 <cart-icon cartlink="@NORRIQ.Common8.Razor.Navigation.GetUrlByNavigationTag("checkout")"></cart-icon> 234 } 235 </div> 236 </div> 237 </div> 238 <template> 239 <b-sidebar id="basic_navigation" tag="nav" bg-variant="nav" text-variant="nav" backdrop body-class="container"> 240 @RenderNavigation(new { Template = "basic_Header.xslt", Expandmode = "all", StartLevel = 1, EndLevel = 4 }) 241 </b-sidebar> 242 </template> 243 </header> 244 @using Dynamicweb.Frontend; 245 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 246 247 @Title("Page") 248 @Description("Default page template") 249 @if (Pageview.IsCurrentUserAllowed) 250 { 251 string columns = !string.IsNullOrEmpty(Model.Item.GetValue<ListViewModel>("Columns").SelectedValue) ? Model.Item.GetValue<ListViewModel>("Columns").SelectedValue : "d-grid-12"; 252 //string width = !string.IsNullOrEmpty(Model.Item.GetValue<ListViewModel>("Width").SelectedValue) ? Model.Item.GetValue<ListViewModel>("Width").SelectedValue : "container-5"; 253 <main class="d-block"> 254 <nav class="page-nav bg-200"> 255 <div class="container d-flex justify-content-start align-items-center"> 256 <button type="button" 257 class="btn btn-sidebar btn-square border rounded btn-sm mr-3" 258 v-b-toggle.sidebar-navigation 259 aria-label="@Translate("Toggle sidebar", "Toogle Sidebar")"> 260 <span class="arrow-left"></span> 261 </button> 262 @RenderNavigation(new { Template = "basic_Breadcrumb.xslt", Expandmode = "all", StartLevel = 1, EndLevel = 5 }) 263 </div> 264 </nav> 265 @if (Model.Item.GetFile("TopImage") != null) 266 { 267 <figure class="container"> 268 <img src="@Model.Item.GetFile("TopImage").Path" 269 alt="@Model.Item.GetString("Title")" 270 class="img-fluid" 271 loading="lazy" /> 272 </figure> 273 } 274 <div class="container py-4"> 275 <section class="layout"> 276 277 <header class="d-flex justify-content-between align-items-center pb-4"> 278 <h1>@Model.Item.GetString("Title")</h1> 279 </header> 280 <div class="@columns"> 281 @Model.Placeholder("Content", "Content", "unwrap:true;default:true") 282 </div> 283 </section> 284 </div> 285 </main> 286 } 287 288 <footer class="basic_footer py-4"> 289 @{ 290 var imageLinks = Model.Area.Item.GetItems("ImageLinks").Where(s => s.GetFile("Image") != null); 291 } 292 <div class="container d-grid-3-3-3-3"> 293 @if (!string.IsNullOrEmpty(Model.Area.Item.GetString("FooterOneTitle")) && !string.IsNullOrEmpty(Model.Area.Item.GetString("FooterOneText"))) 294 { 295 <div class="basic_footer-box mt-0"> 296 <b-button variant="footer" v-b-toggle.footer-one> 297 @Model.Area.Item.GetString("FooterOneTitle") 298 <span class="plus-minus"></span> 299 </b-button> 300 <b-collapse id="footer-one"> 301 <div class="flow-2 font-size-sm"> 302 @Model.Area.Item.GetString("FooterOneText") 303 </div> 304 </b-collapse> 305 </div> 306 } 307 @if (!string.IsNullOrEmpty(Model.Area.Item.GetString("FooterTwoTitle")) && !string.IsNullOrEmpty(Model.Area.Item.GetString("FooterTwoText"))) 308 { 309 <div class="basic_footer-box mt-0"> 310 <b-button variant="footer" v-b-toggle.footer-two> 311 @Model.Area.Item.GetString("FooterTwoTitle") 312 <span class="plus-minus"></span> 313 </b-button> 314 <b-collapse id="footer-two"> 315 <div class="flow-2 font-size-sm"> 316 @Model.Area.Item.GetString("FooterTwoText") 317 </div> 318 </b-collapse> 319 </div> 320 } 321 @if (!string.IsNullOrEmpty(Model.Area.Item.GetString("FooterThreeTitle")) && !string.IsNullOrEmpty(Model.Area.Item.GetString("FooterThreeText"))) 322 { 323 <div class="basic_footer-box mt-0"> 324 <b-button variant="footer" v-b-toggle.footer-three> 325 @Model.Area.Item.GetString("FooterThreeTitle") 326 <span class="plus-minus"></span> 327 </b-button> 328 <b-collapse id="footer-three"> 329 <div class="flow-2 font-size-sm"> 330 @Model.Area.Item.GetString("FooterThreeText") 331 </div> 332 </b-collapse> 333 </div> 334 } 335 @if (!string.IsNullOrEmpty(Model.Area.Item.GetString("FooterFourTitle")) && !string.IsNullOrEmpty(Model.Area.Item.GetString("FooterFourText"))) 336 { 337 <div class="basic_footer-box mt-0"> 338 <b-button variant="footer" v-b-toggle.footer-four> 339 @Model.Area.Item.GetString("FooterFourTitle") 340 <span class="plus-minus"></span> 341 </b-button> 342 <b-collapse id="footer-four"> 343 <div class="flow-2 font-size-sm"> 344 @Model.Area.Item.GetString("FooterFourText") 345 </div> 346 </b-collapse> 347 </div> 348 } 349 </div> 350 351 @if (!string.IsNullOrEmpty(Model.Area.Item.GetString("FooterCopyright")) || imageLinks != null && imageLinks.Any()) 352 { 353 354 <div class="basic_footer-sub container pt-4 d-flex align-items-center"> 355 @if (!string.IsNullOrEmpty(Model.Area.Item.GetString("FooterCopyright"))) 356 { 357 <p class="font-size-xs"> 358 &copy; @DateTime.Now.Year @Model.Area.Item.GetString("FooterCopyright") 359 </p> 360 } 361 @if (imageLinks != null && imageLinks.Any()) 362 { 363 <div class="basic_footer-imagelinks d-flex align-items-center"> 364 @foreach (var item in imageLinks) 365 { 366 string target = item.GetString("Url").Contains("http") ? "_blank" : "_self"; 367 string rel = item.GetString("Url").Contains("http") ? "noreferrer noopener" : ""; 368 <a href="@item.GetString("Url")" class="d-inline-flex align-items-center p-1" rel="@rel" target="@target" title="@item.GetString("Title")"> 369 <img src="@item.GetFile("Image").Path" class="img-fluid" width="32" alt="@item.GetString("Title")" /> 370 </a> 371 } 372 </div> 373 } 374 </div> 375 } 376 </footer> 377 </div> 378 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 379 380 <script type="text/x-template" id="cart-icon-template"> 381 @{ 382 string cartIconPrefix = "Minicart "; 383 } 384 <a :href="cartlink" class="btn btn-square"> 385 <b-icon-cart3 font-scale="1.65"></b-icon-cart3> 386 <span class="sr-only">@Translate(cartIconPrefix + "Checkout", "Checkout")</span> 387 <span v-if="!cartEmpty" class="cart-quantity d-flex align-items-center justify-content-center">{{quantity}}</span> 388 </a> 389 </script> 390 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 391 392 <script type="text/x-template" id="basic-facet-filter-template"> 393 @{ 394 string basicFacetPrefix = "Filter "; 395 } 396 <div v-if="!queryLoading && !error && facetFilters" class="facets" id="sidebar-filter"> 397 398 399 400 <div class="facet-collapse" v-if="HasActiveFilter()"> 401 <p id="selected-filter-label" class="btn btn-collapse"> 402 @Translate(basicFacetPrefix + "Active", "Active") 403 </p> 404 <div class="pb-3 flow-2" aria-labelledby="selected-filter-label"> 405 <template v-for="facetFilter in facetFilters"> 406 <div v-for="option in SelectedOptions(facetFilter)" class="custom-control"> 407 <input type="checkbox" 408 :id="'Selected-' + facetFilter.name + '-' + option.name" 409 :name="facetFilter.name" 410 :value="option.value" 411 :v-model="option.selected" 412 :checked="option.selected" 413 v-on:click="ToggleFilter(facetFilter.queryParameter,option)" 414 class="custom-control-input" /> 415 <label :for="'Selected-' + facetFilter.name + '-' + option.name" class="custom-facet-label"> 416 <b-icon-x-circle-fill></b-icon-x-circle-fill> 417 <span> 418 {{facetFilter.name}}: {{option.label}} 419 </span> 420 </label> 421 </div> 422 </template> 423 </div> 424 </div> 425 <div class="facet-collapse" v-for="(facetFilter, index) in facetFilters"> 426 <b-button variant="collapse" v-b-toggle="'filter-group-' + facetFilter.name.replace(/\s/g, '').toLowerCase()"> 427 <span>{{facetFilter.name}}</span> 428 <span class="arrow-down"></span> 429 </b-button> 430 <b-collapse :id="'filter-group-' + facetFilter.name.replace(/\s/g, '').toLowerCase()" :visible="ShowGroupIfSelected(facetFilter.options, index)"> 431 <div class="py-3 flow-2"> 432 <template v-if="facetFilter.options.length > 5"> 433 <div v-for="option in facetFilter.options.slice(0, 5)" class="custom-control custom-checkbox"> 434 <input type="checkbox" class="custom-control-input" 435 :id="'UnSelected-' + facetFilter.name + '-' + option.name" 436 :name="facetFilter.name" 437 :value="option.value" 438 :v-model="option.selected" 439 :checked="option.selected" 440 v-on:click="ToggleFilter(facetFilter.queryParameter,option)" /> 441 <label :for="'UnSelected-' + facetFilter.name + '-' + option.name" class="custom-control-label"> 442 {{option.label}}<span class="count">({{option.count}})</span> 443 </label> 444 </div> 445 <b-collapse class="basic_filter-expand flow-2" :id="'filter-expand-' + facetFilter.name.replace(/\s/g, '').toLowerCase()" :visible="ShowMoreIfSelected(facetFilter.options, index)"> 446 <div v-for="option in facetFilter.options.slice(5)" class="custom-control custom-checkbox facet-option"> 447 <input type="checkbox" class="custom-control-input" 448 :id="'UnSelected-' + facetFilter.name + '-' + option.name" 449 :name="facetFilter.name" 450 :value="option.value" 451 :v-model="option.selected" 452 :checked="option.selected" 453 v-on:click="ToggleFilter(facetFilter.queryParameter,option)" /> 454 <label :for="'UnSelected-' + facetFilter.name + '-' + option.name" class="custom-control-label"> 455 {{option.label}} <span class="count">({{option.count}})</span> 456 </label> 457 </div> 458 </b-collapse> 459 <a v-b-toggle="'filter-expand-' + facetFilter.name.replace(/\s/g, '').toLowerCase()" class="btn btn-inline" v-if="facetFilter.options.length > 5"> 460 <span class="plus-minus"></span> 461 <span class="show-more">@Translate(basicFacetPrefix + "show more", "show more")</span> 462 <span class="show-less">@Translate(basicFacetPrefix + "show less", "show less")</span> 463 </a> 464 </template> 465 <template v-else> 466 <div v-for="option in facetFilter.options" class="custom-control custom-checkbox"> 467 <input type="checkbox" class="custom-control-input" 468 :id="'UnSelected-' + facetFilter.name + '-' + option.name" 469 :name="facetFilter.name" 470 :value="option.value" 471 :v-model="option.selected" 472 :checked="option.selected" 473 v-on:click="ToggleFilter(facetFilter.queryParameter,option)" /> 474 <label :for="'UnSelected-' + facetFilter.name + '-' + option.name" class="custom-control-label"> 475 {{option.label}} 476 </label> 477 </div> 478 </template> 479 </div> 480 </b-collapse> 481 </div> 482 483 </div> 484 </script> 485 486 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 487 <script type="text/x-template" id="add-to-basket-simple-template"> 488 @{ 489 string addToBasketSimplePrifix = "BuyButton "; 490 } 491 <div v-if="!isB2C"> 492 <label :for="'quantity-' + productId" class="sr-only">@Translate(addToBasketSimplePrifix + "Quantity", "Quantity")</label> 493 <input @@focus="$event.target.select()" :class="['form-control form-quantity', inputClass]" type="tel" name="quantity" :id="'quantity-' + productId" v-model="quantity" autocomplete="off" onclick="this.setSelectionRange(0, this.value.length)"> 494 <button :disabled="quantity < 1" :class="['btn', buttonClass, {added: IsAdded}, {adding: IsAdding}]" v-on:click="addToBasketAndResetQuantity()" aria-label="@Translate(addToBasketSimplePrifix + "Add to Basket", "Add to Basket")"> 495 <slot> 496 <b-icon-cart3></b-icon-cart3> 497 <span v-if="buttonLabel">{{buttonLabel}}</span> 498 </slot> 499 </button> 500 </div> 501 </script> 502 503 <script type="text/x-template" id="quick-add-template"> 504 @{ 505 string quickAddPrifix = "BuyButton "; 506 } 507 <div v-if="!isB2C" v-bind:class="[{added: IsAdded}, {adding: IsAdding}]"> 508 <label for="quantity">@Translate(quickAddPrifix + "Quantity", "Quantity")</label> 509 <input class="form-control" type="number" id="quantity" name="quantity" v-model="quantity" autocomplete="off"> 510 </div> 511 </script> 512 513 <script type="text/x-template" id="add-to-basket-button-only-template"> 514 @{ 515 string addToBasketPrefix = "BuyButton "; 516 } 517 <div v-if="!isB2C"> 518 <button :class="['btn', buttonClass, {added: IsAdded}, {adding: IsAdding}]" v-on:click="addToBasket()"> 519 <slot> 520 <b-icon-cart3></b-icon-cart3> 521 <span>@Translate(addToBasketPrefix + "Add to basket", "Add to basket")</span> 522 </slot> 523 </button> 524 </div> 525 </script> 526 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 527 <script type="text/x-template" id="async-price-template"> 528 @{ 529 string asyncPrefix = "Async "; 530 } 531 <div :class="'async' + (loading && !onlyStock ? ' loading text-center' : '')"> 532 <template v-if="error"> 533 <p class="text-danger font-weight-bold">{{error}}</p> 534 </template> 535 <template v-if="!onlyPrice && !error"> 536 @*<div class="d-flex align-items-center flex-wrap font-size-xs" >*@ 537 <template v-if="!loading && price && !hasStock"> 538 <p class="stock out-of-stock"> 539 <link itemprop="availability" href="http://schema.org/SoldOut" /> 540 @Translate(asyncPrefix + "Out Of Stock", "Out Of Stock") 541 </p> 542 <p class="text-muted font-size-xs"> 543 <template v-if="outOfStockText && outOfStockText !=''"> 544 {{outOfStockText}} 545 </template> 546 <template v-else> 547 <a href="@NORRIQ.Common8.Razor.Navigation.GetUrlByNavigationTag("service-contact")" style="z-index:10;">@Translate(asyncPrefix + "Contact Service", "Contact Service")</a> 548 </template> 549 </p> 550 </template> 551 @*</div>*@ 552 <p class="stock in-stock" v-if="!loading && price && hasStock && !isB2C"> 553 <link itemprop="availability" href="http://schema.org/InStock" /> 554 @Translate(asyncPrefix + "In Stock", "In Stock") ({{ productStockAmount }}) 555 </p> 556 <p class="stock in-stock" v-if="!loading && price && hasStock && isB2C"> 557 <link itemprop="availability" href="http://schema.org/InStock" /> 558 @Translate(asyncPrefix + "In Stock", "In Stock") 559 </p> 560 </template> 561 <template v-if="!onlyStock && !isB2C"> 562 <div v-if="!loading && price" class="price-settings"> 563 <div class="price"> 564 <p :class="'unit-price ' + classType" itemprop="priceCurrency" :content="price.unitPrice?.currencyKey"> 565 <span itemprop="price" :content="unitPrice">{{ netUnitPriceString | currency }}</span> 566 </p> 567 @if (Pageview.User != null) 568 { 569 <template v-if="savingsPercentage != 0"> 570 <p class="list-price">{{ defaultUnitPriceString | currency }}</p> 571 </template> 572 573 } 574 </div> 575 @if (Pageview.User != null) 576 { 577 <template v-if="savingsPercentage != 0"> 578 <div class="ml-4"> 579 <span class="badge size-2 bg-success text-white">{{savingsPercentage}}%</span> 580 </div> 581 </template> 582 } 583 </div> 584 </template> 585 </div> 586 </script> 587 588 589 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 590 591 @{ 592 string relatedProductsPrefix = "Related Products "; 593 } 594 595 596 <script type="text/x-template" id="related-products-template"> 597 598 <section class="related plp grid-view"> 599 <header> 600 <h2 class="text-center"> 601 {{header}} 602 </h2> 603 </header> 604 <div class="related-products products"> 605 <article v-for="product in relatedProducts"> 606 <a :href="product.url" class="position-relative"> 607 <figure class="d-flex justify-content-center align-items-center border p-2" style="min-height:1px;"> 608 <img :src="imageUrl(product)" 609 :alt="product.name" 610 itemprop="image" 611 class="img-fluid" /> 612 </figure> 613 <header class="flow-1"> 614 <h1 class="font-size-lg text-dark">{{product.name}}</h1> 615 <p class="font-size-xs text-800">@Translate(relatedProductsPrefix + "Product Number", "Product Number") {{product.number}}</p> 616 <async-price class-type="asyncprice-plp" 617 :default-price-without-vat="product.price?.priceWithoutVat" 618 :default-price-with-vat="product.price?.priceWithVat" 619 :product-id="product.number" 620 :variant-id="product.variantId" 621 unit-of-measure="" 622 only-stock="true" 623 :dw-stock-amount="product.stockAmount" 624 :out-of-stock-text="product.outOfStockText"> 625 </async-price> 626 </header> 627 </a> 628 <footer class="flow-3"> 629 <async-price class-type="asyncprice-plp" 630 :default-price-without-vat="product.price?.priceWithoutVat" 631 :default-price-with-vat="product.price?.priceWithVat" 632 :product-id="product.number" 633 :variant-id="product.variantId" 634 unit-of-measure="" 635 only-price="true" 636 :dw-stock-amount="product.stockAmount" 637 :out-of-stock-text="product.outOfStockText"> 638 </async-price> 639 <div class="buy-settings position-relative"> 640 @if (Pageview.User != null) 641 { 642 <favorite-lists :is-favorite-mode="@NORRIQ.Common8.Razor.Navigation.GetPageIdByNavigationTag("favorites") == @Pageview.ID" 643 :product="product" 644 button-class="border btn-square mr-2"></favorite-lists> 645 } 646 <add-to-basket-simple class="d-flex align-items-center" 647 :product-id="product.id" 648 :variant-id="product.variantId" 649 :unit-of-measure="product.defaultUnitId" 650 :language-id="product.languageId" 651 button-class="btn-primary px-3 ml-2" 652 input-class="text-center" 653 :product-name="product.name" 654 :product-number="product.number" 655 :price="product.price" 656 button-label=""> 657 </add-to-basket-simple> 658 </div> 659 @*<add-to-basket-button-only product-id="product.id" 660 variant-id="product.variantId" 661 unit-of-measure="STK" 662 button-class="btn-primary" 663 input-class="form-control-lg text-center px-1" 664 button-label="@Translate(relatedProductsPrefix + "Add to basket", "Add to basket")"> 665 </add-to-basket-button-only>*@ 666 </footer> 667 </article> 668 </div> 669 </section> 670 </script> 671 672 673 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 674 675 <script type="text/x-template" id="pagination-template"> 676 @{ 677 string paginationPrefix = "Pagination "; 678 } 679 <footer class="d-flex justify-content-center align-items-center pt-4"> 680 <nav aria-label="@Translate(paginationPrefix + "Produktliste pagination", "Produktliste pagination")"> 681 <ul class="pagination"> 682 <li :class="['page-item', currentPage == 1 ? 'disabled' : '' ]"> 683 <a class="btn btn-square btn-sm" v-on:click="togglePrevPage()" aria-label="@Translate(paginationPrefix + "Previous Page", "Previous Page")" v-bind:aria-disabled="currentPage > 1 ? 'true' : null"> 684 <b-icon-chevron-left></b-icon-chevron-left> 685 </a> 686 </li> 687 <template v-if="hasGroupId"> 688 <li class="btn btn-sm " v-for="n in totalPages" :key="n" :class="(n == currentPage ? ' is-active' : '')"> 689 <a v-on:click="togglePage(n)" v-bind:aria-current="(n == currentPage ? 'aria-page' : '')" class="page-link"> 690 {{n}} 691 </a> 692 </li> 693 </template> 694 <template v-else> 695 <li class="btn btn-square btn-sm "> 696 <span class="page-label"> 697 {{currentPage}} 698 </span> 699 </li> 700 <li class="btn btn-sm btn-square"> 701 <span class="page-label"> 702 @Translate("of") 703 </span> 704 </li> 705 <li class="btn btn-square btn-sm "> 706 <span class="page-label"> 707 {{totalPages}} 708 </span> 709 </li> 710 </template> 711 <li :class="'page-item' + (currentPage >= totalPages ? ' disabled' : '')"> 712 <a v-on:click="toggleNextPage()" aria-label="@Translate(paginationPrefix + "Next Page", "Next Page")" class="btn btn-square btn-sm" v-bind:aria-disabled="totalPages > currentPage ? 'true' : null"> 713 <b-icon-chevron-right></b-icon-chevron-right> 714 </a> 715 </li> 716 </ul> 717 </nav> 718 </footer> 719 </script> 720 721 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 722 @{ 723 //This template contains everything for the favoritelist items. 724 string favoriteListPrefix = "FavoriteList "; 725 } 726 <span id="favoritelistitem_confirm_delete_on_all" style="display: none; visibility: hidden">@Translate(favoriteListPrefix + "_confirm_delete_all", "Er du sikker på at du vil fjerne produktet {0} fra alle lister ?")</span> 727 728 <script type="text/x-template" id="favorite-item-template"> 729 @*<div class="basic_favoriteitem">*@ 730 <div class="custom-control custom-checkbox"> 731 <input type="checkbox" :checked="isActive" v-on:change="toggleItem()" :id="'fav-' +favoriteList.id" class="custom-control-input"/> 732 <label :for="'fav-' + favoriteList.id" class="custom-control-label"> 733 {{favoriteList.name}} 734 </label> 735 736 @*<input type="checkbox" :value="favoriteList.id" :checked="isItemAddedToThisList(favoriteList)" v-on:change="toggleItem($event, favoriteList.id)" class="form-check-input" /> 737 <label :for="'fav-' + favoriteList.id" class="form-check-label"> 738 {{favoriteList.name}} 739 </label>*@ 740 </div> 741 @*</div>*@ 742 </script> 743 744 <script type="text/x-template" id="favorite-list-template"> 745 <div class="fav"> 746 <button :aria-controls="'favorite' + product.id" :class="['btn', buttonClass]" aria-label="@Translate(" Favorite", "Favorite" )" v-on:click="toggleItem()"> 747 <template v-if="isActive"> 748 <b-icon-star-fill class="font-size-lg"></b-icon-star-fill> 749 </template> 750 <template v-else> 751 <b-icon-star></b-icon-star> 752 </template> 753 </button> 754 <div class="fav-overlay" v-autoClose.nonPath="closeToggle" :id="'favorite' + product.id"> 755 <div class="fav-inwrap" v-if="showingMenu"> 756 <template v-if="loading"> 757 <div class="text-center"> 758 <span class="spinner-md-default"></span> 759 </div> 760 </template> 761 <div class="flow-3" v-if="!loading"> 762 <h5 class="m-0">@Translate(favoriteListPrefix + "Favoritliste", "Favoritliste")</h5> 763 <template v-if="favoriteLists.length > '0'"> 764 <p class="font-size-sm text-600"> 765 @Translate(favoriteListPrefix + "Tilføj eller fjern markering.", "Tilføj eller fjern markering.") 766 </p> 767 <div class="flow-2 pb-3 border-bottom"> 768 <favorite-item v-for="favoriteList in favoriteLists" :favorite-list="favoriteList" :product="product" :key="favoriteList.id" /> 769 </div> 770 <div class="custom-control custom-checkbox"> 771 <input type="checkbox" v-model="addNewList" id="addNewListCheckbox" class="custom-control-input" /> 772 <label for="addNewListCheckbox" class="custom-control-label"> 773 @Translate(favoriteListPrefix + "Ny favoritliste", "Ny favoritliste") 774 </label> 775 </div> 776 <div v-if="addNewList" class="d-flex align-items-center"> 777 <label for="addNewListNameInput" class="sr-only">@Translate(favoriteListPrefix + "Navn", "Navn")</label> 778 <input type="text" id="addNewListNameInput" v-model="addNewListNameInput" class="form-control new-list-name-input" placeholder="@Translate(favoriteListPrefix + "Navn", "Navn")" v-on:keyup.enter="saveAsNewList" /> 779 <button v-on:click="saveAsNewList" class="btn btn-dark ml-2 px-3">@Translate(favoriteListPrefix + "Gem", "Gem")</button> 780 </div> 781 </template> 782 <template v-else> 783 <p>@Translate(favoriteListPrefix + "NoFavoritliste", "Du har endnu ingen favoritlister, angiv navn for at oprette en.")</p> 784 <div class="d-flex align-items-center"> 785 <label for="addNewListNameInput" class="sr-only">@Translate(favoriteListPrefix + "Navn", "Navn")</label> 786 <input type="text" id="addNewListNameInput" v-model="addNewListNameInput" class="form-control new-list-name-input" placeholder="@Translate(favoriteListPrefix + "Navn", "Navn")" v-on:keyup.enter="saveAsNewList" /> 787 <button v-on:click="saveAsNewList" class="btn btn-dark ml-2 px-3">@Translate(favoriteListPrefix + "Gem", "Gem")</button> 788 </div> 789 </template> 790 791 </div> 792 </div> 793 </div> 794 </div> 795 </script> 796 797 <script src="@NORRIQ.Common8.Razor.TimestampSource.GetSourceWithTimestamp("/Files/dist/scripts/bundle.min.js")"></script> 798 @{ 799 var user = NORRIQ.Universal.Identity.Dw.UserViewModel.GetCurrentUser<NORRIQ.Universal.Identity.Dw.UserViewModel>(); 800 var userJson = JsonConvert.SerializeObject(user); 801 var currency = Pageview.User?.Currency ?? Pageview.Area.EcomCurrencyId; 802 } 803 <script> 804 AppStart.VueProvider.init({ 805 webApiUrl: '@System.Web.Configuration.WebConfigurationManager.AppSettings["WebApiUrl"]', 806 currencyCode: '@currency', 807 locale: '@Pageview.Area.Culture', 808 currencyLeft: true, 809 currencySpacing: true, 810 currencySymbol: '@currency', 811 currencyDecimalSeparator: ',', 812 currencyGroupSeparator: '.', 813 currencyDecimalDigits: 2, 814 dateFormatShort: '@Pageview.Area.Dateformat', 815 user: @userJson 816 }); 817 </script> 818 <script append="replace"></script> 819 <script type="text/javascript"> 820 _linkedin_partner_id = "5568962"; 821 window._linkedin_data_partner_ids = window._linkedin_data_partner_ids || []; 822 window._linkedin_data_partner_ids.push(_linkedin_partner_id); 823 </script><script type="text/javascript"> 824 (function(l) { 825 if (!l){window.lintrk = function(a,b){window.lintrk.q.push([a,b])}; 826 window.lintrk.q=[]} 827 var s = document.getElementsByTagName("script")[0]; 828 var b = document.createElement("script"); 829 b.type = "text/javascript";b.async = true; 830 b.src = "https://snap.licdn.com/li.lms-analytics/insight.min.js"; 831 s.parentNode.insertBefore(b, s);})(window.lintrk); 832 </script> 833 <noscript> 834 <img height="1" width="1" style="display:none;" alt="" src="https://px.ads.linkedin.com/collect/?pid=5568962&fmt=gif" /> 835 </noscript> 836 837 </body> 838 </html> 839