Error compiling template "Designs/Swift-v2/Swift-v2_ProductComponent.cshtml"
Line 1: An assembly with the same simple name 'Dynamicweb.LoadBalancing' has already been imported. Try removing one of the references (e.g. 'F:\Domains\Sites\dev-jayco.mydwsite3.com\Application\bin\Dynamicweb.LoadBalancing.dll') or sign them to enable side-by-side.
Line 15: The using directive for 'System' appeared previously in this namespace
Line 16: The using directive for 'Dynamicweb.Frontend' appeared previously in this namespace
Line 26: The annotation for nullable reference types should only be used in code within a '#nullable' annotations context. Auto-generated code requires an explicit '#nullable' directive in source.
Line 34: The annotation for nullable reference types should only be used in code within a '#nullable' annotations context. Auto-generated code requires an explicit '#nullable' directive in source.
Line 39: The annotation for nullable reference types should only be used in code within a '#nullable' annotations context. Auto-generated code requires an explicit '#nullable' directive in source.
Line 48: The annotation for nullable reference types should only be used in code within a '#nullable' annotations context. Auto-generated code requires an explicit '#nullable' directive in source.
Line 52: The annotation for nullable reference types should only be used in code within a '#nullable' annotations context. Auto-generated code requires an explicit '#nullable' directive in source.
Line 55: The annotation for nullable reference types should only be used in code within a '#nullable' annotations context. Auto-generated code requires an explicit '#nullable' directive in source.
Line 65: The annotation for nullable reference types should only be used in code within a '#nullable' annotations context. Auto-generated code requires an explicit '#nullable' directive in source.
Line 78: The annotation for nullable reference types should only be used in code within a '#nullable' annotations context. Auto-generated code requires an explicit '#nullable' directive in source.
Line 86: The annotation for nullable reference types should only be used in code within a '#nullable' annotations context. Auto-generated code requires an explicit '#nullable' directive in source.
Line 104: The annotation for nullable reference types should only be used in code within a '#nullable' annotations context. Auto-generated code requires an explicit '#nullable' directive in source.

