Share via


NavigationTermSetItem.CreateTerm method (String, NavigationLinkType, Guid)

Creates a new NavigationTerm object with the specified termName.

Namespace:  Microsoft.SharePoint.Publishing.Navigation
Assembly:  Microsoft.SharePoint.Publishing (in Microsoft.SharePoint.Publishing.dll)

Syntax

'Declaration
Public Function CreateTerm ( _
    termName As String, _
    linkType As NavigationLinkType, _
    termId As Guid _
) As NavigationTerm
'Usage
Dim instance As NavigationTermSetItem
Dim termName As String
Dim linkType As NavigationLinkType
Dim termId As Guid
Dim returnValue As NavigationTerm

returnValue = instance.CreateTerm(termName, _
    linkType, termId)
public NavigationTerm CreateTerm(
    string termName,
    NavigationLinkType linkType,
    Guid termId
)

Parameters

  • termId
    Type: System.Guid

    The initial value for the Id property.

Return value

Type: Microsoft.SharePoint.Publishing.Navigation.NavigationTerm
The newly created object.

Remarks

Similar in concept to the CreateTerm(String, Int32) method, this method creates a new navigation term with the specified name, link type, and taxonomy ID. The new term is a child of the current object.

The provided termName parameter is used to determine the name of the underlying Term object, which is a localized value. The locale ID is determined by the current WorkingLanguage property, which for multilingual sites should be configured before by using the GetNavigationLcidForWeb(SPWeb) method. If the specified name is already in use by a sibling term, a suffix will automatically be appended to avoid this conflict. A suitable FriendlyUrlSegment will also be generated from this name, and in the same way, a suffix will be appended if necessary to avoid a sibling conflict. Where terms created using the CreateTerm() are sorted alphabetically, the CreateTerm() automatically updates the CustomSortOrder property to ensure that this term appears after the other custom-sorted terms.

This method is not supported if the IsReadOnly property equals true.

See also

Reference

NavigationTermSetItem class

NavigationTermSetItem members

CreateTerm overload

Microsoft.SharePoint.Publishing.Navigation namespace

NavigationLinkType()

NavigationTermSetItem.GetAsEditable