Error executing template "Designs/Swift/_parsed/Swift_Page_Custom.parsed.cshtml"
System.ArgumentException: Could not write parsed file: E:\Dynamicweb.NET\Solutions\co3\frede-and-vvs.swift.espresso4.dk\Files\Templates\Designs\Swift\_parsed\Swift_PageNoLayout.parsed.cshtml System.IO.IOException: The process cannot access the file 'E:\Dynamicweb.NET\Solutions\co3\frede-and-vvs.swift.espresso4.dk\Files\Templates\Designs\Swift\_parsed\Swift_PageNoLayout.parsed.cshtml' because it is being used by another process.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.StreamWriter.CreateFile(String path, Boolean append, Boolean checkHost)
at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize, Boolean checkHost)
at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding)
at Dynamicweb.Core.Helpers.TextFileHelper.WriteTextFile(String value, String path, Boolean appendToFile, Encoding encoding)
at Dynamicweb.Rendering.Designer.Parser.Parse(Layout l)
at Dynamicweb.Rendering.Designer.Parser.Parse(Layout l)
at Dynamicweb.Rendering.Designer.Layout.CheckParsed()
at Dynamicweb.Rendering.Designer.Layout.GetLayoutByLocation(String path)
at Dynamicweb.Frontend.LayoutTemplateLocator.GetLayoutFromName(Area area, String layoutName)
at Dynamicweb.Frontend.Content.CreateGridContent(Int32 contentId, Boolean ignoreVisualEdit)
at Dynamicweb.Frontend.Content.RenderExternalGrid(Int32 pageId, String container)
at CompiledRazorTemplates.Dynamic.RazorEngine_4b3ce615bee4433ca36921646b20291f.Execute() in E:\Dynamicweb.NET\Solutions\co3\frede-and-vvs.swift.espresso4.dk\Files\Templates\Designs\Swift\_parsed\Swift_Page_Custom.parsed.cshtml:line 219
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.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel>
2 @using System
3 @using Dynamicweb
4 @using Dynamicweb.Environment
5 @using Dynamicweb.Frontend
6 @using System.Web
7 8 @{
9 string swiftVersion = ReadFile("~/Files/Templates/Designs/Swift/swift_version.txt");
10 bool renderAsResponsive = Model.Area.Item.GetString("DeviceRendering", "responsive").Equals("responsive", StringComparison.OrdinalIgnoreCase);
11 bool renderMobile = Pageview.Device == Dynamicweb.Frontend.Devices.DeviceType.Mobile || Pageview.Device == Dynamicweb.Frontend.Devices.DeviceType.Tablet;
12 string responsiveHeaderClassDesktop = string.Empty;
13 string responsiveHeaderClassMobile = string.Empty;
14 if (renderAsResponsive)
15 {
16 responsiveHeaderClassDesktop = " d-none d-xl-block";
17 responsiveHeaderClassMobile = " d-block d-xl-none";
18 }
19 20 var brandingPageId = Model.Area.Item.GetLink("BrandingPage") != null ? Model.Area.Item.GetLink("BrandingPage").PageId : 0;
21 var themePageId = Model.Area.Item.GetLink("ThemesPage") != null ? Model.Area.Item.GetLink("ThemesPage").PageId : 0;
22 string customHeaderInclude = Model.Area.Item.GetFile("CustomHeaderInclude") != null ? Model.Area.Item.GetFile("CustomHeaderInclude").Name : string.Empty;
23 24 var brandingPage = Dynamicweb.Services.Pages?.GetPage(brandingPageId) ?? null;
25 var themesParagraphLastChanged = Services.Paragraphs.GetParagraphsByPageId(themePageId).OrderByDescending(p => p.Audit.LastModifiedAt).FirstOrDefault();
26 27 var cssLastModified = brandingPage.Audit.LastModifiedAt > themesParagraphLastChanged.Audit.LastModifiedAt ? brandingPage.Audit.LastModifiedAt : themesParagraphLastChanged.Audit.LastModifiedAt;
28 var cssThemeAndBrandingStyleFileInfo = new System.IO.FileInfo(Dynamicweb.Core.SystemInformation.MapPath($"~/Files/Templates/Designs/Swift/_parsed/Swift_css/Swift_styles_{Model.Area.ID}.min.css"));
29 30 // Schema.org details for PDP
31 string productId = !string.IsNullOrEmpty(Dynamicweb.Context.Current.Request.QueryString.Get("ProductID")) ? Dynamicweb.Context.Current.Request.QueryString.Get("ProductID") : "";
32 bool isProductDetailsPage = !string.IsNullOrEmpty(productId);
33 bool isArticlePage = Model.ItemType == "Swift_Article";
34 string schemaOrgType = string.Empty;
35 36 if(isProductDetailsPage)
37 {
38 schemaOrgType = "itemscope=\"\" itemtype=\"https://schema.org/Product\"";
39 }
40 41 if(isArticlePage)
42 {
43 schemaOrgType = "itemscope=\"\" itemtype=\"https://schema.org/Article\"";
44 }
45 46 if (!cssThemeAndBrandingStyleFileInfo.Exists || cssThemeAndBrandingStyleFileInfo.LastWriteTime < brandingPage.Audit.LastModifiedAt)
47 {
48 //Branding page has been saved or the file is missing. Rewrite the file to disc.
49 if (brandingPageId > 0)
50 {
51 var brandingPageview = Dynamicweb.Frontend.PageView.GetPageviewByPageID(brandingPageId);
52 brandingPageview.Redirect = false;
53 brandingPageview.Output();
54 }
55 }
56 57 if (!cssThemeAndBrandingStyleFileInfo.Exists || cssThemeAndBrandingStyleFileInfo.LastWriteTime < themesParagraphLastChanged.Audit.LastModifiedAt)
58 {
59 //Branding page has been saved or the file is missing. Rewrite the file to disc.
60 if (themePageId > 0)
61 {
62 var themePageview = Dynamicweb.Frontend.PageView.GetPageviewByPageID(themePageId);
63 themePageview.Redirect = false;
64 themePageview.Output();
65 }
66 }
67 68 var cssStyleFileInfo = new System.IO.FileInfo(Dynamicweb.Core.SystemInformation.MapPath("~/Files/Templates/Designs/Swift/Assets/css/styles.css"));
69 var jsFileInfo = new System.IO.FileInfo(Dynamicweb.Core.SystemInformation.MapPath("~/Files/Templates/Designs/Swift/Assets/js/scripts.js"));
70 71 string masterTheme = !string.IsNullOrWhiteSpace(Model.Area.Item.GetRawValueString("Theme")) ? " theme " + Model.Area.Item.GetRawValueString("Theme").Replace(" ", "").Trim().ToLower() : "";
72 73 string favicon = Model.Area.Item.GetFile("Favicon") != null ? Model.Area.Item.GetFile("Favicon").Path : "~/Files/Templates/Designs/Swift/Assets/Images/favicon.png";
74 75 string headerCssClass = "sticky-top";
76 bool movePageBehind = false;
77 78 if (Pageview.Page.PropertyItem != null)
79 {
80 headerCssClass = Pageview.Page.PropertyItem["MoveThisPageBehindTheHeader"] != null ? Pageview.Page.PropertyItem["MoveThisPageBehindTheHeader"].ToString() : "sticky-top";
81 movePageBehind = headerCssClass == "fixed-top" && !Pageview.IsVisualEditorMode ? true : false;
82 }
83 headerCssClass = headerCssClass == "" ? "sticky-top" : headerCssClass;
84 headerCssClass = Pageview.IsVisualEditorMode ? "" : headerCssClass;
85 86 string googleAnalyticsTrackingID = Model.Area.Item.GetString("GoogleAnalyticsTrackingID");
87 bool allowCookies = CookieManager.GetCookieOptInLevel() == 0 || !CookieManager.CookieOptInLevelExists ? false : true;
88 89 Dynamicweb.Context.Current.Response.AddHeader("link", $"</Files/Templates/Designs/Swift/Assets/css/styles.css?{cssStyleFileInfo.LastWriteTime.Ticks}>; rel=preload; as=style;");
90 Dynamicweb.Context.Current.Response.AddHeader("link", $"</Files/Templates/Designs/Swift/_parsed/Swift_css/Swift_styles_{Model.Area.ID}.min.css?{cssLastModified.Ticks}; rel=preload; as=style;");
91 Dynamicweb.Context.Current.Response.AddHeader("link", $"</Files/Templates/Designs/Swift/Assets/js/aos.js?{jsFileInfo.LastWriteTime.Ticks}; rel=preload; as=script;");
92 Dynamicweb.Context.Current.Response.AddHeader("link", $"</Files/Templates/Designs/Swift/Assets/js/scripts.js?{jsFileInfo.LastWriteTime.Ticks}; rel=preload; as=script;");
93 //Dynamicweb.Context.Current.Response.Flush(); //This sends the headers where we are now in the rendering making the TTFB faster
94 95 SetMetaTags();
96 97 List<Dynamicweb.Content.Page> languages = new List<Dynamicweb.Content.Page>();
98 99 if (Pageview.Area.IsMaster)
100 {
101 languages.Add(Pageview.Page);
102 if (Pageview.Page.Languages != null)
103 {
104 foreach (var language in Pageview.Page.Languages)
105 {
106 languages.Add(language);
107 }
108 }
109 }
110 else
111 {
112 languages.Add(Pageview.Page.MasterPage);
113 if (Pageview.Page.MasterPage != null)
114 {
115 if (Pageview.Page.MasterPage.Languages != null)
116 {
117 foreach (var language in Pageview.Page.MasterPage.Languages)
118 {
119 languages.Add(language);
120 }
121 }
122 }
123 }
124125 string siteLanguage = Pageview.Area.CultureInfo.Name;
126 Uri url = Dynamicweb.Context.Current.Request.Url;
127 string hostName = url.Host; // domain.com/da-dk or domain.com/en-us
128129 var ecomCountries = Dynamicweb.Ecommerce.Services.Countries.GetCountries();
130 var ecomCurrencies = Dynamicweb.Ecommerce.Services.Currencies.GetAllCurrencies();
131 }
132 <!doctype html>
133 <html lang="@Pageview.Area.CultureInfo.TwoLetterISOLanguageName">
134 <head>
135 <!-- @swiftVersion -->
136 @* Required meta tags *@
137 <meta charset="utf-8">
138 <meta name="viewport" content="height=device-height, width=device-width, initial-scale=1.0">
139 <link rel="preconnect" href="https://fonts.gstatic.com" />
140141 <link rel="icon" type="image/x-icon" href="@favicon">
142 <link rel="shortcut icon" href="@favicon">
143 <link rel="apple-touch-icon" href="@favicon">
144145 @Model.MetaTags
146147 @{
148 @* Languages meta data *@
149 foreach (var language in languages)
150 {
151 if (language?.Area != null)
152 {
153 if (language != null && language.Published && language.Active && language.Area.Active && language.Area.Published && language.Area.ID != Dynamicweb.Frontend.PageView.Current().AreaID)
154 {
155 if (!string.IsNullOrEmpty(language.Area.DomainLock))
156 {
157 hostName = language.Area.DomainLock; //dk.domain.com or dk-domain.dk
158 }
159 string friendlyUrl = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(language.ID);
160 string href = $"{url.Scheme}://{hostName}{friendlyUrl}";
161162 <link rel="alternate" hreflang="@language.Area.CultureInfo.Name.ToLower()" href="@href" />
163 }
164 }
165 }
166 }
167168 <title>@Model.Title</title>
169170 <!-- Google Tag Manager -->
171 <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
172 new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
173 j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
174 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
175 })(window,document,'script','dataLayer','GTM-NBGMVPG');</script>
176 <!-- End Google Tag Manager -->
177178 @* Bootstrap + Swift stylesheet *@
179 <link href="~/Files/Templates/Designs/Swift/Assets/css/styles.css?@cssStyleFileInfo.LastWriteTime.Ticks" rel="stylesheet" media="all" type="text/css">
180 @* Branding and Themes min stylesheet *@
181 <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">
182 <link href="/Files/Templates/Designs/Swift/Assets/css/custom.css?v.1.0.0" rel="stylesheet" media="all" type="text/css">
183 <script src="~/Files/Templates/Designs/Swift/Assets/js/aos.js?@jsFileInfo.LastWriteTime.Ticks" defer></script>
184 <script src="~/Files/Templates/Designs/Swift/Assets/js/scripts.js?@jsFileInfo.LastWriteTime.Ticks" defer></script>
185186 <script type="module">
187 AOS.init({ offset: 0, duration: 400, delay: 100, easing: 'ease-in-out', mirror: true, disable: window.matchMedia('(prefers-reduced-motion: reduce)') });
188 swift.Scroll.hideHeadersOnScroll();
189 swift.Scroll.handleAlternativeTheme();
190 </script>
191192 @* Global site tag (gtag.js) - Google Analytics *@
193 @if (!string.IsNullOrWhiteSpace(googleAnalyticsTrackingID) && allowCookies)
194 {
195 <script src="https://www.googletagmanager.com/gtag/js?id=@googleAnalyticsTrackingID" async></script>
196 <script>
197 window.dataLayer = window.dataLayer || [];
198 function gtag() { window.dataLayer.push(arguments); }
199 gtag('js', new Date());
200 gtag('config', '@googleAnalyticsTrackingID');
201 </script>
202 }
203204 @if (!string.IsNullOrWhiteSpace(customHeaderInclude))
205 {
206 @RenderPartial($"Components/Custom/{customHeaderInclude}")
207 }
208 </head>
209 <body class="brand @(masterTheme)" id="page@(Model.ID)">
210 <!-- Google Tag Manager (noscript) -->
211 <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-NBGMVPG"
212 height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
213 <!-- End Google Tag Manager (noscript) -->
214 @if (renderAsResponsive || !renderMobile)
215 {
216 <header class="page-header @headerCssClass top-0@(responsiveHeaderClassDesktop)" id="page-header-desktop">
217 @if (@Model.Area.Item.GetLink("HeaderDesktop") != null)
218 {
219 @RenderGrid(@Model.Area.Item.GetLink("HeaderDesktop").PageId)
220 }
221 </header>
222 }
223224 @if ((renderAsResponsive || renderMobile))
225 {
226 <header class="page-header @headerCssClass top-0@(responsiveHeaderClassMobile)" id="page-header-mobile">
227 @if (@Model.Area.Item.GetLink("HeaderMobile") != null)
228 {
229 @RenderGrid(@Model.Area.Item.GetLink("HeaderMobile").PageId)
230 }
231 </header>
232 }
233234 <main id="content" @(schemaOrgType)>
235 <div data-intersect></div>
236 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel>
237 @using System
238 @using Dynamicweb.Ecommerce.ProductCatalog
239240 @{
241 bool isArticlePagePage = Model.ItemType == "Swift_Article";
242 string schemaOrgProp = string.Empty;
243 if(isArticlePagePage)
244 {
245 schemaOrgProp = "itemprop=\"articleBody\"";
246 }
247248 string theme = "";
249 string gridContent = "";
250251 if (Model.PropertyItem != null)
252 {
253 theme = !string.IsNullOrWhiteSpace(Model.PropertyItem.GetRawValueString("Theme")) ? " theme " + Model.PropertyItem.GetRawValueString("Theme").Replace(" ", "").Trim().ToLower() : "";
254 }
255256 if (Model.Item != null)
257 {
258 gridContent = Model.Grid("Grid", "Grid", "default:true;sort:1", "Page");
259 }
260261 bool doNotRenderPage = false;
262263 //Check if we are on the poduct detail page, and if there is data to render
264 ProductViewModel product = new ProductViewModel();
265 if (Dynamicweb.Context.Current.Items.Contains("ProductDetails"))
266 {
267 product = (ProductViewModel)Dynamicweb.Context.Current.Items["ProductDetails"];
268 if (string.IsNullOrEmpty(product.Id)) {
269 doNotRenderPage = true;
270 }
271 }
272273 //Render the page
274 if (!doNotRenderPage) {
275 string itemIdentifier = Model?.Item?.SystemName != null ? "item_" + Model.Item.SystemName.ToLower() : "item_Swift_Page";
276277278 if (theme != "")
279 {
280 <div class="@theme item_@itemIdentifier" @schemaOrgProp>
281 @gridContent
282 </div>
283 }
284 else
285 {
286 <div class="item_@itemIdentifier" @schemaOrgProp>
287 @gridContent
288 </div>
289 }
290 } else {
291 <div class="container">
292 <div class="alert alert-info" role="alert">@Translate("Sorry. There is nothing to view here")</div>
293 </div>
294 }
295296 if (!Model.IsCurrentUserAllowed)
297 {
298 int signInPage = GetPageIdByNavigationTag("SignInPage");
299 int dashboardPage = GetPageIdByNavigationTag("MyAccountDashboardPage");
300301 if (!Pageview.IsVisualEditorMode)
302 {
303 if (signInPage != 0)
304 {
305 if (signInPage != Model.ID) {
306 Dynamicweb.Context.Current.Response.Redirect("/Default.aspx?ID=" + signInPage);
307 } else {
308 if (dashboardPage != 0) {
309 Dynamicweb.Context.Current.Response.Redirect("/Default.aspx?ID=" + dashboardPage);
310 } else {
311 Dynamicweb.Context.Current.Response.Redirect("/");
312 }
313 }
314 }
315 else
316 {
317 <div class="alert alert-dark m-0" role="alert">
318 <span>@Translate("You do not have access to this page")</span>
319 </div>
320 }
321 }
322 else
323 {
324 <div class="alert alert-dark m-0" role="alert">
325 <span>@Translate("To work on this page, you must be signed in, in the frontend")</span>
326 </div>
327 }
328 }
329 }
330331 </main>
332333 @if (renderAsResponsive || !renderMobile)
334 {
335 <footer class="page-footer d-none d-lg-block" id="page-footer-desktop">
336 @if (@Model.Area.Item.GetLink("FooterDesktop") != null)
337 {
338 @RenderGrid(@Model.Area.Item.GetLink("FooterDesktop").PageId)
339 }
340 </footer>
341 }
342343 @if (renderAsResponsive || renderMobile)
344 {
345 <footer class="page-footer d-block d-lg-none" id="page-footer-mobile">
346 @if (@Model.Area.Item.GetLink("FooterMobile") != null)
347 {
348 @RenderGrid(@Model.Area.Item.GetLink("FooterMobile").PageId)
349 }
350 </footer>
351 }
352353 @* Render any offcanvas menu here *@
354 @RenderSnippet("offcanvas")
355356 @{
357 bool isErpConnectionDown = !Dynamicweb.Ecommerce.DynamicwebLiveIntegration.TemplatesHelper.IsWebServiceConnectionAvailable();
358 if (isErpConnectionDown && Model.Area.Item.GetBoolean("ShowErpDownMessage"))
359 {
360 @RenderNoErpConnectionMessage()
361 }
362 }
363364 @* Language selector modal *@
365 @if (languages.Count > 1 || ecomCountries.Count > 1 || ecomCurrencies.Count() > 1)
366 {
367 <div class="modal fade" id="PreferencesModal" tabindex="-1" aria-hidden="true">
368 <div class="modal-dialog modal-dialog-centered modal-sm" id="PreferencesModalContent">
369 @* The content here comes from an external request *@
370 </div>
371 </div>
372 }
373374 @* Favorite toast *@
375 <div aria-live="polite" aria-atomic="true">
376 <div class="position-fixed bottom-0 end-0 p-3" style="z-index: 11">
377 <div id="favoriteNotificationToast" class="toast" role="alert" aria-live="assertive" aria-atomic="true">
378 <div class="toast-header">
379 <strong class="me-auto">@Translate("Favorite list updated")</strong>
380 <button type="button" class="btn-close" data-bs-dismiss="toast" aria-label="Close"></button>
381 </div>
382 <div class="toast-body d-flex gap-3">
383 <div id="favoriteNotificationToast_Image"></div>
384 <div id="favoriteNotificationToast_Text"></div>
385 </div>
386 </div>
387 </div>
388 </div>
389390 @* Modal for dynamic content *@
391 <div class="modal fade js-product" id="DynamicModal" tabindex="-1" aria-hidden="true">
392 <div class="modal-dialog modal-dialog-centered modal-md">
393 <div class="modal-content theme light" id="DynamicModalContent">
394 @* The content here comes from an external request *@
395 </div>
396 </div>
397 </div>
398399 @* Offcanvas for dynamic content *@
400 <div class="offcanvas offcanvas-end theme light" tabindex="-1" id="DynamicOffcanvas" style="width: 30rem">
401 @* The content here comes from an external request *@
402 </div>
403 </body>
404 </html>
405 @functions {
406407 void SetMetaTags()
408 {
409 //Verification Tokens
410 string siteVerificationGoogle = Model.Area.Item.GetString("Google_Site_Verification") != null ? Model.Area.Item.GetString("Google_Site_Verification") : "";
411 //string siteVerificationYandex = Model.Area.Item.GetString("Yandex_Verification") != null ? Model.Area.Item.GetString("Yandex_Verification") : "";
412 //string siteVerificationMS = Model.Area.Item.GetString("Msvalidate_01") != null ? Model.Area.Item.GetString("Msvalidate_01") : "";
413 //string siteVerificationAlexa = Model.Area.Item.GetString("AlexaVerifyID") != null ? Model.Area.Item.GetString("AlexaVerifyID") : "";
414 //string siteVerificationPinterest = Model.Area.Item.GetString("P_domain_verify") != null ? Model.Area.Item.GetString("P_domain_verify") : "";
415 //string siteVerificationNorton = Model.Area.Item.GetString("Norton_safeweb_site_verification") != null ? Model.Area.Item.GetString("Norton_safeweb_site_verification") : "";
416417 //Generic Site Values
418 string openGraphFacebookAppID = Model.Area.Item.GetString("Fb_app_id") != null ? Model.Area.Item.GetString("Fb_app_id") : "";
419 string openGraphType = Model.Area.Item.GetString("Open_Graph_Type") != null ? Model.Area.Item.GetString("Open_Graph_Type") : "";
420 string openGraphSiteName = Model.Area.Item.GetString("Open_Graph_Site_Name") != null ? Model.Area.Item.GetString("Open_Graph_Site_Name") : "";
421422 string twitterCardSite = Model.Area.Item.GetString("Twitter_Site") != null ? Model.Area.Item.GetString("Twitter_Site") : "";
423424 //Page specific values
425 string openGraphSiteTitle = Model.Area.Item.GetString("Open_Graph_Title") != null ? Model.Area.Item.GetString("Open_Graph_Title") : "";
426 FileViewModel openGraphImage = Model.Area.Item.GetFile("Open_Graph_Image");
427 string openGraphImageALT = Model.Area.Item.GetString("Open_Graph_Image_ALT") != null ? Model.Area.Item.GetString("Open_Graph_Image_ALT") : "";
428 string openGraphDescription = Model.Area.Item.GetString("Open_Graph_Description") != null ? Model.Area.Item.GetString("Open_Graph_Description") : "";
429430 string twitterCardURL = Model.Area.Item.GetString("Twitter_URL") != null ? Model.Area.Item.GetString("Twitter_URL") : "";
431 string twitterCardTitle = Model.Area.Item.GetString("Twitter_Title") != null ? Model.Area.Item.GetString("Twitter_Title") : "";
432 string twitterCardDescription = Model.Area.Item.GetString("Twitter_Description") != null ? Model.Area.Item.GetString("Twitter_Description") : "";
433 FileViewModel twitterCardImage = Model.Area.Item.GetFile("Twitter_Image");
434 string twitterCardImageALT = Model.Area.Item.GetString("Twitter_Image_ALT") != null ? Model.Area.Item.GetString("Twitter_Image_ALT") : "";
435436 if (!string.IsNullOrEmpty(siteVerificationGoogle))
437 {
438 Pageview.Meta.AddTag("google-site-verification", siteVerificationGoogle);
439 }
440441 if (!string.IsNullOrEmpty(openGraphFacebookAppID))
442 {
443 Pageview.Meta.AddTag("fb:app_id", openGraphFacebookAppID);
444 }
445446 if (!string.IsNullOrEmpty(openGraphType))
447 {
448 Pageview.Meta.AddTag("og:type", openGraphType);
449 }
450451 if (!string.IsNullOrEmpty(openGraphSiteName))
452 {
453 Pageview.Meta.AddTag("og:site_name", openGraphSiteName);
454 }
455 if (!string.IsNullOrEmpty(Model.Title))
456 {
457 Pageview.Meta.AddTag("og:title", Model.Title);
458 }
459 else
460 {
461 Pageview.Meta.AddTag("og:title", openGraphSiteTitle);
462 }
463464465 if (string.IsNullOrEmpty(Dynamicweb.Context.Current.Request.QueryString["ProductID"]))
466 {
467 if (!string.IsNullOrEmpty(Model.Description))
468 {
469 Pageview.Meta.AddTag("og:description", Model.Description);
470 }
471 else
472 {
473 Pageview.Meta.AddTag("og:description", openGraphDescription);
474 }
475 if (openGraphImage != null)
476 {
477 Pageview.Meta.AddTag("og:image", openGraphImage.Path);
478 }
479480 if (!string.IsNullOrEmpty(openGraphImageALT))
481 {
482 Pageview.Meta.AddTag("og:image:alt", openGraphImageALT);
483 }
484 if (!string.IsNullOrEmpty(twitterCardDescription))
485 {
486 Pageview.Meta.AddTag("twitter:description", twitterCardDescription);
487 }
488489 if (twitterCardImage != null)
490 {
491 Pageview.Meta.AddTag("twitter:image", twitterCardImage.Path);
492 }
493494 if (!string.IsNullOrEmpty(twitterCardImageALT))
495 {
496 Pageview.Meta.AddTag("twitter:image:alt", twitterCardImageALT);
497 }
498 }
499500 if (!string.IsNullOrEmpty(twitterCardSite))
501 {
502 Pageview.Meta.AddTag("twitter:site", twitterCardSite);
503 }
504505 if (!string.IsNullOrEmpty(twitterCardURL))
506 {
507 Pageview.Meta.AddTag("twitter:url", twitterCardURL);
508 }
509510 if (!string.IsNullOrEmpty(twitterCardTitle))
511 {
512 Pageview.Meta.AddTag("twitter:title", twitterCardTitle);
513 }
514 }
515 }
516517 @helper RenderNoErpConnectionMessage()
518 {
519 string erpDownMessageTheme = !string.IsNullOrWhiteSpace(Model.Area.Item.GetRawValueString("ErpDownMessageTheme")) ? " theme " + Model.Area.Item.GetRawValueString("ErpDownMessageTheme").Replace(" ", "").Trim().ToLower() : "theme light";
520521 <div class="position-fixed bottom-0 end-0 p-3" style="z-index: 1040">
522 <div class="toast fade show border-0 @erpDownMessageTheme" role="alert" aria-live="assertive" aria-atomic="true">
523 <div class="toast-header">
524 <strong class="me-auto">@Translate("Connection down")</strong>
525 <button type="button" class="btn-close" data-bs-dismiss="toast" aria-label="Close"></button>
526 </div>
527 <div class="toast-body">
528 @Translate("We are experiencing some connectivity issues. Not all features may be available to you.")
529 </div>
530 </div>
531 </div>
532 }
533