NavigationTermSetItem.CatalogTargetUrlForChildTerms property
Gets the default value of the CatalogTargetUrl property for child NavigationTerm objects.
Namespace: Microsoft.SharePoint.Publishing.Navigation
Assembly: Microsoft.SharePoint.Publishing (in Microsoft.SharePoint.Publishing.dll)
Syntax
'Declaration
Public ReadOnly Property CatalogTargetUrlForChildTerms As CustomizableString
Get
'Usage
Dim instance As NavigationTermSetItem
Dim value As CustomizableString
value = instance.CatalogTargetUrlForChildTerms
public CustomizableString CatalogTargetUrlForChildTerms { get; }
Property value
Type: Microsoft.SharePoint.Publishing.CustomizableString
The default value of the CatalogTargetUrl property
Remarks
This property is a CustomizableString object. The default value is inherited from the CatalogTargetUrlForChildTerms.Value property of the parent NavigationTerm object, or the NavigationTermSet if there is no parent term. For the NavigationTermSet object, the default value is an empty string.
The property does not affect the catalog target URL for the current object. If not customized, the default is inherited from a parent node instead. To disable the CatalogTargetUrl default for child nodes, assign an empty string to the GetCustomizableStringCustomValue.
The CatalogTargetUrl property is only meaningful when the LinkType property is FriendlyUrl.
Examples
Consider a website with a navigation term set object that should contain this hierarchy of terms.
- About Us
- Products
- Cars
- Trucks
- Motorcyles
- ContactThe following code will configure the child terms /products/cars, /products/trucks, and /products/motorcycles to share a common target URL (Rollup.aspx) and a common catalog target URL (CatalogItem.aspx).void CreateProductsHierarchy(NavigationTermSet termSet)
{
NavigationTerm productsTerm = termSet.CreateTerm("Products", NavigationLinkType.FriendlyUrl);
productsTerm.TargetUrl.Value = "~site/Pages/Products.aspx";
productsTerm.TargetUrlForChildTerms.Value = "~site/Pages/Rollup.aspx";
productsTerm.CatalogTargetUrlForChildTerms.Value = "~site/Pages/CatalogItem.aspx";
productsTerm.CreateTerm("Cars", NavigationLinkType.FriendlyUrl);
productsTerm.CreateTerm("Trucks", NavigationLinkType.FriendlyUrl);
productsTerm.CreateTerm("Motorcycles", NavigationLinkType.FriendlyUrl);
termSet.GetTaxonomyTermStore().CommitAll();
}
In this example, note that using the CatalogTargetUrlForChildTerms property avoids the need to assign the same value to the CatalogTargetUrl for each of the child terms. If a new term is created, it will automatically inherit this setting.