public XmlSitemapProvider PublishXmlSitemap(XmlSitemapBuildContext context)
        {
            if (!context.LoadSetting <SeoSettings>().XmlSitemapIncludesForum || !context.LoadSetting <ForumSettings>().ForumsEnabled)
            {
                return(null);
            }

            return(new ForumXmlSitemapResult(context, this, _urlHelper.Value, _urlRecordService.Value));
        }
示例#2
0
        public XmlSitemapProvider PublishXmlSitemap(XmlSitemapBuildContext context)
        {
            if (!context.LoadSetting <SeoSettings>().XmlSitemapIncludesNews || !context.LoadSetting <NewsSettings>().Enabled)
            {
                return(null);
            }

            var query = GetAllNews(context.RequestStoreId, 0, int.MaxValue).SourceQuery;

            return(new NewsXmlSitemapResult {
                Query = query
            });
        }
        public XmlSitemapProvider PublishXmlSitemap(XmlSitemapBuildContext context)
        {
            if (!context.LoadSetting <SeoSettings>().XmlSitemapIncludesCategories)
            {
                return(null);
            }

            var query = BuildCategoriesQuery(showHidden: false, storeId: context.RequestStoreId);

            return(new CategoryXmlSitemapResult {
                Query = query
            });
        }
示例#4
0
        public XmlSitemapProvider PublishXmlSitemap(XmlSitemapBuildContext context)
        {
            if (!context.LoadSetting <SeoSettings>().XmlSitemapIncludesManufacturers)
            {
                return(null);
            }

            var query = GetManufacturers(false, context.RequestStoreId).OrderBy(x => x.DisplayOrder).ThenBy(x => x.Name);

            return(new ManufacturerXmlSitemapResult {
                Query = query
            });
        }
示例#5
0
        public XmlSitemapProvider PublishXmlSitemap(XmlSitemapBuildContext context)
        {
            if (!context.LoadSetting <SeoSettings>().XmlSitemapIncludesTopics)
            {
                return(null);
            }

            var query = GetAllTopics(context.RequestStoreId).AlterQuery(q =>
            {
                return(q.Where(t => t.IncludeInSitemap && !t.RenderAsWidget));
            }).SourceQuery;

            return(new TopicXmlSitemapResult {
                Query = query
            });
        }
        public XmlSitemapProvider PublishXmlSitemap(XmlSitemapBuildContext context)
        {
            if (!context.LoadSetting <SeoSettings>().XmlSitemapIncludesProducts)
            {
                return(null);
            }

            var searchQuery = new CatalogSearchQuery()
                              .VisibleOnly(_services.WorkContext.CurrentCustomer)
                              .WithVisibility(ProductVisibility.Full)
                              .HasStoreId(context.RequestStoreId);

            var query = PrepareQuery(searchQuery);

            return(new ProductXmlSitemapResult {
                Query = query, Context = context
            });
        }