This post is on the older side and its content may be out of date.
Be sure to visit our blogs homepage for our latest news, updates and information.
public class PagePipeNoIndex : PageInboundPipe{ protected override IEnumerable<PageNode> LoadPageNodes() { return base.LoadPageNodes().Where(n => this.CanProcessItem(n)); } public override bool CanProcessItem(object item) { if (item == null) return false; if (item is PageData) { var pageData = item as PageData; if (pageData.NavigationNode.IsBackend) { return false; } if (!pageData.Crawlable) { return false; } } if (item is PageNode) { var pageNode = (PageNode)item; if (pageNode.IsBackend) return false; if ((pageNode.NodeType != NodeType.Standard && pageNode.NodeType != NodeType.External) || !pageNode.Page.Crawlable) { return false; } } return base.CanProcessItem(item); } }public class Global : System.Web.HttpApplication{ protected void Application_Start(object sender, EventArgs e) { Bootstrapper.Initialized += Bootstrapper_Initialized; } void Bootstrapper_Initialized(object sender, Telerik.Sitefinity.Data.ExecutedEventArgs e) { if (e.CommandName == "Bootstrapped") { ReplacePagePipeWithCustomPagePipe(); } } private void ReplacePagePipeWithCustomPagePipe() { //Remove the default page pipe PublishingSystemFactory.UnregisterPipe(PageInboundPipe.PipeName); //This code will add the PagePipeNoIndex to the registered pipes with the original page pipe name //so when the publishing system try's to use the page pipe will use the new one PublishingSystemFactory.RegisterPipe(PageInboundPipe.PipeName, typeof(PagePipeNoIndex)); }...}Subscribe to get all the news, info and tutorials you need to build better business apps and sites