How to change blog post default url format in sitefinity?

Posted by Community Admin on 04-Aug-2018 12:06

How to change blog post default url format in sitefinity?

All Replies

Posted by Community Admin on 03-May-2016 00:00

I am using sitefinity 7.1. m working on a project who require url of a blog post  /blogname/blogpostname  instead of this /blogname/12/11/2016/blogpostname.Blog post's default url contain date of post which is not required for our project.I tried many ways as said in sitefinity documents but not worked.Please tell me the correct solution for these issue.Please this is very serious issue.I hope will get write solution.

I followd follwing links :

www.sitefinity.com/.../custom_url_formats_for_sitefinity_content_modules


www.sitefinity.com/.../blog-post-custom-urls

 

Issue 2 : Addtional url not accepting url with querystring.

I need to redirect from  /blog/a-world-of-planning/2016/03/14/can-i-retire-at-55?ReturnUrl=https%3A%2F%2Fwww.mywealthtrace.com%2Fblog%2Fa-world-of-planning%2F2016%2F03%2F14%2Fcan-i-retire-at-55%3Futm_source%3Dexample.com%26utm_medium%3Dlink%26utm_compaign%3Darticle

these url to  /blog/a-world-of-planning/2016/03/14/can-i-retire-at-55

But Additional url property not doing this.

this is also a serious issue ...please consider these also

 

 

Thanks in advance.

Posted by Community Admin on 04-May-2016 00:00

For first issue i.e. remove date from blog post's  url,i followed these link

docs.sitefinity.com/for-developers-change-url-format-for-modules-with-multiple-content-types

i created CustomBlogPostUrl.cs file :

    public class CustomBlogPostUrl : Telerik.Sitefinity.Modules.Blogs.Data.OpenAccessBlogProvider
   
        /// <summary>
        /// The URL format string for blog items
        /// </summary>
        public string BlogUrlFormat
       
            get;
            set;
       

        /// <summary>
        /// The URL format string for blog post items
        /// </summary>
        public string BlogPostUrlFormat
       
            get;
            set;
       
        public override string GetUrlFormat(Telerik.Sitefinity.GenericContent.Model.ILocatable item)
       
            if (item.GetType() == typeof(Blog))
                return this.BlogUrlFormat;
            else if (item.GetType() == typeof(BlogPost))
                return this.BlogPostUrlFormat;
            else
                return base.GetUrlFormat(item);
       
        protected override void Initialize(string providerName, System.Collections.Specialized.NameValueCollection config, Type managerType)
       
            base.Initialize(providerName, config, managerType);
            this.BlogUrlFormat = config["blogUrlFormat"];
            if (String.IsNullOrEmpty(this.BlogUrlFormat))
           
                this.BlogUrlFormat = "/[UrlName]";
           
            this.BlogPostUrlFormat = config["blogPostUrlFormat"];
            if (String.IsNullOrEmpty(this.BlogPostUrlFormat))
           
                this.BlogPostUrlFormat = "/[Parent.UrlName]/[UrlName]";
           
       

 

and try to create new custom provider but i dont know how to write "Provider Type" in settings as shown in img given below.

Plz suggest me .

 

 

Posted by Community Admin on 04-May-2016 00:00

Hi, 

In order to change the default generated urls you need to create and implement your own custom provider, as you already referenced.

The following KB article provides information and references the same blog post :

http://www.sitefinity.com/developer-network/knowledge-base/details/how-to-change-default-url-format-for-content-items

I have tried this successfully, please observe following screencast:
http://screencast.com/t/rMqClXi9nsL

You can verify and compare whether you have done similar.

Regarding the 2nd item you mention, it is not possible to use a querystring in the additional urls.

There is a Feature Request logged for this:
http://feedback.telerik.com/Project/153/Feedback/Details/99871-additional-urls-to-pass-down-the-querystring-to-the-redirected-url

Here you can you can track its progress and vote to increase its priority.

 

Regards,
Dimitri Cools
Telerik
 
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
 

Posted by Community Admin on 05-May-2016 00:00

Hi,

 

Thanks for the quick reply.I did changes as shown in video but provider not get registered.dont know why?I attached a screenshot.Please see this. 

Posted by Community Admin on 09-May-2016 00:00

Hi,

The error indicates that the provided ProviderType is not correct.
(SitefinityWebApp.CustomProvider)

- Did you rebuild your project? 
- Is your custom provider class called: CustomProvider? 
- Is it located at the project's root?

Please check the above and adjust accordingly. 

Regards,
Dimitri Cools
Telerik

 
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
 

Posted by Community Admin on 17-May-2016 00:00

Hello sir,

I am working on staging site . i dont have local project .i did check above conditions and still giving same error.Thanks for ur support.

Please help me .

 

Thanks in advance.

 

Posted by Community Admin on 19-May-2016 00:00

Hi,

You will have to rebuild the project for the newly created class to be picked up.
Otherwise, my previously provided screencast and documentation contain all the necessary info.
Should you continue to have problems implementing this I advice you to open a support ticket as it may be required to send us your project data or other detailed info in order to isolate the reason for this issue.

Regards,
Dimitri Cools
Telerik

 
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
 

Posted by Community Admin on 20-May-2016 00:00

Thanks for your valuable support.I tried changing blog url format on my previous sitfinity  local project.And it works. m going to upload on my live project .Hope will work.

Thank you so much.

This thread is closed