Blog post URLs

Posted by Community Admin on 03-Aug-2018 20:58

Blog post URLs

All Replies

Posted by Community Admin on 19-Jan-2012 00:00

I've added a page ~/Blog with a Blog Posts widget which correctly displays entries from my blog.
However, the title URLs link to, for example,

~/blog/blog/2012/01/18/some-blog-entry-title

as opposed to

~/blog/2012/01/18/some-blog-entry-title

I'm not sure why "blog" is prepended twice to the beginning of the URL. How can I alter this behavior?

Also, I'd like to add a list of recent posts in the right hand column of the page. This works using the Blog Lists widget however, when on a page that displays an individual blog post, the post is expanded in both the list in the right column and the main content area. Suggestions?

Thanks,

Dave


Posted by Community Admin on 19-Jan-2012 00:00

Hi Dave,

Regarding the blog post urls, this is because of the way that the Blogs Provider creates urls: It includes both the Blog UrlName and the Blog Post UrlName.

It is possible to override this behavior, however it does involve creating a new class. Fortunately the process is pretty simple, and is outlined in this post: Custom URL Formats for Sitefinity Content Modules

In that example, they add an additional provider for the new blog format, however you can also simply replace the type of the existing provider to be the custom one you make. Then all your blog posts will use whatever format you specify, including leaving out the blog name.

Regarding the list of recent posts, by default a blogpostsview is going to change its rendering type (list vs details) based on the url, which is what you're seeing.

Fortunately this also can be overriden by changing the ContentViewDisplayMode from "Automatic" to "Master". This property can be set by editing the widget and clicking the "Advanced" button on the bottom right corner of the control designer.

I hope this is helpful! let me know if you have any questions or encounter any issues!

This thread is closed