Поделиться через


Свойство NavigationTerm.CatalogTargetUrl

Gets the target URL that is used when rewriting URLs for catalog-friendly URLs that are based on this NavigationTerm object.

Пространство имен:  Microsoft.SharePoint.Publishing.Navigation
Сборка:  Microsoft.SharePoint.Publishing (в Microsoft.SharePoint.Publishing.dll)

Синтаксис

'Декларация
Public ReadOnly Property CatalogTargetUrl As CustomizableString
    Get
'Применение
Dim instance As NavigationTerm
Dim value As CustomizableString

value = instance.CatalogTargetUrl
public CustomizableString CatalogTargetUrl { get; }

Значение свойства

Тип: Microsoft.SharePoint.Publishing.CustomizableString
A customized string that represents the target URL that is used when rewriting URLs for catalog-friendly URLs that are based on this NavigationTerm object.

Замечания

Normally, the web server performs URL rewriting to render the friendly URL for a NavigationTerm by using the page that is specified by the TargetUrl property. For example, for the term "Cameras", the URLs might look like this: Friendly URL: http://example.com/products/camerasTarget URL: /store/Pages/TopicTemplate.aspxHowever, if a catalog-friendly URL suffix is appended, then the CatalogTargetUrl property will be used instead. Continuing the example involving the term "Cameras":Catalog Friendly URL: http://example.com/products/cameras/nice-pix-35mm/sku12345URL Suffix: nice-pix-35mm/sku12345 Catalog Target URL: /store/Pages/CatalogItemTemplate.aspx

Typically, catalog-friendly URLs are used for products such as the hypothetical "Nice Pix 35mm camera" in the preceding example, which do not have a corresponding navigation term, but belong to the category represented by that term. However, the interpretation of the catalog-friendly URL suffix is left to the controls on the target page, and other usage scenarios are possible.If the CatalogTargetUrl value is an empty string, then URL rewriting will not be performed for the term and the catalog-friendly URL may produce an HTTP 404 error. The target URL may contain tokens such as ~site/ (representing the server-relative URL for the associated SPWeb object) or ~sitecollection/ (representing the server-relative URL for the associated SPSite object). These tokens are expanded by methods such as GetResolvedTargetUrl(String, []).

This property is only used when the LinkType is NavigationLinkType.FriendlyUrl. For other link types, attempting to change it will cause an InvalidOperationException to be thrown.

This property is a CustomizableString object. The default value is inherited from the CatalogTargetUrlForChildTerms.Value property of the parent NavigationTerm or the NavigationTermSet if there is no parent term.

См. также

Справочные материалы

NavigationTerm класс

Элементы NavigationTerm

Пространство имен Microsoft.SharePoint.Publishing.Navigation