Enables scripted content fragments to get contextual and configuration data related to the current widget / content fragment.

Properties

NameTypeDescriptionDefaultOptions
IsInWidgetPreviewModeboolReturns true when the widget's containing page, header, or footer is being edited
RegionNamestringName of the current widget's region
WrapperElementIdstringDOM Id of the current widget's wrapper element

Methods

ApplyTokens

Process tokens, such as resources, in a string

Usage

#set($stringResponse = $core_v2_widget.ApplyTokens($html))

Parameters

NameTypeDescriptionRequiredDefaultOptions
htmlstringHtmlRequired

Return Type

string

ExecuteFile

Loads, executes, and returns the content of an attached widget script file

Usage

#set($stringResponse = $core_v2_widget.ExecuteFile($fileName))

Parameters

NameTypeDescriptionRequiredDefaultOptions
fileNamestringName of attached widget scriptRequired

Return Type

string

GetBoolValue

Returns the boolean widget configuration value specified by the property name

Usage

#set($booleanResponse = $core_v2_widget.GetBoolValue($propertyName, $defaultValue))

Parameters

NameTypeDescriptionRequiredDefaultOptions
propertyNamestringProperty NameRequired
defaultValueboolDefault ValueRequired

Return Type

bool

GetColorValue

Returns the color widget configuration value specified by the property name

Usage

#set($stringResponse = $core_v2_widget.GetColorValue($propertyName, $defaultValue))

Parameters

NameTypeDescriptionRequiredDefaultOptions
propertyNamestringProperty NameRequired
defaultValuestringDefault ValueRequired

Return Type

string

GetCustomValue

Returns the custom widget configuration value specified by the property name

Usage

#set($stringResponse = $core_v2_widget.GetCustomValue($propertyName, $defaultValue))

Parameters

NameTypeDescriptionRequiredDefaultOptions
propertyNamestringProperty NameRequired
defaultValuestringDefault ValueRequired

Return Type

string

GetDateTimeValue

Returns the DateTime widget configuration value specified by the property name

Usage

#set($dateTimeResponse = $core_v2_widget.GetDateTimeValue($propertyName, $defaultValue))

Parameters

NameTypeDescriptionRequiredDefaultOptions
propertyNamestringProperty NameRequired
defaultValueDateTimeDefault ValueRequired

Return Type

DateTime

GetDoubleValue

Returns the double widget configuration value specified by the property name

Usage

#set($doubleResponse = $core_v2_widget.GetDoubleValue($propertyName, $defaultValue))

Parameters

NameTypeDescriptionRequiredDefaultOptions
propertyNamestringProperty NameRequired
defaultValuedoubleDefault ValueRequired

Return Type

double

GetExecutedFileUrl

Returns an absolute URL for a given widget attachment which, when requested, processes the attachment and reeturns its output

Usage

#set($stringResponse = $core_v2_widget.GetExecutedFileUrl($fileName))

Parameters

NameTypeDescriptionRequiredDefaultOptions
fileNamestringName of attached widget scriptRequired

Return Type

string

GetFileUrl

Returns an absolute URL for a given widget attachment

Usage

#set($stringResponse = $core_v2_widget.GetFileUrl($fileName))

Parameters

NameTypeDescriptionRequiredDefaultOptions
fileNamestringName of widget attachmentRequired

Return Type

string

GetGuidValue

Returns the Guid widget configuration value specified by the property name

Usage

#set($guidResponse = $core_v2_widget.GetGuidValue($propertyName))

Parameters

NameTypeDescriptionRequiredDefaultOptions
propertyNamestringProperty NameRequired

Return Type

Guid

GetHtmlValue

Returns the HTML widget configuration value specified by the property name

Usage

#set($stringResponse = $core_v2_widget.GetHtmlValue($propertyName, $defaultValue))

Parameters

NameTypeDescriptionRequiredDefaultOptions
propertyNamestringProperty NameRequired
defaultValuestringDefault ValueRequired

Return Type

string

GetIntValue

Returns the integer widget configuration value specified by the property name

Usage

#set($int32Response = $core_v2_widget.GetIntValue($propertyName, $defaultValue))

Parameters

NameTypeDescriptionRequiredDefaultOptions
propertyNamestringProperty NameRequired
defaultValueintDefault ValueRequired

Return Type

int

GetStringValue

Returns the string widget configuration value specified by the property name

Usage

#set($stringResponse = $core_v2_widget.GetStringValue($propertyName, $defaultValue))

