/// <summary>
        /// Called before an action result executes.
        /// </summary>
        /// <param name="filterContext">The filter context.</param>
        public void OnResultExecuting(ResultExecutingContext filterContext)
        {
            HomePage homePage = _siteConfiguration.GetStartPage();

            if (homePage != null)
            {
                SettingsBlock settings = homePage.Settings;

                // This can actually be null if we have a problem with our language settings
                if (settings != null)
                {
                    var chrome = PopulateChrome(homePage, settings);

                    filterContext.Controller.ViewBag.Chrome = chrome;
                }
            }

            var viewModel = filterContext.Controller.ViewData.Model;

            var model = viewModel as IPageViewModel <SitePage>;

            if (model != null)
            {
                PopulateOpenGraph(filterContext, model);
            }
        }
        /// <summary>
        /// Called before an action result executes.
        /// </summary>
        /// <param name="filterContext">The filter context.</param>
        public void OnResultExecuting(ResultExecutingContext filterContext)
        {
            HomePage homePage = _siteConfiguration.GetStartPage();

            if (homePage != null)
            {
                SettingsBlock settings = homePage.Settings;

                // This can actually be null if we have a problem with our language settings
                if (settings != null)
                {
                    var chrome = new Chrome();
                    chrome.TopLeftMenu      = homePage.TopLeftMenu;
                    chrome.TopRightMenu     = homePage.TopRightMenu;
                    chrome.FooterMenu       = GetFooterMenuContent(homePage);
                    chrome.SocialMediaIcons = homePage.SocialMediaIcons;
                    chrome.LoginPage        = settings.LoginPage;
                    chrome.AccountPage      = settings.AccountPage;
                    chrome.CheckoutPage     = settings.CheckoutPage;
                    chrome.SearchPage       = settings.SearchPage;
                    if (homePage.LogoImage != null)
                    {
                        chrome.LogoImageUrl = _urlResolver.GetUrl(homePage.LogoImage);
                    }
                    else
                    {
                        chrome.LogoImageUrl = new Url("/Content/Images/commerce-shop-logo.png");
                    }

                    chrome.HomePageUrl = _urlResolver.GetUrl(homePage.ContentLink);

                    // Note! The natural place for the footer content is in the settings block
                    // with the rest of the content, but that makes it impossible to edit the
                    // content area on the page. So we keep it directly on the start page.
                    chrome.GlobalFooterContent = homePage.GlobalFooterContent;

                    // Set up languages for Chrome
                    var contentLoader = ServiceLocator.Current.GetInstance <IContentLoader>();
                    var startPage     = contentLoader.Get <HomePage>(ContentReference.StartPage);
                    chrome.Language  = startPage.LanguageBranch;
                    chrome.Languages = GetLanguageInfo(startPage);

                    filterContext.Controller.ViewBag.Chrome = chrome;
                }
            }
        }