The URL of a hierarchical item is automatically generated and, by default, includes the URL of all of its parent items. For more information, see Administration: URLs of dynamic content items. Below are two examples you can use to change the URL format of dynamic content items.
When you use Sitefinity CMS Module Builder to create a dynamic module, by default, the URL of the dynamic items is constructed in the following way: <your site>/<page where item is displayed>/<item’s URL>. By default, the item URL is its title. This can result in duplicated URLs for items with the same title.
To avoid creating items with duplicate URLs, you can build your item’s URL based on a field or combination of fields that are unique for every item.
To do this, perform the following:
In the above example, the URL of the items is based on the value of fields in the module, which are named Address, JobTitle, and UrlName. The Address and JobTitle are fields that you must create in the module, the UrlName is a built-in field.
NOTE: All fields, used for the URL format must be text fields.
When you open the module and add new items, there are two providers available - Default and the new provider you added. If you have multiple sites, you must add the provider to the modules where you want to use it. For more information, see Share module content.
New items added to this new provider use the new URL format - /[Address]/[JobTitle]/[UrlName]
The new provider is displayed in all modules you create with the Module Builder, together with the Default provider. If you want to display only the new provider and hide the default one, preform the following procedure Filter by data provider the items displayed on backend pages.
The following procedure explains how to remove the parent item URL from the URL of a child item. To do this, you must create a custom provider and override some of the methods.
In the above code, you can return a different value, for example, the value from a custom field that you have created for your custom provider.
To remove the parent item of any type, perform the same procedure as above but use the following code snippet:
Back To Top