1 // <auto-generated/> 2 #pragma warning disable 1591 3 namespace CompiledRazorTemplates.Dynamic 4 { 5 #line hidden 6 using System.Threading.Tasks; 7 using System.Collections.Generic; 8 using System.Linq; 9 using System; 10 using Dynamicweb; 11 using Dynamicweb.Environment; 12 using Dynamicweb.Frontend; 13 using Dynamicweb.Frontend.Devices; 14 using Dynamicweb.Rendering; 15 using System; 16 using Dynamicweb.Frontend; 17 internal class RazorEngine_8a126c3d0f0f48cf86d8caac1cb64c64 : Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 18 { 19 #pragma warning disable 1998 20 public async override global::System.Threading.Tasks.Task ExecuteAsync() 21 { 22 WriteLiteral("\r\n"); 23 24 Pageview.Meta.AddTag("fb:app_id", Model.Area?.Item?.GetString("FacebookAppId")); 25 Pageview.Meta.AddTag("google-site-verification", Model.Area?.Item?.GetString("GoogleSiteVerification")); 26 Pageview.Meta.AddTag("site_name", Model.Area?.Item?.TryGetString("MetaSiteName", out string? siteName) is true ? siteName : Model.Area?.Name); 27 Pageview.Meta.AddTag("url", Pageview.Meta.Canonical?.ToString()); 28 Pageview.Meta.AddTag("twitter:site", Model.Area?.Item?.GetString("TwitterSite")); 29 Pageview.Meta.AddOpenGraphTag("type", "website"); 30 Pageview.Meta.AddOpenGraphTag("url", Pageview.Meta.Canonical?.ToString()); 31 Pageview.Meta.AddOpenGraphTag("title", Model.Title); 32 Pageview.Meta.AddOpenGraphTag("description", Model.Description); 33 34 if (Model.Area?.Item?.TryGetImageFile("MetaImage", out ImageFileViewModel? image) ?? false) { 35 Pageview.Meta.AddOpenGraphTag("image", image.Path); 36 Pageview.Meta.AddOpenGraphTag("image:alt", Model.Area?.Item?.GetString("MetaImageALT")); 37 } 38 39 string? googleTagManagerID = string.Empty; 40 if (Model.Area?.Item?.TryGetString("GoogleTagManagerID", out googleTagManagerID) ?? false) 41 { 42 googleTagManagerID = googleTagManagerID.Trim(); 43 } 44 45 46 AddStylesheet("/Files/Templates/Designs/Swift-v2/Assets/css/swift.css"); 47 48 if (Model.TryGetColorSchemeStyle(out string? colorSchemeStyle)) 49 { 50 AddStylesheet(colorSchemeStyle); 51 } 52 if (Model.TryGetButtonStyle(out string? buttonStyle)) { 53 AddStylesheet(buttonStyle); 54 } 55 if (Model.TryGetTypographyStyle(out string? typographyStyle)) { 56 AddStylesheet(typographyStyle); 57 } 58 59 60 AddScript("/Files/Templates/Designs/Swift-v2/Assets/lib/bootstrap/dist/js/bootstrap.bundle.min.js"); 61 AddScript("/Files/Templates/Designs/Swift-v2/Assets/lib/htmx.org/dist/htmx.min.js"); 62 AddScript("/Files/Templates/Designs/Swift-v2/Assets/js/swift.js"); 63 64 65 if (Model.Area?.Item?.TryGetFile("CustomHeadInclude", out FileViewModel? customHeadInclude) ?? false) 66 { 67 Write(RenderPartial($"Designs/Swift-v2/Custom/{customHeadInclude?.Name}")); 68 69 } 70 WriteLiteral("\r\n<!doctype html>\r\n<html"); 71 BeginWriteAttribute("lang", " lang=\"", 2606, "\"", 2664, 1); 72 WriteAttributeValue("", 2613, Pageview.Area.CultureInfo.TwoLetterISOLanguageName, 2613, 51, false); 73 EndWriteAttribute(); 74 WriteLiteral(" data-swift-version=\""); 75 Write(ReadFile("/Files/Templates/Designs/Swift-v2/swift_version.txt")?.Trim()); 76 WriteLiteral("\">\r\n <head>\r\n"); 77 WriteLiteral(" <meta charset=\"utf-8\">\r\n <meta name=\"viewport\" content=\"height=device-height, width=device-width, initial-scale=1.0\">\r\n\r\n"); 78 if (Model.Area?.Item?.TryGetImageFile("Favicon", out ImageFileViewModel? faviconImage) ?? false) 79 { 80 WriteLiteral(" <link rel=\"shortcut icon\""); 81 BeginWriteAttribute("href", " href=\"", 3101, "\"", 3127, 1); 82 WriteAttributeValue("", 3108, faviconImage?.Path, 3108, 19, false); 83 EndWriteAttribute(); 84 WriteLiteral(">\r\n"); 85 } 86 if (Model.Area?.Item?.TryGetImageFile("AppleTouchIcon", out ImageFileViewModel? appleTouchIconImage) ?? false) 87 { 88 WriteLiteral(" <link rel=\"apple-touch-icon\""); 89 BeginWriteAttribute("href", " href=\"", 3314, "\"", 3347, 1); 90 WriteAttributeValue("", 3321, appleTouchIconImage?.Path, 3321, 26, false); 91 EndWriteAttribute(); 92 WriteLiteral(">\r\n"); 93 } 94 95 WriteLiteral(" <title>"); 96 Write(Model.Title); 97 WriteLiteral("</title>\r\n \r\n"); 98 WriteLiteral(" "); 99 Write(Model.MetaTags); 100 WriteLiteral("\r\n \r\n"); 101 WriteLiteral(" "); 102 Write(Model.GetStylesheetsMarkup()); 103 WriteLiteral("\r\n \r\n"); 104 if(Model.Area?.Item?.TryGetString("MediaQueryLimit", out string? mediaQueryLimit) ?? false) { 105 WriteLiteral(" <style>\r\n "); 106 WriteLiteral("@media screen and (min-width: "); 107 Write(mediaQueryLimit); 108 WriteLiteral("px) {\r\n [data-swift-container] {\r\n --dw-container-limit: "); 109 Write(mediaQueryLimit); 110 WriteLiteral(@"px; 111 } 112 113 [data-swift-container], 114 [data-dw-container-width=""3""] { 115 --dw-container-width: calc(var(--dw-container-limit) * .8); 116 } 117 118 [data-dw-container-width=""1""] { 119 --dw-container-width: var(--swift-text-width); 120 } 121 122 [data-dw-container-width=""2""] { 123 --dw-container-width: calc(var(--dw-container-limit) * .65); 124 } 125 } 126 </style> 127 "); 128 } 129 130 WriteLiteral(" "); 131 Write(Model.GetScriptsMarkup()); 132 WriteLiteral("\r\n \r\n"); 133 WriteLiteral(" <script>\r\n window.dataLayer = window.dataLayer || [];\r\n function gtag() { dataLayer.push(arguments); }\r\n </script>\r\n"); 134 if (!string.IsNullOrWhiteSpace(googleTagManagerID)) 135 { 136 WriteLiteral(@" <script> 137 gtag('consent', 'default', { 138 'ad_storage': 'denied', 139 'ad_user_data': 'denied', 140 'ad_personalization': 'denied', 141 'analytics_storage': 'denied' 142 }); 143 </script> 144 <script> 145 (function (w, d, s, l, i) { 146 w[l] = w[l] || []; w[l].push({ 147 'gtm.start': 148 new Date().getTime(), event: 'gtm.js' 149 }); var f = d.getElementsByTagName(s)[0], 150 j = d.createElement(s), dl = l != 'dataLayer' ? '&l=' + l : ''; j.async = true; j.src = 151 'https://www.googletagmanager.com/gtm.js?id=' + i + dl; f.parentNode.insertBefore(j, f); 152 })(window, document, 'script', 'dataLayer', '"); 153 Write(googleTagManagerID); 154 WriteLiteral("\');\r\n </script>\r\n"); 155 if (AllowTracking()) 156 { 157 WriteLiteral(" <script>\r\n gtag(\'consent\', \'update\', {\r\n \'ad_storage\': \'"); 158 Write(CookieManager.IsCookieOptInGranted("Marketing")); 159 WriteLiteral("\',\r\n \'ad_user_data\': \'"); 160 Write(CookieManager.IsCookieOptInGranted("Marketing")); 161 WriteLiteral("\',\r\n \'ad_personalization\': \'"); 162 Write(CookieManager.IsCookieOptInGranted("Marketing")); 163 WriteLiteral("\',\r\n \'analytics_storage\': \'"); 164 Write(CookieManager.IsCookieOptInGranted("Statistical")); 165 WriteLiteral("\'\r\n });\r\n </script>\r\n"); 166 } 167 } 168 WriteLiteral(" </head>\r\n <body data-dw-page-id=\""); 169 Write(Model.ID); 170 WriteLiteral("\" data-dw-itemtype=\""); 171 Write(Model.Item?.SystemName?.ToLower()); 172 WriteLiteral("\">\r\n \r\n"); 173 if (!string.IsNullOrWhiteSpace(googleTagManagerID) && AllowTracking()) 174 { 175 WriteLiteral(" <noscript>\r\n <iframe"); 176 BeginWriteAttribute("src", " src=\"", 6777, "\"", 6848, 2); 177 WriteAttributeValue("", 6783, "https://www.googletagmanager.com/ns.html?id=", 6783, 44, true); 178 WriteAttributeValue("", 6827, googleTagManagerID, 6827, 21, false); 179 EndWriteAttribute(); 180 WriteLiteral(" height=\"0\" width=\"0\" style=\"display:none;visibility:hidden\"></iframe>\r\n </noscript>\r\n"); 181 } 182 WriteLiteral("\r\n"); 183 WriteLiteral("\r\n\r\n<div class=\"min-vh-100 p-4\" style=\"background-color: hsl(0, 0%, 97%);\">\r\n <div style=\"padding-block-start: 10dvh;\">\r\n <div class=\"fs-6 mb-2 pe-none user-select-none\">\r\n "); 184 Write(Model.Title); 185 WriteLiteral("\r\n </div>\r\n <div class=\"bg-white w-100 p-2 shadow-sm\">\r\n <div data-dw-colorscheme=\""); 186 Write(Model.ColorScheme?.Id); 187 WriteLiteral("\">\r\n "); 188 Write(Model.Grid("Grid", "Grid", "default:true;sort:1", "Page")); 189 WriteLiteral("\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n \r\n\t</body>\r\n\r\n</html>\r\n\r\n"); 190 } 191 #pragma warning restore 1998 192 193 bool AllowTracking() 194 { 195 bool allowTracking = true; 196 if (CookieManager.IsCookieManagementActive) 197 { 198 var cookieOptInLevel = CookieManager.GetCookieOptInLevel(); 199 var cookieOptInCategories = CookieManager.GetCookieOptInCategories(); 200 bool consentEither = (cookieOptInCategories.Contains("Statistical") || cookieOptInCategories.Contains("Marketing")); 201 bool consentFunctional = cookieOptInLevel == CookieOptInLevel.Functional; 202 bool consentAtLeastOne = cookieOptInLevel == CookieOptInLevel.All || (consentFunctional && consentEither); 203 allowTracking = consentAtLeastOne; 204 } 205 return allowTracking; 206 } 207 } 208 } 209 #pragma warning restore 1591 210

