Error executing template "Designs/Swift/_parsed/Swift_ProductListComponentEdit.parsed.cshtml"
System.IO.FileLoadException: Could not load file or assembly 'dotless.Core, Version=1.6.7.0, Culture=neutral, PublicKeyToken=96b446c9e63eae34' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
File name: 'dotless.Core, Version=1.6.7.0, Culture=neutral, PublicKeyToken=96b446c9e63eae34'
at Dna.Optimizer.Renderer.RenderStyles(OptimizerSettings settings)
at CompiledRazorTemplates.Dynamic.RazorEngine_9c010b14835d4b9faab7c81d073e1f8c.Execute() in F:\Domains\Sites\swiftrizzo.mydwsite3.com\Files\Templates\Designs\Swift\_parsed\Swift_ProductListComponentEdit.parsed.cshtml:line 87
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()
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
1 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel>
2 @using System.Linq
3 @using Dna.Optimizer
4 @using Dynamicweb
5 @using Dynamicweb.Environment
6
7 @functions {
8 string GetCookieOptInPermission(string category)
9 {
10 bool categoryOrAllGranted = false;
11
12 if (CookieManager.IsCookieManagementActive)
13 {
14 var cookieOptInLevel = CookieManager.GetCookieOptInLevel();
15 var cookieOptInCategories = CookieManager.GetCookieOptInCategories();
16 categoryOrAllGranted = cookieOptInCategories.Contains(category) || cookieOptInLevel == CookieOptInLevel.All;
17 }
18
19 return categoryOrAllGranted ? "granted" : "denied";
20 }
21
22 bool AllowTracking()
23 {
24 bool allowTracking = true;
25 if (CookieManager.IsCookieManagementActive)
26 {
27 var cookieOptInLevel = CookieManager.GetCookieOptInLevel();
28 var cookieOptInCategories = CookieManager.GetCookieOptInCategories();
29
30 bool consentEither = (cookieOptInCategories.Contains("Statistical") || cookieOptInCategories.Contains("Marketing"));
31 bool consentFunctional = cookieOptInLevel == CookieOptInLevel.Functional;
32 bool consentAtLeastOne = cookieOptInLevel == CookieOptInLevel.All || (consentFunctional && consentEither);
33
34 allowTracking = consentAtLeastOne;
35 }
36 return allowTracking;
37 }
38 }
39
40 @{
41 string swiftVersion = ReadFile("/Files/Templates/Designs/Swift/swift_version.txt");
42 @* Branding Themes Fonts *@
43 var brandingPageId = Model.Area.Item.GetLink("BrandingPage") != null ? Model.Area.Item.GetLink("BrandingPage").PageId : 0;
44 var themePageId = Model.Area.Item.GetLink("ThemesPage") != null ? Model.Area.Item.GetLink("ThemesPage").PageId : 0;
45
46 var disableWideBreakpoints = Model.Area?.Item?.GetRawValueString("DisableWideBreakpoints", "default");
47
48 string customHeaderInclude = Model.Area.Item.GetFile("CustomHeaderInclude") != null ? Model.Area.Item.GetFile("CustomHeaderInclude").Name : string.Empty;
49
50 string customBodyInclude = Model.Area.Item.GetFile("CustomBodyInclude") != null ? Model.Area.Item.GetFile("CustomBodyInclude").Name : string.Empty;
51
52 string masterTheme = !string.IsNullOrWhiteSpace(Model.Area.Item.GetRawValueString("Theme")) ? " theme " + Model.Area.Item.GetRawValueString("Theme").Replace(" ", "").Trim().ToLower() : "";
53
54 string favicon = Model.Area.Item.GetFile("Favicon") != null ? Model.Area.Item.GetFile("Favicon").Path : "/Files/Templates/Designs/Swift/Assets/Images/favicon.png";
55
56 var brandingPage = Dynamicweb.Content.Services.Pages?.GetPage(brandingPageId) ?? null;
57 var themesParagraphLastChanged = Dynamicweb.Content.Services.Paragraphs.GetParagraphsByPageId(themePageId).OrderByDescending(p => p.Audit.LastModifiedAt).FirstOrDefault();
58 var cssLastModified = brandingPage.Audit.LastModifiedAt > themesParagraphLastChanged.Audit.LastModifiedAt ? brandingPage.Audit.LastModifiedAt : themesParagraphLastChanged.Audit.LastModifiedAt;
59
60 var cssStyleFileInfo = new System.IO.FileInfo(Dynamicweb.Core.SystemInformation.MapPath("/Files/Templates/Designs/Swift/Assets/css/styles.css"));
61 var jsFileInfo = new System.IO.FileInfo(Dynamicweb.Core.SystemInformation.MapPath("/Files/Templates/Designs/Swift/Assets/js/scripts.js"));
62
63 string googleTagManagerID = Model.Area.Item.GetString("GoogleTagManagerID");
64 string googleAnalyticsMeasurementID = Pageview.AreaSettings.GetString("GoogleAnalyticsMeasurementID");
65
66 bool allowTracking = AllowTracking();
67
68 // Schema.org details for PDP
69 string productId = !string.IsNullOrEmpty(Dynamicweb.Context.Current.Request.QueryString.Get("ProductID")) ? Dynamicweb.Context.Current.Request.QueryString.Get("ProductID") : "";
70 bool isProductDetailsPage = !string.IsNullOrEmpty(productId);
71 bool isArticlePage = Model.ItemType == "Swift_Article";
72 string schemaOrgType = string.Empty;
73
74 if (isProductDetailsPage)
75 {
76 schemaOrgType = "itemscope=\"\" itemtype=\"https://schema.org/Product\"";
77 }
78
79 if (isArticlePage)
80 {
81 schemaOrgType = "itemscope=\"\" itemtype=\"https://schema.org/Article\"";
82 }
83
84 var rizzoJsInfo = new System.IO.FileInfo(Dynamicweb.Core.SystemInformation.MapPath("~/Files/Templates/Designs/Swift/Assets/js/rizzo/sr-helpers-min.js"));
85 var minify = !Model.Area.Item.GetBoolean("DisableMinification");
86 var targetLocation = $"/Files/Templates/Optimizer/{Pageview.AreaID}";
87 var customCssOptimizerBundle = Dna.Optimizer.Renderer.RenderStyles(new OptimizerSettings { RootFolder = "/Files/Templates/Designs/Swift/Assets/custom-css", VirtualPathPrefix = $"-custom-{Pageview.AreaID}", TargetLocation = targetLocation, Minify = minify, Recursive = false, FoldersFirst = false });
88 var customJsOptimizerBundle = Dna.Optimizer.Renderer.RenderScripts(new OptimizerSettings { RootFolder = "/Files/Templates/Designs/Swift/Assets/custom-js", VirtualPathPrefix = $"-custom-{Pageview.AreaID}", TargetLocation = targetLocation, Minify = minify, Recursive = false, FoldersFirst = false });
89 }
90
91 <!doctype html>
92 <html lang="@Pageview.Area.CultureInfo.TwoLetterISOLanguageName">
93 <head>
94 <!-- @swiftVersion -->
95 @* Required meta tags *@
96 <meta charset="utf-8">
97 <meta name="viewport" content="height=device-height, width=device-width, initial-scale=1.0">
98 <link rel="preload" href="/Files/Templates/Designs/Swift/Assets/css/styles.css?@cssStyleFileInfo.LastWriteTime.Ticks" as="style">
99 <link rel="preload" href="/Files/Templates/Designs/Swift/Assets/js/scripts.js?@jsFileInfo.LastWriteTime.Ticks" as="script">
100
101 <link rel="preload" href="/Files/Templates/Designs/Swift/Assets/js/rizzo/sr-helpers-min.js?@rizzoJsInfo.LastWriteTime.Ticks" as="script">
102 @if (!string.IsNullOrEmpty(customCssOptimizerBundle))
103 {
104 <link rel="preload" href="@customCssOptimizerBundle" as="style">
105 }
106 @if (!string.IsNullOrEmpty(customJsOptimizerBundle))
107 {
108 <link rel="preload" href="@customJsOptimizerBundle" as="script">
109 }
110
111 <link rel="shortcut icon" href="@favicon">
112 <link rel="apple-touch-icon" href="/Files/Templates/Designs/Swift/Assets/Images/logo_transparent.png">
113 <meta http-equiv="X-UA-Compatible" content="ie=edge">
114 <meta name="googlebot-news" content="nosnippet">
115
116 @Model.MetaTags
117
118 <title>@Model.Title</title>
119
120 @* Bootstrap + Swift stylesheet *@
121 <link href="/Files/Templates/Designs/Swift/Assets/css/styles.css?@cssStyleFileInfo.LastWriteTime.Ticks" rel="stylesheet" media="all" type="text/css">
122
123 @if (disableWideBreakpoints != "disableBoth")
124 {
125 <style>
126 @@media ( min-width: 1600px ) {
127 .container-xxl,
128 .container-xl,
129 .container-lg,
130 .container-md,
131 .container-sm,
132 .container {
133 max-width: 1520px;
134 }
135 }
136 </style>
137
138 if (disableWideBreakpoints != "disableUltraWideOnly")
139 {
140 <style>
141 @@media ( min-width: 1920px ) {
142 .container-xxl,
143 .container-xl,
144 .container-lg,
145 .container-md,
146 .container-sm,
147 .container {
148 max-width: 1820px;
149 }
150 }
151 </style>
152 }
153 }
154
155 @* Branding and Themes min stylesheet *@
156 <link href="/Files/Templates/Designs/Swift/_parsed/Swift_css/Swift_styles_@(Model.Area.ID).min.css?@cssLastModified.Ticks" rel="stylesheet" media="all" type="text/css" data-last-modified-content="@cssLastModified">
157 <script src="/Files/Templates/Designs/Swift/Assets/js/scripts.js?@jsFileInfo.LastWriteTime.Ticks"></script>
158
159 <script type="module">
160 swift.Scroll.hideHeadersOnScroll();
161 swift.Scroll.handleAlternativeTheme();
162
163 //Only load if AOS
164 const aosColumns = document.querySelectorAll('[data-aos]');
165 if (aosColumns.length > 0) {
166 swift.AssetLoader.Load('/Files/Templates/Designs/Swift/Assets/js/aos.js?@jsFileInfo.LastWriteTime.Ticks', 'js');
167 document.addEventListener('load.swift.assetloader', function () {
168 AOS.init({ duration: 400, delay: 100, easing: 'ease-in-out', mirror: false, disable: window.matchMedia('(prefers-reduced-motion: reduce)') });
169 });
170 }
171 </script>
172
173 @* Google gtag method - always include even if it is not used for anything *@
174 <script>
175 window.dataLayer = window.dataLayer || [];
176 function gtag() { dataLayer.push(arguments); }
177 </script>
178 @* Google tag manager *@
179 @if (!string.IsNullOrWhiteSpace(googleTagManagerID))
180 {
181 <script>
182 gtag('consent', 'default', {
183 'ad_storage': 'denied',
184 'ad_user_data': 'denied',
185 'ad_personalization': 'denied',
186 'analytics_storage': 'denied'
187 });
188 </script>
189 <script>
190 (function (w, d, s, l, i) {
191 w[l] = w[l] || []; w[l].push({
192 'gtm.start':
193 new Date().getTime(), event: 'gtm.js'
194 }); var f = d.getElementsByTagName(s)[0],
195 j = d.createElement(s), dl = l != 'dataLayer' ? '&l=' + l : ''; j.async = true; j.src =
196 'https://www.googletagmanager.com/gtm.js?id=' + i + dl; f.parentNode.insertBefore(j, f);
197 })(window, document, 'script', 'dataLayer', '@(googleTagManagerID)');
198 </script>
199 if (allowTracking)
200 {
201 string adConsent = GetCookieOptInPermission("Marketing");
202 string analyticsConsent = GetCookieOptInPermission("Statistical");
203 <script>
204 gtag('consent', 'update', {
205 'ad_storage': '@adConsent',
206 'ad_user_data': '@adConsent',
207 'ad_personalization': '@adConsent',
208 'analytics_storage': '@analyticsConsent'
209 });
210 </script>
211 }
212 }
213
214 @if (!string.IsNullOrWhiteSpace(googleAnalyticsMeasurementID) && allowTracking)
215 {
216 var GoogleAnalyticsDebugMode = "";
217
218 if (Model.Area.Item.GetBoolean("EnableGoogleAnalyticsDebugMode"))
219 {
220 GoogleAnalyticsDebugMode = ", {'debug_mode': true}";
221 }
222
223 <script async src="https://www.googletagmanager.com/gtag/js?id=@googleAnalyticsMeasurementID"></script>
224 <script>
225 gtag('js', new Date());
226 gtag('config', '@googleAnalyticsMeasurementID'@GoogleAnalyticsDebugMode);
227 </script>
228 }
229
230 @if (!string.IsNullOrWhiteSpace(customHeaderInclude))
231 {
232 @RenderPartial($"Components/Custom/{customHeaderInclude}")
233 }
234
235 @* Rizzo *@
236 <script src="/Files/Templates/Designs/Swift/Assets/js/rizzo/sr-helpers-min.js?@rizzoJsInfo.LastWriteTime.Ticks" async></script>
237 @if (!string.IsNullOrEmpty(customCssOptimizerBundle))
238 {
239 <link href="@customCssOptimizerBundle" rel="stylesheet" media="all" type="text/css">
240 }
241 @if (!string.IsNullOrEmpty(customJsOptimizerBundle))
242 {
243 <script src="@customJsOptimizerBundle" defer></script>
244 }
245 </head>
246
247 <body class="brand @(masterTheme)">
248
249 @* Google tag manager *@
250 @if (!string.IsNullOrWhiteSpace(googleTagManagerID) && allowTracking)
251 {
252 <noscript>
253 <iframe src="https://www.googletagmanager.com/ns.html?id=@(googleTagManagerID)"
254 height="0" width="0" style="display:none;visibility:hidden"></iframe>
255 </noscript>
256 }
257
258 <div data-intersect></div>
259
260 <main id="content" @(schemaOrgType)>
261 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel>
262 @using System
263 @using Dynamicweb.Ecommerce.ProductCatalog
264
265
266 @{
267 bool isVisualEditor = !string.IsNullOrEmpty(Dynamicweb.Context.Current.Request.QueryString.Get("VisualEdit")) ? Convert.ToBoolean(Dynamicweb.Context.Current.Request.QueryString.Get("VisualEdit")) : false;
268 string theme = "";
269 string gridContent = "";
270
271 if (Model.PropertyItem != null)
272 {
273 theme = !string.IsNullOrWhiteSpace(Model.Item.GetRawValueString("Theme")) ? " theme " + Model.Item.GetRawValueString("Theme").Replace(" ", "").Trim().ToLower() : "theme light";
274 }
275
276 if (Model.Item != null)
277 {
278 gridContent = Model.Grid("Grid", "Grid", "default:true;sort:1", "Page");
279 }
280
281 <div class="p-5 position-fixed" style="z-index: 10; margin-top: -120px">
282 <h3 class="h5">@Translate("Component builder for"): @Model.Item.GetString("Title")</h3>
283 </div>
284
285 <div class="bg-light position-absolute w-100" style="height: 120px; margin-top: -120px;"></div>
286
287 <div class="bg-light w-100 h-100" style="margin-top: 120px">
288 <div class="container-xl d-flex flex-row align-items-center justify-content-center h-100 min-vh-100">
289 <div class="w-100 shadow @theme p-2">
290 @gridContent
291 </div>
292 </div>
293 </div>
294
295 <div class="bg-light position-absolute w-100" style="height: 120px"></div>
296 }
297
298 </main>
299
300 @* Render any offcanvas menu here *@
301 @RenderSnippet("offcanvas")
302
303 @if (!string.IsNullOrWhiteSpace(customBodyInclude))
304 {
305 @RenderPartial($"Components/Custom/{customBodyInclude}")
306 }
307 </body>
308
309 </html>
310