Enables scripted content fragments to render standardized UI elements.

Properties

NameTypeDescriptionDefaultOptions
PagedContentPagedEventstringName of client-side message published after a widget's content has been paged via ajax
PagedContentPagingEventstringName of client-side message published upon the initiation of a widget's ajax paging
PagedContentWrapperElementIdstringContainer ID for a widget's Paged Content
PageIndexQueryStringKeystringUnique widget-instance-specific key used to identify requested page indexes in the query string

Methods

CanBeViewed

Determines whether a file can be viewed

Usage

#set($booleanResponse = $core_v2_ui.CanBeViewed($url))

Parameters

NameTypeDescriptionRequiredDefaultOptions
urlstringUrlRequired

Return Type

bool

FormatTextAsHtml

Formats text as HTML

Usage

#set($stringResponse = $core_v2_ui.FormatTextAsHtml($text))

Parameters

NameTypeDescriptionRequiredDefaultOptions
textstringTextRequired

Return Type

string

FormatTextAsHtml

Formats text as HTML

Usage

#set($stringResponse = $core_v2_ui.FormatTextAsHtml($text, "%{ConvertToParagraphs = $convertToParagraphsArg, DetectMediaUrls = $detectMediaUrlsArg}"))

Parameters

NameTypeDescriptionRequiredDefaultOptions
textstringTextRequired
ConvertToParagraphsboolConvert To ParagraphsOptionalTrue
DetectMediaUrlsboolDetect Media UrlsOptionalFalse

Return Type

string

GetCurrentPageIndex

Returns the currently-requested paging index

Usage

#set($int32Response = $core_v2_ui.GetCurrentPageIndex())

Return Type

int

GetCurrentPageIndex

Returns the currently-requested paging index

Usage

#set($int32Response = $core_v2_ui.GetCurrentPageIndex("%{QueryStringProperty = $queryStringPropertyArg}"))

Parameters

NameTypeDescriptionRequiredDefaultOptions
QueryStringPropertystringQuery string page index keyOptionalValue of PageIndexQueryStringKey

Return Type

int

GetFileTypeImageUrl

Gets a file type image URL for a URL or filename

Usage

#set($stringResponse = $core_v2_ui.GetFileTypeImageUrl($url))

Parameters

NameTypeDescriptionRequiredDefaultOptions
urlstringUrlRequired

Return Type

string

GetFileTypeImageUrl

Gets a file type image URL for a URL or filename

Usage

#set($stringResponse = $core_v2_ui.GetFileTypeImageUrl($url, "%{Height = $heightArg, OutputIsPersisted = $outputIsPersistedArg, Width = $widthArg}"))

Parameters

NameTypeDescriptionRequiredDefaultOptions
urlstringUrlRequired
HeightintHeightOptional
OutputIsPersistedboolWhen the output is not persisted, direct links to CFS file URLs can be rendered. Otherwise, the generic CFS URL is rendered which results in a redirect.OptionalFalse
WidthintWidthOptional

Return Type

string

GetLastPageIndex

Gets the last page index

Usage

#set($int32Response = $core_v2_ui.GetLastPageIndex($pageSize, $totalItems))

Parameters

NameTypeDescriptionRequiredDefaultOptions
pageSizeintPage SizeRequired
totalItemsintTotal ItemsRequired

Return Type

int

GetMediaType

Gets media type of a file

Usage

#set($stringResponse = $core_v2_ui.GetMediaType($url))

Parameters

NameTypeDescriptionRequiredDefaultOptions
urlstringUrlRequired

Return Type

string

GetMediaType

Gets media type of a file

Usage

#set($stringResponse = $core_v2_ui.GetMediaType($url, "%{OutputIsPersisted = $outputIsPersistedArg, ViewType = $viewTypeArg}"))

Parameters

NameTypeDescriptionRequiredDefaultOptions
urlstringUrlRequired
OutputIsPersistedboolWhen the output is not persisted, direct links to CFS file URLs can be rendered. Otherwise, the generic CFS URL is rendered which results in a redirect.OptionalFalse
ViewTypestringView TypeOptionalViewPreview, View

Return Type

string

GetMimeType