1 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 2 @using System 3 @using Dynamicweb 4 @using Dynamicweb.Environment 5 @using Dynamicweb.Frontend 6 @using Dynamicweb.Frontend.Devices 7 @using Dynamicweb.Rendering 8 9 @{ 10 Pageview.Meta.AddTag("fb:app_id", Model.Area?.Item?.GetString("FacebookAppId")); 11 Pageview.Meta.AddTag("google-site-verification", Model.Area?.Item?.GetString("GoogleSiteVerification")); 12 Pageview.Meta.AddTag("site_name", Model.Area?.Item?.TryGetString("MetaSiteName", out string? siteName) is true ? siteName : Model.Area?.Name); 13 Pageview.Meta.AddTag("url", Pageview.Meta.Canonical?.ToString()); 14 Pageview.Meta.AddTag("twitter:site", Model.Area?.Item?.GetString("TwitterSite")); 15 Pageview.Meta.AddOpenGraphTag("type", "website"); 16 Pageview.Meta.AddOpenGraphTag("url", Pageview.Meta.Canonical?.ToString()); 17 Pageview.Meta.AddOpenGraphTag("title", Model.Title); 18 Pageview.Meta.AddOpenGraphTag("description", Model.Description); 19 20 if (Model.Area?.Item?.TryGetImageFile("MetaImage", out ImageFileViewModel? image) ?? false) { 21 Pageview.Meta.AddOpenGraphTag("image", image.Path); 22 Pageview.Meta.AddOpenGraphTag("image:alt", Model.Area?.Item?.GetString("MetaImageALT")); 23 } 24 25 string? googleTagManagerID = string.Empty; 26 if (Model.Area?.Item?.TryGetString("GoogleTagManagerID", out googleTagManagerID) ?? false) 27 { 28 googleTagManagerID = googleTagManagerID.Trim(); 29 } 30 31 @* Stylesheets *@ 32 AddStylesheet("/Files/Templates/Designs/Swift-v2/Assets/css/swift.css"); 33 34 @* Color schemes stylesheet *@ 35 @if (Model.TryGetColorSchemeStyle(out string? colorSchemeStyle)) 36 { 37 AddStylesheet(colorSchemeStyle); 38 } 39 @* Button stylesheet *@ 40 @if (Model.TryGetButtonStyle(out string? buttonStyle)) { 41 AddStylesheet(buttonStyle); 42 } 43 @* Typography stylesheet *@ 44 @if (Model.TryGetTypographyStyle(out string? typographyStyle)) { 45 AddStylesheet(typographyStyle); 46 } 47 48 @* Scripts *@ 49 AddScript("/Files/Templates/Designs/Swift-v2/Assets/lib/bootstrap/dist/js/bootstrap.bundle.min.js"); 50 AddScript("/Files/Templates/Designs/Swift-v2/Assets/lib/htmx.org/dist/htmx.min.js"); 51 AddScript("/Files/Templates/Designs/Swift-v2/Assets/js/swift.js"); 52 53 @* Custom <head> include *@ 54 if (Model.Area?.Item?.TryGetFile("CustomHeadInclude", out FileViewModel? customHeadInclude) ?? false) 55 { 56 @RenderPartial($"Designs/Swift-v2/Custom/{customHeadInclude?.Name}") 57 } 58 } 59 60 <!doctype html> 61 <html lang="@Pageview.Area.CultureInfo.TwoLetterISOLanguageName" data-swift-version="@(ReadFile("/Files/Templates/Designs/Swift-v2/swift_version.txt")?.Trim())"> 62 <head> 63 @* Required meta tags *@ 64 <meta charset="utf-8"> 65 <meta name="viewport" content="height=device-height, width=device-width, initial-scale=1.0"> 66 67 @if (Model.Area?.Item?.TryGetImageFile("Favicon", out ImageFileViewModel? faviconImage) ?? false) 68 { 69 <link rel="shortcut icon" href="@faviconImage?.Path"> 70 } 71 @if (Model.Area?.Item?.TryGetImageFile("AppleTouchIcon", out ImageFileViewModel? appleTouchIconImage) ?? false) 72 { 73 <link rel="apple-touch-icon" href="@appleTouchIconImage?.Path"> 74 } 75 76 @* Pageview Meta *@ 77 <title>@Model.Title</title> 78 79 @* MetaTags *@ 80 @Model.MetaTags 81 82 @* Get stylesheets *@ 83 @Model.GetStylesheetsMarkup() 84 85 @* Media Query Limit *@ 86 @if(Model.Area?.Item?.TryGetString("MediaQueryLimit", out string? mediaQueryLimit) ?? false) { 87 <style> 88 @@media screen and (min-width: @(mediaQueryLimit)px) { 89 [data-swift-container] { 90 --dw-container-limit: @(mediaQueryLimit)px; 91 } 92 93 [data-swift-container], 94 [data-dw-container-width="3"] { 95 --dw-container-width: calc(var(--dw-container-limit) * .8); 96 } 97 98 [data-dw-container-width="1"] { 99 --dw-container-width: var(--swift-text-width); 100 } 101 102 [data-dw-container-width="2"] { 103 --dw-container-width: calc(var(--dw-container-limit) * .65); 104 } 105 } 106 </style> 107 } 108 109 @* Get scripts *@ 110 @Model.GetScriptsMarkup() 111 112 @* Google gtag method - always include even if it is not used for anything *@ 113 <script> 114 window.dataLayer = window.dataLayer || []; 115 function gtag() { dataLayer.push(arguments); } 116 </script> 117 @* Google tag manager *@ 118 @if (!string.IsNullOrWhiteSpace(googleTagManagerID)) 119 { 120 <script> 121 gtag('consent', 'default', { 122 'ad_storage': 'denied', 123 'ad_user_data': 'denied', 124 'ad_personalization': 'denied', 125 'analytics_storage': 'denied' 126 }); 127 </script> 128 <script> 129 (function (w, d, s, l, i) { 130 w[l] = w[l] || []; w[l].push({ 131 'gtm.start': 132 new Date().getTime(), event: 'gtm.js' 133 }); var f = d.getElementsByTagName(s)[0], 134 j = d.createElement(s), dl = l != 'dataLayer' ? '&l=' + l : ''; j.async = true; j.src = 135 'https://www.googletagmanager.com/gtm.js?id=' + i + dl; f.parentNode.insertBefore(j, f); 136 })(window, document, 'script', 'dataLayer', '@(googleTagManagerID)'); 137 </script> 138 if (AllowTracking()) 139 { 140 <script> 141 gtag('consent', 'update', { 142 'ad_storage': '@CookieManager.IsCookieOptInGranted("Marketing")', 143 'ad_user_data': '@CookieManager.IsCookieOptInGranted("Marketing")', 144 'ad_personalization': '@CookieManager.IsCookieOptInGranted("Marketing")', 145 'analytics_storage': '@CookieManager.IsCookieOptInGranted("Statistical")' 146 }); 147 </script> 148 } 149 } 150 </head> 151 <body data-dw-page-id="@(Model.ID)" data-dw-itemtype="@Model.Item?.SystemName?.ToLower()"> 152 153 @* Google tag manager *@ 154 @if (!string.IsNullOrWhiteSpace(googleTagManagerID) && AllowTracking()) 155 { 156 <noscript> 157 <iframe src="https://www.googletagmanager.com/ns.html?id=@(googleTagManagerID)" height="0" width="0" style="display:none;visibility:hidden"></iframe> 158 </noscript> 159 } 160 161 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 162 @using System 163 @using Dynamicweb.Frontend 164 165 166 <div class="min-vh-100 p-4" style="background-color: hsl(0, 0%, 97%);"> 167 <div style="padding-block-start: 10dvh;"> 168 <div class="fs-6 mb-2 pe-none user-select-none"> 169 @Model.Title 170 </div> 171 <div class="bg-white w-100 p-2 shadow-sm"> 172 <div data-dw-colorscheme="@Model.ColorScheme?.Id"> 173 @Model.Grid("Grid", "Grid", "default:true;sort:1", "Page") 174 </div> 175 </div> 176 </div> 177 </div> 178 179 180 </body> 181 182 </html> 183 184 @functions { 185 bool AllowTracking() 186 { 187 bool allowTracking = true; 188 if (CookieManager.IsCookieManagementActive) 189 { 190 var cookieOptInLevel = CookieManager.GetCookieOptInLevel(); 191 var cookieOptInCategories = CookieManager.GetCookieOptInCategories(); 192 bool consentEither = (cookieOptInCategories.Contains("Statistical") || cookieOptInCategories.Contains("Marketing")); 193 bool consentFunctional = cookieOptInLevel == CookieOptInLevel.Functional; 194 bool consentAtLeastOne = cookieOptInLevel == CookieOptInLevel.All || (consentFunctional && consentEither); 195 allowTracking = consentAtLeastOne; 196 } 197 return allowTracking; 198 } 199 } 200