[NOP 4.1] BlogPosts - not included in sitemap...

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
4 years ago
1. Version: 4.1
2. Expected behavior: Blogposts included in sitemap.
3. Actual behavior: Blogposts are not included in sitemap.
4. Steps to reproduce the problem: no steps ;) Or just check your sitemap and try find blogposts there.
5. Any private modifications you made to your nopCommerce: We use RichBlog plugin from Nop-templates, but don't know is there any changes.

Maybe someone know how to fix it?
4 years ago
There's a checkbox on a blog details page to include this blog post to sitemap
4 years ago
Hi! Andrei, could you show me where? Maybe you add this in 4.2? I write about ver 4.1

In Blog settings I have only:
- Blog enabled
- how much posts i want to show
- tags cloud
- Rss

And Blog comments. Nothing more.

In content managment / blog post i Have title long / short description / tags / comments, and that's all. In SEO tab standard keywords / meta / meta title / seo name

I also tried in all settings in search "sitemap" all i have set on True.

In Admin General Common also i have all included (categories/manufacturers / products / product tags, but don't have nothing about Blog post.

Can you help me find this?
4 years ago
Yes sitemapsettings.sitemapincludeblogposts is only in v4.2
You would need to customise to add the blogposts in v4.1
Or as you use the RichBlog maybe the developer can do something for you ?
4 years ago
Bad news :( we are not rdy to move to 4.2.

It's hard to make this custom? or maybe it's few code line to add? ;)
4 years ago
You need to edit v4.2\src\Presentation\Nop.Web\Factories\CommonModelFactory.cs
        public virtual SitemapModel PrepareSitemapModel(SitemapPageModel pageModel)
Add in the code from v4.2
                
//blog posts
if (_sitemapSettings.SitemapIncludeBlogPosts && _blogSettings.Enabled)
{
      var blogPostsGroupTitle = _localizationService.GetResource("Sitemap.BlogPosts");
      var blogPosts = _blogService.GetAllBlogPosts(storeId: _storeContext.CurrentStore.Id)
            .Where(p => p.IncludeInSitemap);

      model.Items.AddRange(blogPosts.Select(post => new SitemapModel.SitemapItemModel
      {
            GroupTitle = blogPostsGroupTitle,
            Name = post.Title,
            Url = urlHelper.RouteUrl("BlogPost", new { SeName = _urlRecordService.GetSeName(post) })
      }));
}
4 years ago
Thx a lot! i send it to my IT support ;)
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.