public void UpdateHomePage(
            StartPage startPage,
            MetadataContainerReferences metadataContainerReferences,
            string footerText,
            ContentArea mainContentArea,
            PageReference menuContainerPageReference,
            ContentReference logo,
            ContentReference mobileLogo)
        {
            var homePage = startPage.CreateWritableClone() as StartPage;

            homePage.PrimaryNavigationContainerPage = metadataContainerReferences.MenuContainerPage.PageLink;
            homePage.FooterText      = new XhtmlString(footerText);
            homePage.CopyRightNotice = footerText;
            homePage.MainContentArea = mainContentArea;
            homePage.Logo            = logo;
            homePage.MobileLogo      = mobileLogo;

            PageTypeServices.StartPageService.Save(homePage);
        }
        public StartPage EnsureSettingsAndResourcePagesExist(StartPage startPage, MetadataContainerReferences metadataContainerReferences)
        {
            if (startPage == null)
            {
                throw new InvalidOperationException();
            }

            var requireSave = PageReference.IsNullOrEmpty(startPage.SiteSettingsPage);

            if (!requireSave)
            {
                return(startPage);
            }

            var homePage = startPage.CreateWritableClone() as StartPage;

            homePage.SiteSettingsPage = metadataContainerReferences.SettingsPage.PageLink;

            PageTypeServices.StartPageService.Save(homePage);

            return(homePage);
        }