Returns the Mime Type of a file

Usage

#set($stringResponse = $core_v2_ui.GetMimeType($url))

Parameters

NameTypeDescriptionRequiredDefaultOptions
urlstringUrlRequired

Return Type

string

GetPreviewHtml

Renders preview HtML for a file

Usage

#set($stringResponse = $core_v2_ui.GetPreviewHtml($url))

Parameters

NameTypeDescriptionRequiredDefaultOptions
urlstringUrlRequired

Return Type

string

GetPreviewHtml

Renders preview HtML for a file

Usage

#set($stringResponse = $core_v2_ui.GetPreviewHtml($url, "%{Height = $heightArg, OutputIsPersisted = $outputIsPersistedArg, Width = $widthArg}"))

Parameters

NameTypeDescriptionRequiredDefaultOptions
urlstringUrlRequired
HeightintHeightOptional
OutputIsPersistedboolWhen the output is not persisted, direct links to CFS file URLs can be rendered. Otherwise, the generic CFS URL is rendered which results in a redirect.OptionalFalse
WidthintWidthOptional

Return Type

string

GetResizedImageHtml

Renders an image as HTML configured to be resized to the given maximum width and height. Unrecognized name/value pairs passed into the dictionary parameter are rendered on the ouput IMG tag.

Usage

#set($stringResponse = $core_v2_ui.GetResizedImageHtml($url, $maxWidth, $maxHeight, "%{OutputIsPersisted = $outputIsPersistedArg, ResizeMethod = $resizeMethodArg}"))

Parameters

NameTypeDescriptionRequiredDefaultOptions
urlstringUrlRequired
maxWidthintMax WidthRequired
maxHeightintMax HeightRequired
OutputIsPersistedboolWhen the output is not persisted, direct links to CFS file URLs can be rendered. Otherwise, the generic CFS URL is rendered which results in a redirect.OptionalFalse
ResizeMethodstringResize MethodOptionalScaleDown, ZoomAndCrop

Return Type

string

GetViewHtml

Renders View HTML for a file

Usage

#set($stringResponse = $core_v2_ui.GetViewHtml($url))

Parameters

NameTypeDescriptionRequiredDefaultOptions
urlstringUrlRequired

Return Type

string

GetViewHtml

Renders View HTML for a file

Usage

#set($stringResponse = $core_v2_ui.GetViewHtml($url, "%{Height = $heightArg, OutputIsPersisted = $outputIsPersistedArg, Width = $widthArg}"))

Parameters

NameTypeDescriptionRequiredDefaultOptions
urlstringUrlRequired
HeightintHeightOptional
OutputIsPersistedboolWhen the output is not persisted, direct links to CFS file URLs can be rendered. Otherwise, the generic CFS URL is rendered which results in a redirect.OptionalFalse
WidthintWidthOptional

Return Type

string

Like

Renders a 'Like' count for a given content item

Usage

#set($stringResponse = $core_v2_ui.Like($contentId, $contentTypeId))

Parameters

NameTypeDescriptionRequiredDefaultOptions
contentIdGuidContent IdRequired
contentTypeIdGuidContent Type IdRequired

Return Type

string

Like

Renders a 'Like' count, toggle, and/or message for a given content item. Additional un-specified optional parameters are combined into a single query-string encoded data attribute on the resulting placeholder span.

Usage

#set($stringResponse = $core_v2_ui.Like($contentId, $contentTypeId, "%{CssClass = $cssClassArg, Format = $formatArg, LikeTypeId = $likeTypeIdArg, ReadOnly = $readOnlyArg}"))

Parameters

NameTypeDescriptionRequiredDefaultOptions
contentIdGuidContent IdRequired
contentTypeIdGuidContent Type IdRequired
CssClassstringAdditional CSS Class(es) to apply to the placeholderOptional
FormatstringTemplated string containing tokens identifying if, and where, the Like control should contain a count, toggle link, and 'who likes' messageOptional{count}{count}, {message}, {toggle}
LikeTypeIdGuidLike Type IdOptional
ReadOnlyboolRender the like UI as read-onlyOptional

Return Type

string

MakeCssClassName

