nopAdvance wrote:Hello,
What you are doing is right but I think you should check following things and make some modifications to your code.
# Check "GetSeName" method in "SeoExtensions.cs" file under Nop.Services project
# Allowed characters in SEO friendly name are "abcdefghijklmnopqrstuvwxyz1234567890 _-" and maximum length allowed is 200 chars as per defined in "ValidateSeName" method in same code file. Also, space is not allowed in SE name
# Take a look at this line "var seName = blogPost.ValidateSeName(model.SeName, model.Title, true);" line number 219 in "BlogController.cs" file under Admin -> Controllers in nopCommerce project
This will give you a clear idea of what mistake you are making. Hope this will help otherwise you can ask for more help here..
Thank you. All my naming contained allowed characters and were well under the 200 character limit. I wish I could say I understood what was going on with the Caching when GetSeName runs but it was enough to show me I needed to somehow perform a cache update or requery.
timmit wrote:SEO names are cached, so you would need to clear the cache after manually inserting a UrlRecord row.
This was what I was able to do to get the blogpost to show, so thank you for this answer.
One thing that I still don't quite understand is why (even after clearing the two tables of any related records) the blogpost sometimes showed up as a post in the 'Month' count, but other times it didn't. Because of the changes I was making to my code (such as setting language id to 0 or 1) I thought it was my changes that caused it, but it wasn't. It seems that a manually added blog post will sometimes be added to the month count (or even to show a month as having a single blog post, and sometimes the month name not appearing at all) and sometimes it wont, before clearing the cache manually.
Anyway I'm ok with this issue now, so thank you both for your help. This has enabled me to complete the part of my program which compiles a blog post from my own database and sends that and uploads images and adds them to the blog post all in one action, which saves me quite a bit of time from doing it manually.