SiteMap

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
9 years ago
a.m. wrote:
Is there a way to generate also the Sitemap.xml that all SEO engines look for?
http://demo.nopcommerce.com/sitemapseo

The above page give "Page not Found" error. Also I put the same for my website in google sitemap and get a 404 error.
9 years ago
Ok got it, I have to use /sitemap.xml
8 years ago
Nop 3.7

I'm looking to spruce up the Sitemap.cshtml page. Right now it's pretty horrible in it's structure. I want to include the main categories and under them the sub categories but the SitemapModel does not contain ParentCategoryId. Nor does the CategoryModel that is within the SitemapModel. I have made modifications.

Nop.Core.Domain.Catalog Category.cs already contains ParentCategoryId

Nop.Data.Catalog CategoryMap.cs modification
this.Property(c => c.ParentCategoryId).IsRequired();

Nop.Web.Models.Catalog CategoryModel.cs modification
public int ParentCategoryId { get; set; }

Sitemap.cshtml SitemapModel CategoryModel now has the property ParentCategoryId The below code pulls the correct main categories but will not pull in the subcategories


  @if (Model.Categories.Count > 0)
  {
    List<int> mainCategories = new List<int>
    { 2799, 3869, 3302, 2862, 298, 3451, 2809, 2828, 3001, 3319, 303, 207, 2793 };
    int numItems = mainCategories.Count();

    <div class="page-header-custom">
      <h4>@T("Sitemap.Categories")</h4>
    </div>
    <div class="panel panel-default">
      <div class="panel-body">
        <div class="list-group">
          @for (int i = 0; i < numItems; i++)
          {
            foreach (var category in Model.Categories.Where(x => x.Id == mainCategories[i]))
            {
              <a class="" href="@Url.RouteUrl("Category", new { SeName = category.SeName })">@category.Name</a>
              foreach (var subCategory in Model.Categories.Where(x => x.ParentCategoryId == mainCategories[i]))
              {
                <a class="" href="@Url.RouteUrl("Category", new { SeName = subCategory.SeName })">@subCategory.Name</a>
              }
            }
          }
        </div>
      </div>
    </div>
  }



Anyone know why this is not working?
Does the controller need to be modified as well and if so how?

Thanks
8 years ago
Hi,

The following URL is giving error 404:

http://demo.nopcommerce.com/sitemapseo

I am using nop3.7


Regards,
Harsh
8 years ago
harsh21289 wrote:
Hi,

The following URL is giving error 404:

http://demo.nopcommerce.com/sitemapseo

I am using nop3.7


Regards,
Harsh


Hi,

try this: http://demo.nopcommerce.com/sitemap.xml
8 years ago
Is it possible, and if so how, to include only published product and categories in the sitemap?
7 years ago
Is there a way to generate also the Sitemap.xml that all SEO engines look for?
The link given gives a 404 page

How do we get this done?
7 years ago
lwflowers wrote:
Is there a way to generate also the Sitemap.xml that all SEO engines look for?
The link given gives a 404 page

How do we get this done?


Ensure that sitemap is enabled: admin area -> Configuration -> Settings -> All settings (advanced) -> commonsettings.sitemapenabled
7 years ago
Mariann wrote:
Ensure that sitemap is enabled: admin area -> Configuration -> Settings -> All settings (advanced) -> commonsettings.sitemapenabled


Just quick thought. Not every nopCommerce user is advanced user, so maybe it would be good solution to show that checkbox at the "General And Miscellaneous Settings"/SEO tab?
7 years ago
hey mariann,
enabling this does not produce a /sitemap.xml page.
Google only wants a certain sitemap page for the crawlers ie... .xml, .html, or text etc..
I am using 3.7
Google rejects the current format.
Is there a way to have the site do a .xml page just as the same as currently doing now.
This is a great sitemap fore the website, but the search engines do not care for it and do not use it.
Let me know.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.