Use the following procedure to configure the URL format for modules that have more than one content type. For example, Blogs module that has Bogs and Blog posts content types.
Because the Blogs and the Blog posts have different URL format – the URL of the posts includes the URL of the blog, you cannot use the above procedure and change only the parameter of the data provider. To change the format of modules with multiple content types, you must create a custom provider and override some of the methods.
The following procedure removes the name of the blog from the URL of the blog post. After completing the procedure, you can further change the URL format using the advanced settings in the backend. For more information, see Manage the URL format through the advanced settings below.
Perform the following:
Use the following code sample:
To use the newly created data provider, you must register it. You can do this either by replacing the default provider, or by registering it as a new provider:
NOTE: If you have Sitefinity CMS Multisite you may have more than one provider. In this case, you can choose for which provider to apply the desired behavior, or you can apply it to all by replacing them with the custom one.
Once you register the new provider, all newly created posts have the new URL format - without the name of the blog. To change the URL for previously created posts, you need to republish all posts. You can do this manually or by using the following code sample:
Once you have created and registered your provider, you can manage its parameters through the Advanced settings.
Increase your Sitefinity skills by signing up for our free trainings. Get Sitefinity-certified at Progress Education Community to boost your credentials.
This free lesson teaches administrators, marketers, and other business professionals how to use the Integration hub service to create automated workflows between Sitefinity and other business systems.
This free lesson teaches administrators the basics about protecting yor Sitefinity instance and its sites from external threats. Configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.
The free on-demand video course teaches developers how to use Sitefinity .NET Core and leverage its decoupled architecture and new way of coding against the platform.
To submit feedback, please update your cookie settings and allow the usage of Functional cookies.
Your feedback about this content is important