Parameters

NameTypeDescriptionRequiredDefaultOptions
propertyNamestringProperty NameRequired
defaultValuestringDefault ValueRequired

Return Type

string

GetUnitValue

Returns the Unit widget configuration value specified by the property name

Usage

#set($stringResponse = $core_v2_widget.GetUnitValue($propertyName, $defaultValue))

Parameters

NameTypeDescriptionRequiredDefaultOptions
propertyNamestringProperty NameRequired
defaultValuestringDefault ValueRequired

Return Type

string

GetUrlValue

Returns the URL widget configuration value specified by the property name

Usage

#set($stringResponse = $core_v2_widget.GetUrlValue($propertyName, $defaultValue))

Parameters

NameTypeDescriptionRequiredDefaultOptions
propertyNamestringProperty NameRequired
defaultValuestringDefault ValueRequired

Return Type

string

Hide

Hides the current widget

Usage

$core_v2_widget.Hide()

RenderFile

Loads and returns the content of an attached file without executing it

Usage

#set($stringResponse = $core_v2_widget.RenderFile($fileName))

Parameters

NameTypeDescriptionRequiredDefaultOptions
fileNamestringName of widget attachmentRequired

Return Type

string

SetBoolValue

Sets a boolean widget configuration value

Usage

$core_v2_widget.SetBoolValue($propertyName, $value)

Parameters

NameTypeDescriptionRequiredDefaultOptions
propertyNamestringProperty NameRequired
valueboolValueRequired

SetColorValue

Sets a Color widget configuration value

Usage

$core_v2_widget.SetColorValue($propertyName, $value)

Parameters

NameTypeDescriptionRequiredDefaultOptions
propertyNamestringProperty NameRequired
valuestringValueRequired

SetCustomValue

Sets a custom widget configuration value

Usage

$core_v2_widget.SetCustomValue($propertyName, $value)

Parameters

NameTypeDescriptionRequiredDefaultOptions
propertyNamestringProperty NameRequired
valuestringValueRequired

SetDateTimeValue

Sets a DateTime widget configuration value

Usage

$core_v2_widget.SetDateTimeValue($propertyName, $value)

Parameters

NameTypeDescriptionRequiredDefaultOptions
propertyNamestringProperty NameRequired
valueDateTimeValueRequired

SetDoubleValue

Sets a double widget configuration value

Usage

$core_v2_widget.SetDoubleValue($propertyName, $value)

Parameters

NameTypeDescriptionRequiredDefaultOptions
propertyNamestringProperty NameRequired
valuedoubleValueRequired

SetGuidValue

Sets a guid widget configuration value

Usage

$core_v2_widget.SetGuidValue($propertyName, $value)

Parameters

NameTypeDescriptionRequiredDefaultOptions
propertyNamestringProperty NameRequired
valuestringValueRequired

SetHtmlValue

Sets an HTML widget configuration value

Usage

$core_v2_widget.SetHtmlValue($propertyName, $value)

Parameters

NameTypeDescriptionRequiredDefaultOptions
propertyNamestringProperty NameRequired
valuestringValueRequired

SetIntValue

Sets an integer widget configuration value

Usage

$core_v2_widget.SetIntValue($propertyName, $value)

Parameters

NameTypeDescriptionRequiredDefaultOptions
propertyNamestringProperty NameRequired
valueintValueRequired

SetStringValue

Sets a string widget configuration value

Usage

$core_v2_widget.SetStringValue($propertyName, $value)

Parameters

NameTypeDescriptionRequiredDefaultOptions
propertyNamestringProperty NameRequired
valuestringValueRequired

SetUnitValue

Sets a unit widget configuration value

Usage

$core_v2_widget.SetUnitValue($propertyName, $value)

Parameters

NameTypeDescriptionRequiredDefaultOptions
propertyNamestringProperty NameRequired
valuestringValueRequired

SetUrlValue

Sets a URL widget configuration value

Usage

$core_v2_widget.SetUrlValue($propertyName, $value)

Parameters

NameTypeDescriptionRequiredDefaultOptions
propertyNamestringProperty NameRequired
valuestringValueRequired

UniqueId

Strengthens a given id to be unique across an entire page. Used to explicitly generate safe ids for DOM elements

Usage

#set($stringResponse = $core_v2_widget.UniqueId($id))

Parameters

NameTypeDescriptionRequiredDefaultOptions
idstringNon-unique stringRequired

Return Type

string