Click or drag to resize
URLShortenerHelperShortenURLsInText Method
Shortens URLs in given text using selected URL shortener. Throws an exception if shortener is not available for the given site.

Namespace: CMS.SocialMarketing
Assembly: CMS.SocialMarketing (in CMS.SocialMarketing.dll) Version: 11.0.0
Syntax
C#
public static string ShortenURLsInText(
	string text,
	URLShortenerTypeEnum shortener,
	SiteInfoIdentifier siteIdentifier
)

Parameters

text
Type: SystemString
Text in that all URLs will be shortened.
shortener
Type: CMS.SocialMarketingURLShortenerTypeEnum
Shortener that will be used for shortening.
siteIdentifier
Type: CMS.DataEngineSiteInfoIdentifier
Determines which site's URL shortener settings are used. Provide null to use global settings.

Return Value

Type: String
Text with shortened URLs.
Exceptions
ExceptionCondition
ExceptionShortener is not available for the given site.
See Also