Change the url of product detail

Posted by Community Admin on 05-Aug-2018 14:41

Change the url of product detail

All Replies

Posted by Community Admin on 26-Aug-2011 00:00

I came across this post:
http://www.sitefinity.com/devnet/forums/sitefinity-4-x/general-discussions/how-to-use-a-custom-url-in-the-products-module---solution.aspx

How can I change the format of the URL's for products inside the ECommerce module?

Regards,
Daniel

Posted by Community Admin on 31-Aug-2011 00:00

Hi Daniel,

Thank you for contacting support.
You can change the Url of product detail in two ways -
1)If you want to remove the published date from the url of the product you can go to Administration->Settings->Advanced->Catalog->Providers->OpenAccessProvider->Parameters and add a new parameter the key of the new parameter will be "urlFormat" and the value will be "/[UrlName]".
Please note that already existing products will not get the route by default. You will have to publish the exisisting products again.

2)You can add a class to your project and make the class inherit from "OpenAccessCatalogDataProvider". You can override the below methods to get custom routing.
Please note that you will need to change ProviderType of catalog (can be changed at Administration->Settings->Advanced->Catalog->Providers->OpenAccessProvider) to have your custom class name.

public override string GetUrlFormat(Telerik.Sitefinity.GenericContent.Model.ILocatable item)
        
            return "/[CustomRouteKey]/[UrlName]";
        
 
        protected override string GetUrlPart<T>(string key, string format, T item)
        
            if (key == "CustomRouteKey")
            
                //Use any mechanism to get the route key
            
            return base.GetUrlPart<T>(key, format, item);
        


Greetings,
Venkata Koppaka
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Posted by Community Admin on 10-Dec-2012 00:00

Venkata, when trying to follow example 2 (1 didn't work at all...) I receive the following:

The type 'T' cannot be used as type parameter 'T' in the generic type or method 'Telerik.Sitefinity.Modules.GenericContent.UrlDataProviderBase.GetUrlPart<T>(string, string, T)'. There is no boxing conversion or type parameter conversion from 'T' to 'Telerik.Sitefinity.GenericContent.Model.ILocatable'

Posted by Community Admin on 13-Dec-2012 00:00

Hi Denny,

 I have answered your support ticket on this issue. If you have any questions please contact us there!

Thanks in advance!

All the best,
Patrick Dunn
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items

This thread is closed