Converts a pascal or camel-cased string to hyphen-cased

Usage

#set($stringResponse = $core_v2_ui.MakeCssClassName($text))

Parameters

NameTypeDescriptionRequiredDefaultOptions
textstringTextRequired

Return Type

string

Merge

Produces a diff text

Usage

#set($stringResponse = $core_v2_ui.Merge($original, $modified))

Parameters

NameTypeDescriptionRequiredDefaultOptions
originalstringOriginalRequired
modifiedstringModifiedRequired

Return Type

string

Moderate

Render's a 'Moderation' control

Usage

#set($stringResponse = $core_v2_ui.Moderate($contentId, $contentTypeId))

Parameters

NameTypeDescriptionRequiredDefaultOptions
contentIdGuidContent IdRequired
contentTypeIdGuidContent Type IdRequired

Return Type

string

Moderate

Render's a 'Moderation' control

Usage

#set($stringResponse = $core_v2_ui.Moderate($contentId, $contentTypeId, "%{AdditionalLinks = $additionalLinksArg, AdditionalLinksUrl = $additionalLinksUrlArg, CssClass = $cssClassArg}"))

Parameters

NameTypeDescriptionRequiredDefaultOptions
contentIdGuidContent IdRequired
contentTypeIdGuidContent Type IdRequired
AdditionalLinksstringPredefined additional Links to render before the moderation link in JSON format: [ { href: '', text: '', className: ''} ] (either AdditionalLinks or AdditionalLinksUrl may be used)Optional
AdditionalLinksUrlstringJSON endpoint URL which returns additional Links to render before the moderation link in JSON format: [ { href: '', text: '', className: ''} ] (either AdditionalLinks or AdditionalLinksUrl may be used)Optional
CssClassstringCss ClassOptional

Return Type

string

PagedContent

Executes a file with support for it to be updated via ajax paging. Required corresponding use of the 'PagedContentFile' parameter in $core_v2_ui.Pager()

Usage

#set($stringResponse = $core_v2_ui.PagedContent($contentFileName, "%{CssClass = $cssClassArg, ElementType = $elementTypeArg}"))

Parameters

NameTypeDescriptionRequiredDefaultOptions
contentFileNamestringName of attached widget script file to execute which generates a page of contentRequired
CssClassstringCSS Class(es) to apply to the paged content's wrapper elementOptional
ElementTypestringType of DOM element to use for the paged content's wrapperOptionaldiv

Return Type

string

PagedContent

Executes a file with support for it to be updated via ajax paging. Required corresponding use of the 'PagedContentFile' parameter in $core_v2_ui.Pager()

Usage

#set($stringResponse = $core_v2_ui.PagedContent($contentFileName))

Parameters

NameTypeDescriptionRequiredDefaultOptions
contentFileNamestringName of attached widget script file to execute which generates a page of contentRequired

Return Type

string

Pager

Renders a 'Pager' control

Usage

#set($stringResponse = $core_v2_ui.Pager($currentPage, $pageSize, $totalItems))

Parameters

NameTypeDescriptionRequiredDefaultOptions
currentPageintCurrent PageRequired
pageSizeintPage SizeRequired
totalItemsintTotal ItemsRequired

Return Type

string

Pager

Renders a 'Pager' control

Usage

#set($stringResponse = $core_v2_ui.Pager($currentPage, $pageSize, $totalItems, "%{BaseUrl = $baseUrlArg, CssClass = $cssClassArg, NumberOfPagesToDisplay = $numberOfPagesToDisplayArg, PagedContentFile = $pagedContentFileArg, PagedContentUrl = $pagedContentUrlArg, QueryStringProperty = $queryStringPropertyArg, ShowFirst = $showFirstArg, ShowIndividualPages = $showIndividualPagesArg, ShowLast = $showLastArg, ShowNext = $showNextArg, ShowPrevious = $showPreviousArg, Target = $targetArg, Template = $templateArg, Transition = $transitionArg, TransitionDuration = $transitionDurationArg}"))

Parameters

