Enables scripted content fragments to render standardized UI elements.
Methods
CanBeViewed
Determines whether a file can be viewed
Usage
#set($booleanResponse = $core_v2_ui.CanBeViewed($url))
Parameters
| Name | Type | Description | Required | Default | Options |
|---|
| url | string | Url | Required | | |
Return Type
bool
FormatTextAsHtml
Formats text as HTML
Usage
#set($stringResponse = $core_v2_ui.FormatTextAsHtml($text))
Parameters
| Name | Type | Description | Required | Default | Options |
|---|
| text | string | Text | Required | | |
Return Type
string
FormatTextAsHtml
Formats text as HTML
Usage
#set($stringResponse = $core_v2_ui.FormatTextAsHtml($text, "%{ConvertToParagraphs = $convertToParagraphsArg, DetectMediaUrls = $detectMediaUrlsArg}"))Parameters
| Name | Type | Description | Required | Default | Options |
|---|
| text | string | Text | Required | | |
| ConvertToParagraphs | bool | Convert To Paragraphs | Optional | True | |
| DetectMediaUrls | bool | Detect Media Urls | Optional | False | |
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
| Name | Type | Description | Required | Default | Options |
|---|
| QueryStringProperty | string | Query string page index key | Optional | Value 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
| Name | Type | Description | Required | Default | Options |
|---|
| url | string | Url | Required | | |
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
| Name | Type | Description | Required | Default | Options |
|---|
| url | string | Url | Required | | |
| Height | int | Height | Optional | | |
| OutputIsPersisted | bool | When 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. | Optional | False | |
| Width | int | Width | Optional | | |
Return Type
string
GetLastPageIndex
Gets the last page index
Usage
#set($int32Response = $core_v2_ui.GetLastPageIndex($pageSize, $totalItems))
Parameters
| Name | Type | Description | Required | Default | Options |
|---|
| pageSize | int | Page Size | Required | | |
| totalItems | int | Total Items | Required | | |
Return Type
int
GetMediaType
Gets media type of a file
Usage
#set($stringResponse = $core_v2_ui.GetMediaType($url))
Parameters
| Name | Type | Description | Required | Default | Options |
|---|
| url | string | Url | Required | | |
Return Type
string
GetMediaType
Gets media type of a file
Usage
#set($stringResponse = $core_v2_ui.GetMediaType($url, "%{OutputIsPersisted = $outputIsPersistedArg, ViewType = $viewTypeArg}"))Parameters
| Name | Type | Description | Required | Default | Options |
|---|
| url | string | Url | Required | | |
| OutputIsPersisted | bool | When 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. | Optional | False | |
| ViewType | string | View Type | Optional | View | Preview, View |
Return Type
string
GetMimeType
Returns the Mime Type of a file
Usage
#set($stringResponse = $core_v2_ui.GetMimeType($url))
Parameters
| Name | Type | Description | Required | Default | Options |
|---|
| url | string | Url | Required | | |
Return Type
string
GetPreviewHtml
Renders preview HtML for a file
Usage
#set($stringResponse = $core_v2_ui.GetPreviewHtml($url))
Parameters
| Name | Type | Description | Required | Default | Options |
|---|
| url | string | Url | Required | | |
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
| Name | Type | Description | Required | Default | Options |
|---|
| url | string | Url | Required | | |
| Height | int | Height | Optional | | |
| OutputIsPersisted | bool | When 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. | Optional | False | |
| Width | int | Width | Optional | | |
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
| Name | Type | Description | Required | Default | Options |
|---|
| url | string | Url | Required | | |
| maxWidth | int | Max Width | Required | | |
| maxHeight | int | Max Height | Required | | |
| OutputIsPersisted | bool | When 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. | Optional | False | |
| ResizeMethod | string | Resize Method | Optional | | ScaleDown, ZoomAndCrop |
Return Type
string
GetViewHtml
Renders View HTML for a file
Usage
#set($stringResponse = $core_v2_ui.GetViewHtml($url))
Parameters
| Name | Type | Description | Required | Default | Options |
|---|
| url | string | Url | Required | | |
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
| Name | Type | Description | Required | Default | Options |
|---|
| url | string | Url | Required | | |
| Height | int | Height | Optional | | |
| OutputIsPersisted | bool | When 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. | Optional | False | |
| Width | int | Width | Optional | | |
Return Type
string
Like
Renders a 'Like' count for a given content item
Usage
#set($stringResponse = $core_v2_ui.Like($contentId, $contentTypeId))
Parameters
| Name | Type | Description | Required | Default | Options |
|---|
| contentId | Guid | Content Id | Required | | |
| contentTypeId | Guid | Content Type Id | Required | | |
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
| Name | Type | Description | Required | Default | Options |
|---|
| contentId | Guid | Content Id | Required | | |
| contentTypeId | Guid | Content Type Id | Required | | |
| CssClass | string | Additional CSS Class(es) to apply to the placeholder | Optional | | |
| Format | string | Templated string containing tokens identifying if, and where, the Like control should contain a count, toggle link, and 'who likes' message | Optional | {count} | {count}, {message}, {toggle} |
| LikeTypeId | Guid | Like Type Id | Optional | | |
| ReadOnly | bool | Render the like UI as read-only | Optional | | |
Return Type
string
MakeCssClassName
Converts a pascal or camel-cased string to hyphen-cased
Usage
#set($stringResponse = $core_v2_ui.MakeCssClassName($text))
Parameters
| Name | Type | Description | Required | Default | Options |
|---|
| text | string | Text | Required | | |
Return Type
string
Merge
Produces a diff text
Usage
#set($stringResponse = $core_v2_ui.Merge($original, $modified))
Parameters
| Name | Type | Description | Required | Default | Options |
|---|
| original | string | Original | Required | | |
| modified | string | Modified | Required | | |
Return Type
string
Moderate
Render's a 'Moderation' control
Usage
#set($stringResponse = $core_v2_ui.Moderate($contentId, $contentTypeId))
Parameters
| Name | Type | Description | Required | Default | Options |
|---|
| contentId | Guid | Content Id | Required | | |
| contentTypeId | Guid | Content Type Id | Required | | |
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
| Name | Type | Description | Required | Default | Options |
|---|
| contentId | Guid | Content Id | Required | | |
| contentTypeId | Guid | Content Type Id | Required | | |
| AdditionalLinks | string | Predefined additional Links to render before the moderation link in JSON format: [ { href: '', text: '', className: ''} ] (either AdditionalLinks or AdditionalLinksUrl may be used) | Optional | | |
| AdditionalLinksUrl | string | JSON 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 | | |
| CssClass | string | Css Class | Optional | | |
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
| Name | Type | Description | Required | Default | Options |
|---|
| contentFileName | string | Name of attached widget script file to execute which generates a page of content | Required | | |
| CssClass | string | CSS Class(es) to apply to the paged content's wrapper element | Optional | | |
| ElementType | string | Type of DOM element to use for the paged content's wrapper | Optional | div | |
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
| Name | Type | Description | Required | Default | Options |
|---|
| contentFileName | string | Name of attached widget script file to execute which generates a page of content | Required | | |
Return Type
string
Pager
Renders a 'Pager' control
Usage
#set($stringResponse = $core_v2_ui.Pager($currentPage, $pageSize, $totalItems))
Parameters
| Name | Type | Description | Required | Default | Options |
|---|
| currentPage | int | Current Page | Required | | |
| pageSize | int | Page Size | Required | | |
| totalItems | int | Total Items | Required | | |
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
| Name | Type | Description | Required | Default | Options |
|---|
| currentPage | int | Current Page | Required | | |
| pageSize | int | Page Size | Required | | |
| totalItems | int | Total Items | Required | | |
| BaseUrl | string | URL to apply paging | Optional | Current Page | |
| CssClass | string | Additional CSS Class(es) to apply to the placeholder | Optional | | |
| NumberOfPagesToDisplay | int | Number of pages to display when showing individual pages | Optional | 5 | |
| PagedContentFile | string | When provided enables Ajax paging against the content file. Requires corresponding use of $core_v2_ui.PagedContent(). Either this or PagedContentUrl can be used. | Optional | | |
| PagedContentUrl | string | When provided enables Ajax paging against the content file. Either this or PagedContentFile with $core_v2_ui.PagedContent() can be used. | Optional | | |
| QueryStringProperty | string | Name of the key to use for this widget's page index. Typically unnecessary to override | Optional | Auto-generated | |
| ShowFirst | bool | When true, shows a link to the first page | Optional | True | |
| ShowIndividualPages | bool | When true, shows individual links to pages | Optional | True | |
| ShowLast | bool | When true, shows a link to the last page | Optional | True | |
| ShowNext | bool | When true, shows a link to the next page | Optional | False | |
| ShowPrevious | bool | When true, shows a link to the previous page | Optional | False | |
| Target | string | Explicit hash target for page links | Optional | | |
| Template | string | Template source code or id of template to use when rendering pager links | Optional | Platform-defined. Theme (and widget) overridable | |
| Transition | string | Transition to use when merging ajax-paged results | Optional | slide | fade, none, slide |
| TransitionDuration | int | Duration of transition to use when merging ajax-paged results | Optional | 200 | |
Return Type
string
Rate
Renders a 'Rating' control
Usage
#set($stringResponse = $core_v2_ui.Rate($contentId, $contentTypeId, "%{CssClass = $cssClassArg, RatingTypeId = $ratingTypeIdArg, ReadOnly = $readOnlyArg}"))Parameters
| Name | Type | Description | Required | Default | Options |
|---|
| contentId | Guid | Content Id | Required | | |
| contentTypeId | Guid | Content Type Id | Required | | |
| CssClass | string | Additional CSS Class(es) to apply to the placeholder | Optional | | |
| RatingTypeId | Guid | Rating TypeId | Optional | | |
| ReadOnly | bool | Render the rating UI as read-only | Optional | | |
Return Type
string
Rate
Renders a 'Rating' control
Usage
#set($stringResponse = $core_v2_ui.Rate($contentId, $contentTypeId))
Parameters
| Name | Type | Description | Required | Default | Options |
|---|
| contentId | Guid | Content Id | Required | | |
| contentTypeId | Guid | Content Type Id | Required | | |
Return Type
string
Render
Sanitizes untrusted HTML content
Usage
#set($stringResponse = $core_v2_ui.Render($html, $target))
Parameters
| Name | Type | Description | Required | Default | Options |
|---|
| html | string | Html | Required | | |
| target | string | Target | Required | Web | Email, 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
| Name | Type | Description | Required | Default | Options |
|---|
| html | string | Html | Required | | |
Return Type
string
Tag
Render's a 'Tag' control
Usage
#set($stringResponse = $core_v2_ui.Tag($contentId, $contentTypeId))
Parameters
| Name | Type | Description | Required | Default | Options |
|---|
| contentId | Guid | Content Id | Required | | |
| contentTypeId | Guid | Content Type Id | Required | | |
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
| Name | Type | Description | Required | Default | Options |
|---|
| contentId | Guid | Content Id | Required | | |
| contentTypeId | Guid | Content Type Id | Required | | |
| CssClass | string | Additional CSS Class(es) to apply to the placeholder | Optional | | |
| ReadOnly | bool | Render the tag UI as read-only | Optional | | |
| TagTypeId | Guid | Tag TypeId | Optional | | |
| UrlFormat | string | URL used to link tags. {tag} will be replaced with the current tag | Optional | | |
Return Type
string