The content you're reading is getting on in years
This post is on the older side and its content may be out of date.
Be sure to visit our blogs homepage for our latest news, updates and information.
The following blog post is based on Slavo Ingilizov's blog post connected to custom URL formats for Sitefinity Content Modules. All hierarchical dynamic items in the Sitefinity CMS have URLs that are generated automatically from a given format. The default format includes the parent module item's name in the URL generated by hierarchical dynamic modules and item's title. The URL format of the hierarchical dynamic modules is configurable and this article explains how you can modify it.
The default structure of the hierarchical module items when one of them is opened in a browser is the following:
<---Page URL---><--Parent module item's URL--><--Item's URL name-->
Because there are two dynamic types in this case (Parent module and Child module), we can’t know if it specifies the URL of the parent module or the URL of the child module item. There is still a way to change the format in this case, but it involves some programming.public
class
CustomProvider : Telerik.Sitefinity.DynamicModules.Data.OpenAccessDynamicModuleProvider
{
int
temp = 0;
public
override
string
GetUrlFormat(Telerik.Sitefinity.GenericContent.Model.ILocatable item)
{
var resolvedItem = (DynamicContent)item;
Type typeChild = TypeResolutionService.ResolveType(
"Telerik.Sitefinity.DynamicTypes.Model.TestModule1.Testmodule2"
);
Type typeParent = TypeResolutionService.ResolveType(
"Telerik.Sitefinity.DynamicTypes.Model.TestModule1.Testmodule1"
);
var type = resolvedItem.GetType();
if
(typeChild == type)
{
temp = 1;
return
"/[UrlName]"
;
}
if
( temp > 0 )
{
if
(typeParent == type)
{
resolvedItem.SystemUrl =
""
;
return
""
;
}
}
return
"/[UrlName]"
;
}
}
To use your new provider, you need to register it in Sitefinity. To do this, follow these steps below:
View all posts from The Progress Team on the Progress blog. Connect with us about all things application development and deployment, data integration and digital business.
Let our experts teach you how to use Sitefinity's best-in-class features to deliver compelling digital experiences.
Learn MoreSubscribe to get all the news, info and tutorials you need to build better business apps and sites
Progress collects the Personal Information set out in our Privacy Policy and the Supplemental Privacy notice for residents of California and other US States and uses it for the purposes stated in that policy.
You can also ask us not to share your Personal Information to third parties here: Do Not Sell or Share My Info
We see that you have already chosen to receive marketing materials from us. If you wish to change this at any time you may do so by clicking here.
Thank you for your continued interest in Progress. Based on either your previous activity on our websites or our ongoing relationship, we will keep you updated on our products, solutions, services, company news and events. If you decide that you want to be removed from our mailing lists at any time, you can change your contact preferences by clicking here.