NameTypeDescriptionRequiredDefaultOptions
currentPageintCurrent PageRequired
pageSizeintPage SizeRequired
totalItemsintTotal ItemsRequired
BaseUrlstringURL to apply pagingOptionalCurrent Page
CssClassstringAdditional CSS Class(es) to apply to the placeholderOptional
NumberOfPagesToDisplayintNumber of pages to display when showing individual pagesOptional5
PagedContentFilestringWhen provided enables Ajax paging against the content file. Requires corresponding use of $core_v2_ui.PagedContent(). Either this or PagedContentUrl can be used.Optional
PagedContentUrlstringWhen provided enables Ajax paging against the content file. Either this or PagedContentFile with $core_v2_ui.PagedContent() can be used.Optional
QueryStringPropertystringName of the key to use for this widget's page index. Typically unnecessary to overrideOptionalAuto-generated
ShowFirstboolWhen true, shows a link to the first pageOptionalTrue
ShowIndividualPagesboolWhen true, shows individual links to pagesOptionalTrue
ShowLastboolWhen true, shows a link to the last pageOptionalTrue
ShowNextboolWhen true, shows a link to the next pageOptionalFalse
ShowPreviousboolWhen true, shows a link to the previous pageOptionalFalse
TargetstringExplicit hash target for page linksOptional
TemplatestringTemplate source code or id of template to use when rendering pager linksOptionalPlatform-defined. Theme (and widget) overridable
TransitionstringTransition to use when merging ajax-paged resultsOptionalslidefade, none, slide
TransitionDurationintDuration of transition to use when merging ajax-paged resultsOptional200

Return Type

string

Rate

Renders a 'Rating' control

Usage

#set($stringResponse = $core_v2_ui.Rate($contentId, $contentTypeId, "%{CssClass = $cssClassArg, RatingTypeId = $ratingTypeIdArg, ReadOnly = $readOnlyArg}"))

Parameters

NameTypeDescriptionRequiredDefaultOptions
contentIdGuidContent IdRequired
contentTypeIdGuidContent Type IdRequired
CssClassstringAdditional CSS Class(es) to apply to the placeholderOptional
RatingTypeIdGuidRating TypeIdOptional
ReadOnlyboolRender the rating UI as read-onlyOptional

Return Type

string

Rate

Renders a 'Rating' control

Usage

#set($stringResponse = $core_v2_ui.Rate($contentId, $contentTypeId))

Parameters

NameTypeDescriptionRequiredDefaultOptions
contentIdGuidContent IdRequired
contentTypeIdGuidContent Type IdRequired

Return Type

string

Render

Sanitizes untrusted HTML content

Usage

#set($stringResponse = $core_v2_ui.Render($html, $target))

Parameters

NameTypeDescriptionRequiredDefaultOptions
htmlstringHtmlRequired
targetstringTargetRequiredWebEmail, MailGateway, Nntp, Offline, Other, Print, Syndication, Web, WebQuote, WebServices

Return Type

string

Render

Sanitizes untrusted HTML content, formtted for the Web

Usage

#set($stringResponse = $core_v2_ui.Render($html))

Parameters

NameTypeDescriptionRequiredDefaultOptions
htmlstringHtmlRequired

Return Type

string

Tag

Render's a 'Tag' control

Usage

#set($stringResponse = $core_v2_ui.Tag($contentId, $contentTypeId))

Parameters

NameTypeDescriptionRequiredDefaultOptions
contentIdGuidContent IdRequired
contentTypeIdGuidContent Type IdRequired

Return Type

string

Tag

Render's a 'Tag' control

Usage

#set($stringResponse = $core_v2_ui.Tag($contentId, $contentTypeId, "%{CssClass = $cssClassArg, ReadOnly = $readOnlyArg, TagTypeId = $tagTypeIdArg, UrlFormat = $urlFormatArg}"))

Parameters

NameTypeDescriptionRequiredDefaultOptions
contentIdGuidContent IdRequired
contentTypeIdGuidContent Type IdRequired
CssClassstringAdditional CSS Class(es) to apply to the placeholderOptional
ReadOnlyboolRender the tag UI as read-onlyOptional
TagTypeIdGuidTag TypeIdOptional
UrlFormatstringURL used to link tags. {tag} will be replaced with the current tagOptional

Return Type

string