Error executing template "Designs/Swift/_parsed/Swift_Page.parsed.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at Dynamicweb.Ecommerce.DynamicwebLiveIntegration.Connectors.Connector.get_CurrentConnector()
   at Dynamicweb.Ecommerce.DynamicwebLiveIntegration.Connectors.Connector.IsWebServiceConnectionAvailable()
   at CompiledRazorTemplates.Dynamic.RazorEngine_c97ebe9ba1214c15a800239a3099b2d4.Execute() in E:\Dynamicweb.net\Solutions\werd.dev08.dynamicweb.dk\Files\Templates\Designs\Swift\_parsed\Swift_Page.parsed.cshtml:line 333
   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 headerCssClass = "sticky-top"; 74 bool movePageBehind = false; 75 string scrollInitScript = "swift.Scroll.init(); AOS.init({offset: 240, duration: 600, delay: 100}); disable: window.matchMedia('(prefers-reduced-motion: reduce)');"; 76 if (Pageview.Page.PropertyItem != null) 77 { 78 headerCssClass = Pageview.Page.PropertyItem["MoveThisPageBehindTheHeader"] != null ? Pageview.Page.PropertyItem["MoveThisPageBehindTheHeader"].ToString() : "sticky-top"; 79 movePageBehind = headerCssClass == "fixed-top" && !Pageview.IsVisualEditorMode ? true : false; 80 } 81 headerCssClass = headerCssClass == "" ? "sticky-top" : headerCssClass; 82 headerCssClass = Pageview.IsVisualEditorMode ? "" : headerCssClass; 83 84 string googleAnalyticsTrackingID = Model.Area.Item.GetString("GoogleAnalyticsTrackingID"); 85 bool allowCookies = CookieManager.GetCookieOptInLevel() == 0 || !CookieManager.CookieOptInLevelExists ? false : true; 86 87 Dynamicweb.Context.Current.Response.AddHeader("link", $"</Files/Templates/Designs/Swift/Assets/css/styles.css?{cssStyleFileInfo.LastWriteTime.Ticks}>; rel=preload; as=style;"); 88 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;"); 89 Dynamicweb.Context.Current.Response.AddHeader("link", $"</Files/Templates/Designs/Swift/Assets/js/aos.js?{jsFileInfo.LastWriteTime.Ticks}; rel=preload; as=script;"); 90 Dynamicweb.Context.Current.Response.AddHeader("link", $"</Files/Templates/Designs/Swift/Assets/js/scripts.js?{jsFileInfo.LastWriteTime.Ticks}; rel=preload; as=script;"); 91 //Dynamicweb.Context.Current.Response.Flush(); //This sends the headers where we are now in the rendering making the TTFB faster 92 93 SetMetaTags(); 94 95 List<Dynamicweb.Content.Page> languages = new List<Dynamicweb.Content.Page>(); 96 97 if (Pageview.Area.IsMaster) 98 { 99 languages.Add(Pageview.Page); 100 if (Pageview.Page.Languages != null) 101 { 102 foreach (var language in Pageview.Page.Languages) 103 { 104 languages.Add(language); 105 } 106 } 107 } 108 else 109 { 110 languages.Add(Pageview.Page.MasterPage); 111 if (Pageview.Page.MasterPage != null) 112 { 113 if (Pageview.Page.MasterPage.Languages != null) 114 { 115 foreach (var language in Pageview.Page.MasterPage.Languages) 116 { 117 languages.Add(language); 118 } 119 } 120 } 121 } 122 123 string siteLanguage = Pageview.Area.CultureInfo.Name; 124 Uri url = Dynamicweb.Context.Current.Request.Url; 125 string hostName = url.Host; // domain.com/da-dk or domain.com/en-us 126 127 var ecomCountries = Dynamicweb.Ecommerce.Services.Countries.GetCountries(); 128 var ecomCurrencies = Dynamicweb.Ecommerce.Services.Currencies.GetAllCurrencies(); 129 } 130 <!doctype html> 131 <html lang="@Pageview.Area.CultureInfo.TwoLetterISOLanguageName"> 132 <head> 133 <!-- @swiftVersion --> 134 @* Required meta tags *@ 135 <meta charset="utf-8"> 136 <meta name="viewport" content="height=device-height, width=device-width, initial-scale=1.0"> 137 <link rel="preconnect" href="https://fonts.gstatic.com" /> 138 139 <link rel="shortcut icon" href="~/Files/Templates/Designs/Swift/Assets/Images/favicon.png"> 140 <link rel="apple-touch-icon" href="~/Files/Templates/Designs/Swift/Assets/Images/logo_transparent.png"> 141 142 @Model.MetaTags 143 144 @{ 145 @* Languages meta data *@ 146 foreach (var language in languages) 147 { 148 if (language?.Area != null) 149 { 150 if (language != null && language.Published && language.Active && language.Area.Active && language.Area.Published && language.Area.ID != Dynamicweb.Frontend.PageView.Current().AreaID) 151 { 152 if (!string.IsNullOrEmpty(language.Area.DomainLock)) 153 { 154 hostName = language.Area.DomainLock; //dk.domain.com or dk-domain.dk 155 } 156 string friendlyUrl = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(language.ID); 157 string href = $"{url.Scheme}://{hostName}{friendlyUrl}"; 158 159 <link rel="alternate" hreflang="@language.Area.CultureInfo.Name.ToLower()" href="@href" /> 160 } 161 } 162 } 163 } 164 165 <title>@Model.Title</title> 166 @* Bootstrap + Swift stylesheet *@ 167 <link href="~/Files/Templates/Designs/Swift/Assets/css/styles.css?@cssStyleFileInfo.LastWriteTime.Ticks" rel="stylesheet" media="all" type="text/css"> 168 @* Branding and Themes min stylesheet *@ 169 <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"> 170 <script src="~/Files/Templates/Designs/Swift/Assets/js/aos.js?@jsFileInfo.LastWriteTime.Ticks" defer></script> 171 <script src="~/Files/Templates/Designs/Swift/Assets/js/scripts.js?@jsFileInfo.LastWriteTime.Ticks" defer></script> 172 173 174 @* Global site tag (gtag.js) - Google Analytics *@ 175 @if (!string.IsNullOrWhiteSpace(googleAnalyticsTrackingID) && allowCookies) 176 { 177 <script src="https://www.googletagmanager.com/gtag/js?id=@googleAnalyticsTrackingID" async></script> 178 <script> 179 window.dataLayer = window.dataLayer || []; 180 function gtag() { window.dataLayer.push(arguments); } 181 gtag('js', new Date()); 182 gtag('config', '@googleAnalyticsTrackingID'); 183 </script> 184 } 185 186 @if (!string.IsNullOrWhiteSpace(customHeaderInclude)) 187 { 188 @RenderPartial($"Components/Custom/{customHeaderInclude}") 189 } 190 </head> 191 <body class="brand @(masterTheme)" id="page@(Model.ID)" onload="@scrollInitScript"> 192 @if (renderAsResponsive || !renderMobile) 193 { 194 <header class="page-header @headerCssClass top-0@(responsiveHeaderClassDesktop)" id="page-header-desktop"> 195 @if (@Model.Area.Item.GetLink("HeaderDesktop") != null) 196 { 197 @RenderGrid(@Model.Area.Item.GetLink("HeaderDesktop").PageId) 198 } 199 </header> 200 } 201 202 @if ((renderAsResponsive || renderMobile)) 203 { 204 <header class="page-header @headerCssClass top-0@(responsiveHeaderClassMobile)" id="page-header-mobile"> 205 @if (@Model.Area.Item.GetLink("HeaderMobile") != null) 206 { 207 @RenderGrid(@Model.Area.Item.GetLink("HeaderMobile").PageId) 208 } 209 </header> 210 } 211 212 <main id="content" @(schemaOrgType)> 213 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 214 @using System 215 @using Dynamicweb.Ecommerce.ProductCatalog 216 217 @{ 218 bool isArticlePagePage = Model.ItemType == "Swift_Article"; 219 string schemaOrgProp = string.Empty; 220 if(isArticlePagePage) 221 { 222 schemaOrgProp = "itemprop=\"articleBody\""; 223 } 224 225 string theme = ""; 226 string gridContent = ""; 227 228 if (Model.PropertyItem != null) 229 { 230 theme = !string.IsNullOrWhiteSpace(Model.PropertyItem.GetRawValueString("Theme")) ? " theme " + Model.PropertyItem.GetRawValueString("Theme").Replace(" ", "").Trim().ToLower() : ""; 231 } 232 233 if (Model.Item != null) 234 { 235 gridContent = Model.Grid("Grid", "Grid", "default:true;sort:1", "Page"); 236 } 237 238 bool doNotRenderPage = false; 239 240 //Check if we are on the poduct detail page, and if there is data to render 241 ProductViewModel product = new ProductViewModel(); 242 if (Dynamicweb.Context.Current.Items.Contains("ProductDetails")) 243 { 244 product = (ProductViewModel)Dynamicweb.Context.Current.Items["ProductDetails"]; 245 if (string.IsNullOrEmpty(product.Id)) { 246 doNotRenderPage = true; 247 } 248 } 249 250 //Render the page 251 if (!doNotRenderPage) { 252 string itemIdentifier = Model?.Item?.SystemName != null ? "item_" + Model.Item.SystemName.ToLower() : "item_Swift_Page"; 253 254 if (theme != "") 255 { 256 <div class="@theme item_@itemIdentifier" @schemaOrgProp> 257 @gridContent 258 </div> 259 } 260 else 261 { 262 <div class="item_@itemIdentifier" @schemaOrgProp> 263 @gridContent 264 </div> 265 } 266 } else { 267 <div class="container"> 268 <div class="alert alert-info" role="alert">@Translate("Sorry. There is nothing to view here")</div> 269 </div> 270 } 271 272 if (!Model.IsCurrentUserAllowed) 273 { 274 int signInPage = GetPageIdByNavigationTag("SignInPage"); 275 int dashboardPage = GetPageIdByNavigationTag("MyAccountDashboardPage"); 276 277 if (!Pageview.IsVisualEditorMode) 278 { 279 if (signInPage != 0) 280 { 281 if (signInPage != Model.ID) { 282 Dynamicweb.Context.Current.Response.Redirect("/Default.aspx?ID=" + signInPage); 283 } else { 284 if (dashboardPage != 0) { 285 Dynamicweb.Context.Current.Response.Redirect("/Default.aspx?ID=" + dashboardPage); 286 } else { 287 Dynamicweb.Context.Current.Response.Redirect("/"); 288 } 289 } 290 } 291 else 292 { 293 <div class="alert alert-dark m-0" role="alert"> 294 <span>@Translate("You do not have access to this page")</span> 295 </div> 296 } 297 } 298 else 299 { 300 <div class="alert alert-dark m-0" role="alert"> 301 <span>@Translate("To work on this page, you must be signed in, in the frontend")</span> 302 </div> 303 } 304 } 305 } 306 307 </main> 308 309 @if (renderAsResponsive || !renderMobile) 310 { 311 <footer class="page-footer d-none d-lg-block" id="page-footer-desktop"> 312 @if (@Model.Area.Item.GetLink("FooterDesktop") != null) 313 { 314 @RenderGrid(@Model.Area.Item.GetLink("FooterDesktop").PageId) 315 } 316 </footer> 317 } 318 319 @if (renderAsResponsive || renderMobile) 320 { 321 <footer class="page-footer d-block d-lg-none" id="page-footer-mobile"> 322 @if (@Model.Area.Item.GetLink("FooterMobile") != null) 323 { 324 @RenderGrid(@Model.Area.Item.GetLink("FooterMobile").PageId) 325 } 326 </footer> 327 } 328 329 @* Render any offcanvas menu here *@ 330 @RenderSnippet("offcanvas") 331 332 @{ 333 bool isErpConnectionDown = !Dynamicweb.Ecommerce.DynamicwebLiveIntegration.TemplatesHelper.IsWebServiceConnectionAvailable(); 334 if (isErpConnectionDown && Model.Area.Item.GetBoolean("ShowErpDownMessage")) 335 { 336 @RenderNoErpConnectionMessage() 337 } 338 } 339 340 @* Language selector modal *@ 341 @if (languages.Count > 1 || ecomCountries.Count > 1 || ecomCurrencies.Count() > 1) 342 { 343 <div class="modal fade" id="PreferencesModal" tabindex="-1" aria-hidden="true"> 344 <div class="modal-dialog modal-dialog-centered modal-sm" id="PreferencesModalContent"> 345 @* The content here comes from an external request *@ 346 </div> 347 </div> 348 } 349 350 @* Favorite toast *@ 351 <div aria-live="polite" aria-atomic="true"> 352 <div class="position-fixed bottom-0 end-0 p-3" style="z-index: 11"> 353 <div id="favoriteNotificationToast" class="toast" role="alert" aria-live="assertive" aria-atomic="true"> 354 <div class="toast-header"> 355 <strong class="me-auto">@Translate("Favorite list updated")</strong> 356 <button type="button" class="btn-close" data-bs-dismiss="toast" aria-label="Close"></button> 357 </div> 358 <div class="toast-body d-flex gap-3"> 359 <div id="favoriteNotificationToast_Image"></div> 360 <div id="favoriteNotificationToast_Text"></div> 361 </div> 362 </div> 363 </div> 364 </div> 365 366 @* Modal for dynamic content *@ 367 <div class="modal fade js-product" id="DynamicModal" tabindex="-1" aria-hidden="true"> 368 <div class="modal-dialog modal-dialog-centered modal-md"> 369 <div class="modal-content theme light" id="DynamicModalContent"> 370 @* The content here comes from an external request *@ 371 </div> 372 </div> 373 </div> 374 375 @* Offcanvas for dynamic content *@ 376 <div class="offcanvas offcanvas-end theme light" tabindex="-1" id="DynamicOffcanvas" style="width: 30rem"> 377 @* The content here comes from an external request *@ 378 </div> 379 </body> 380 </html> 381 @functions { 382 383 void SetMetaTags() 384 { 385 //Verification Tokens 386 string siteVerificationGoogle = Model.Area.Item.GetString("Google_Site_Verification") != null ? Model.Area.Item.GetString("Google_Site_Verification") : ""; 387 //string siteVerificationYandex = Model.Area.Item.GetString("Yandex_Verification") != null ? Model.Area.Item.GetString("Yandex_Verification") : ""; 388 //string siteVerificationMS = Model.Area.Item.GetString("Msvalidate_01") != null ? Model.Area.Item.GetString("Msvalidate_01") : ""; 389 //string siteVerificationAlexa = Model.Area.Item.GetString("AlexaVerifyID") != null ? Model.Area.Item.GetString("AlexaVerifyID") : ""; 390 //string siteVerificationPinterest = Model.Area.Item.GetString("P_domain_verify") != null ? Model.Area.Item.GetString("P_domain_verify") : ""; 391 //string siteVerificationNorton = Model.Area.Item.GetString("Norton_safeweb_site_verification") != null ? Model.Area.Item.GetString("Norton_safeweb_site_verification") : ""; 392 393 //Generic Site Values 394 string openGraphFacebookAppID = Model.Area.Item.GetString("Fb_app_id") != null ? Model.Area.Item.GetString("Fb_app_id") : ""; 395 string openGraphType = Model.Area.Item.GetString("Open_Graph_Type") != null ? Model.Area.Item.GetString("Open_Graph_Type") : ""; 396 string openGraphSiteName = Model.Area.Item.GetString("Open_Graph_Site_Name") != null ? Model.Area.Item.GetString("Open_Graph_Site_Name") : ""; 397 398 string twitterCardSite = Model.Area.Item.GetString("Twitter_Site") != null ? Model.Area.Item.GetString("Twitter_Site") : ""; 399 400 //Page specific values 401 string openGraphSiteTitle = Model.Area.Item.GetString("Open_Graph_Title") != null ? Model.Area.Item.GetString("Open_Graph_Title") : ""; 402 FileViewModel openGraphImage = Model.Area.Item.GetFile("Open_Graph_Image"); 403 string openGraphImageALT = Model.Area.Item.GetString("Open_Graph_Image_ALT") != null ? Model.Area.Item.GetString("Open_Graph_Image_ALT") : ""; 404 string openGraphDescription = Model.Area.Item.GetString("Open_Graph_Description") != null ? Model.Area.Item.GetString("Open_Graph_Description") : ""; 405 406 string twitterCardURL = Model.Area.Item.GetString("Twitter_URL") != null ? Model.Area.Item.GetString("Twitter_URL") : ""; 407 string twitterCardTitle = Model.Area.Item.GetString("Twitter_Title") != null ? Model.Area.Item.GetString("Twitter_Title") : ""; 408 string twitterCardDescription = Model.Area.Item.GetString("Twitter_Description") != null ? Model.Area.Item.GetString("Twitter_Description") : ""; 409 FileViewModel twitterCardImage = Model.Area.Item.GetFile("Twitter_Image"); 410 string twitterCardImageALT = Model.Area.Item.GetString("Twitter_Image_ALT") != null ? Model.Area.Item.GetString("Twitter_Image_ALT") : ""; 411 412 if (!string.IsNullOrEmpty(siteVerificationGoogle)) 413 { 414 Pageview.Meta.AddTag("google-site-verification", siteVerificationGoogle); 415 } 416 417 if (!string.IsNullOrEmpty(openGraphFacebookAppID)) 418 { 419 Pageview.Meta.AddTag("fb:app_id", openGraphFacebookAppID); 420 } 421 422 if (!string.IsNullOrEmpty(openGraphType)) 423 { 424 Pageview.Meta.AddTag("og:type", openGraphType); 425 } 426 427 if (!string.IsNullOrEmpty(openGraphSiteName)) 428 { 429 Pageview.Meta.AddTag("og:site_name", openGraphSiteName); 430 } 431 if (!string.IsNullOrEmpty(Model.Title)) 432 { 433 Pageview.Meta.AddTag("og:title", Model.Title); 434 } 435 else 436 { 437 Pageview.Meta.AddTag("og:title", openGraphSiteTitle); 438 } 439 440 441 if (string.IsNullOrEmpty(Dynamicweb.Context.Current.Request.QueryString["ProductID"])) 442 { 443 if (!string.IsNullOrEmpty(Model.Description)) 444 { 445 Pageview.Meta.AddTag("og:description", Model.Description); 446 } 447 else 448 { 449 Pageview.Meta.AddTag("og:description", openGraphDescription); 450 } 451 if (openGraphImage != null) 452 { 453 Pageview.Meta.AddTag("og:image", openGraphImage.Path); 454 } 455 456 if (!string.IsNullOrEmpty(openGraphImageALT)) 457 { 458 Pageview.Meta.AddTag("og:image:alt", openGraphImageALT); 459 } 460 if (!string.IsNullOrEmpty(twitterCardDescription)) 461 { 462 Pageview.Meta.AddTag("twitter:description", twitterCardDescription); 463 } 464 465 if (twitterCardImage != null) 466 { 467 Pageview.Meta.AddTag("twitter:image", twitterCardImage.Path); 468 } 469 470 if (!string.IsNullOrEmpty(twitterCardImageALT)) 471 { 472 Pageview.Meta.AddTag("twitter:image:alt", twitterCardImageALT); 473 } 474 } 475 476 if (!string.IsNullOrEmpty(twitterCardSite)) 477 { 478 Pageview.Meta.AddTag("twitter:site", twitterCardSite); 479 } 480 481 if (!string.IsNullOrEmpty(twitterCardURL)) 482 { 483 Pageview.Meta.AddTag("twitter:url", twitterCardURL); 484 } 485 486 if (!string.IsNullOrEmpty(twitterCardTitle)) 487 { 488 Pageview.Meta.AddTag("twitter:title", twitterCardTitle); 489 } 490 } 491 } 492 493 @helper RenderNoErpConnectionMessage() 494 { 495 string erpDownMessageTheme = !string.IsNullOrWhiteSpace(Model.Area.Item.GetRawValueString("ErpDownMessageTheme")) ? " theme " + Model.Area.Item.GetRawValueString("ErpDownMessageTheme").Replace(" ", "").Trim().ToLower() : "theme light"; 496 497 <div class="position-fixed bottom-0 end-0 p-3" style="z-index: 1040"> 498 <div class="toast fade show border-0 @erpDownMessageTheme" role="alert" aria-live="assertive" aria-atomic="true"> 499 <div class="toast-header"> 500 <strong class="me-auto">@Translate("Connection down")</strong> 501 <button type="button" class="btn-close" data-bs-dismiss="toast" aria-label="Close"></button> 502 </div> 503 <div class="toast-body"> 504 @Translate("We are experiencing some connectivity issues. Not all features may be available to you.") 505 </div> 506 </div> 507 </div> 508 } 509