Hello All,
I am using Nop 3.10 and I wish to change the URL for each post. By default blog url is "mydomian.com/blog" and each post url is something like this "mydomain.com/myposttitle.
I am trying to use the following URL instead;
"mydomain.com/blog/myposttitle"
So far I have changed route on "GenericUrlRouteProvider.cs" file from;
routes.MapLocalizedRoute("BlogPost",
"{SeName}",
new { controller = "Blog", action = "BlogPost" },
new[] { "Nop.Web.Controllers" });
to;
routes.MapLocalizedRoute("BlogPost",
"blog/"+"{SeName}",
new { controller = "Blog", action = "BlogPost" },
new[] { "Nop.Web.Controllers" });
But this throws errors when I try to browse;
mydomain.com/blog/customer-service-client-service
The parameters dictionary contains a null entry for parameter 'blogPostId' of non-nullable type 'System.Int32' for method 'System.Web.Mvc.ActionResult BlogPost(Int32)' in 'Nop.Web.Controllers.BlogController'. An optional parameter must be a reference type, a nullable type, or be declared as an optional parameter.
Parameter name: parameters
I need to make some changes to "BlogController.cs" file but cannot figure out where.
Any help or advise will be much appreciated.