+1-888-365-2779
Try Now
More in this section

Forums / Bugs & Issues / How to change blog post default url format in sitefinity?

How to change blog post default url format in sitefinity?

8 posts, 0 answered
  1. rupali
    rupali avatar
    14 posts
    Registered:
    08 Mar 2016
    03 May
    Link to this post

    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 :

    http://www.sitefinity.com/blogs/slavo-ingilizovs-blog/2011/10/19/custom_url_formats_for_sitefinity_content_modules


    http://www.sitefinity.com/developer-network/forums/developing-with-sitefinity-/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.

  2. rupali
    rupali avatar
    14 posts
    Registered:
    08 Mar 2016
    04 May
    Link to this post

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

    http://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 .

     

     

  3. Dimitri Cools
    Dimitri Cools avatar
    80 posts
    Registered:
    08 Dec 2016
    04 May
    Link to this post
    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
     
  4. rupali
    rupali avatar
    14 posts
    Registered:
    08 Mar 2016
    05 May
    Link to this post

    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. 

  5. Dimitri Cools
    Dimitri Cools avatar
    80 posts
    Registered:
    08 Dec 2016
    09 May
    Link to this post
    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
     
  6. rupali
    rupali avatar
    14 posts
    Registered:
    08 Mar 2016
    17 May in reply to Dimitri Cools
    Link to this post

    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.

     

  7. Dimitri Cools
    Dimitri Cools avatar
    80 posts
    Registered:
    08 Dec 2016
    19 May
    Link to this post
    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
     
  8. rupali
    rupali avatar
    14 posts
    Registered:
    08 Mar 2016
    20 May
    Link to this post

    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.

8 posts, 0 answered