NavigationTermSetItem.CatalogTargetUrlForChildTerms - Propriété
Obtient la valeur par défaut de la propriété CatalogTargetUrl pour les objets enfant NavigationTerm .
Espace de noms : Microsoft.SharePoint.Publishing.Navigation
Assembly : Microsoft.SharePoint.Publishing (dans Microsoft.SharePoint.Publishing.dll)
Syntaxe
'Déclaration
Public ReadOnly Property CatalogTargetUrlForChildTerms As CustomizableString
Get
'Utilisation
Dim instance As NavigationTermSetItem
Dim value As CustomizableString
value = instance.CatalogTargetUrlForChildTerms
public CustomizableString CatalogTargetUrlForChildTerms { get; }
Valeur de propriété
Type : Microsoft.SharePoint.Publishing.CustomizableString
La valeur par défaut de la propriété CatalogTargetUrl
Remarques
Cette propriété est un objet CustomizableString . La valeur par défaut est héritée de la propriété CatalogTargetUrlForChildTerms.Value de l'objet NavigationTerm de parent, ou de la NavigationTermSet s'il n'existe aucun terme parent. Pour l'objet NavigationTermSet , la valeur par défaut est une chaîne vide.
La propriété n'affecte pas l'URL cible de catalogue pour l'objet en cours. Si ne pas personnalisé, la valeur par défaut est héritée à la place d'un nœud parent. Pour désactiver la valeur par défaut de CatalogTargetUrl pour les nœuds enfants, affectez une chaîne vide à la GetCustomizableStringCustomValue.
La propriété CatalogTargetUrl n'est significative que lorsque la propriété LinkType est FriendlyUrl.
Exemples
Pensez à un site Web avec un objet de jeu de terme de navigation doit contenir cette hiérarchie des termes.
- 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.