private bool ShowInSiteMap(PageData page) { //// Might want to only expose project page types. //if(!(page is MyProjectPageBase)) //{ // return false; //} if (!page.IsIndexablePageType()) { return(false); } if (!page.CheckPublishedStatus(PagePublishedStatus.Published)) { return(false); } if (!_filterAccessWrapper.QueryDistinctAccessEdit(page, AccessLevel.NoAccess)) { return(false); } //// Dynamic property: Checkbox for including/excluding page instance in sitemap.xml. For an overridable dynamic property checkbox //// wrapper, see https://blog.mathiaskunto.com/2015/02/09/custom-property-checkbox-wrapper-as-dynamic-property-in-episerver-7-5/ //if (!(page as MyProjectPageBase).IncludeInSitemap) //{ // return false; //} return(true); }
private void ContentEvents_PublishedContent(object sender, ContentEventArgs e) { PageData page = e.Content as PageData; if (page == null) { return; } // Page is home page if (page.ContentLink.ID == ContentReference.StartPage.ID) { if (page.StopPublish.HasValue) { this._homeIsUnPublished = page.StopPublish <= DateTime.Now; } // In event "Publishing", homeIsPublished was false, now it is. Send a recrawl if (this._homeIsUnPublished && page.CheckPublishedStatus(PagePublishedStatus.Published)) { string url = _siteimproveHelper.GetExternalUrl(page); if (url != null) { _siteimproveHelper.PassEvent("recrawl", url, this._settingsRepository.GetToken()); } this._homeIsUnPublished = false; return; } } if (!this._settingsRepository.GetSetting().NoRecheck) { if (page.CheckPublishedStatus(PagePublishedStatus.Published)) { string url = _siteimproveHelper.GetExternalUrl(page); if (url != null) { _siteimproveHelper.PassEvent("recheck", url, this._settingsRepository.GetToken()); } } else { _siteimproveHelper.PassEvent("recheck", "", this._settingsRepository.GetToken()); } } }
public static bool ShouldExcludePage(PageData page) { if (page == null) { return(true); } if (!IsAccessibleToEveryone(page)) { return(true); } if (!page.CheckPublishedStatus(PagePublishedStatus.Published)) { return(true); } if (!IsVisibleOnSite(page)) { return(true); } if (IsLink(page)) { return(true); } if (!IsSitemapPropertyEnabled(page)) { return(true); } if (page.PageLink == ContentReference.WasteBasket) { return(true); } if (page.IsDeleted) { return(true); } if (!page.HasTemplate()) { return(true); } return(false); }
public static bool FilterPage(PageData page) { if (page == null) { return(true); } if (!IsAccessibleToEveryone(page)) { return(true); } if (!page.CheckPublishedStatus(PagePublishedStatus.Published)) { return(true); } if (!page.IsVisibleOnSite) { return(true); } if (IsLink(page)) { return(true); } if (!IsSitemapPropertyEnabled(page)) { return(true); } if (page.PageLink == PageReference.WasteBasket) { return(true); } return(false); }
public static bool FilterPage(PageData page) { if (page == null) { return true; } if (!IsAccessibleToEveryone(page)) { return true; } if (!page.CheckPublishedStatus(PagePublishedStatus.Published)) { return true; } if (!page.IsVisibleOnSite) { return true; } if (IsLink(page)) { return true; } if (!IsSitemapPropertyEnabled(page)) { return true; } if (page.PageLink == PageReference.WasteBasket) { return true; } return false; }
private bool IsPageHasPublished(PageData pageData) { return(pageData != null && pageData.CheckPublishedStatus(PagePublishedStatus.PublishedIgnoreStopPublish)); }
public static bool IsPublished(this PageData item) { return(item.CheckPublishedStatus(PagePublishedStatus.Published)); }
private bool ShouldIndexPage(PageData page) { return(page.CheckPublishedStatus(PagePublishedStatus.Published)); }