Enables scripted content fragments to use Media
Properties
Name | Type | Description | Default | Options |
---|---|---|---|---|
ContentTypeId | Guid | Media content type identifier | ||
Current | Media | Current contextual media gallery post | ||
CurrentViewType | string | Current contextual view type |
Methods
AreRatingsEnabled
Returns whether ratings are enabled on a media gallery post. DEPRECATED: Use $core_v2_rating.CanCreate() instead.
Usage
#set($booleanResponse = $core_v2_media.AreRatingsEnabled($id))
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
id | int | Id | Required |
Return Type
bool
Create
Creates a new media post
Usage
#set($mediaResponse = $core_v2_media.Create($mediaGalleryId, $name, $contentType, $fileName, "%{Description = $descriptionArg, ExtendedAttributes = $extendedAttributesArg, FeaturedImage = $featuredImageArg, FileData = $fileDataArg, FileUploadContext = $fileUploadContextArg, FileUrl = $fileUrlArg, IsApproved = $isApprovedArg, IsFeatured = $isFeaturedArg, MetaDescription = $metaDescriptionArg, MetaKeywords = $metaKeywordsArg, MetaTitle = $metaTitleArg, OpenGraphDescription = $openGraphDescriptionArg, OpenGraphImageContext = $openGraphImageContextArg, OpenGraphImageFileName = $openGraphImageFileNameArg, OpenGraphTitle = $openGraphTitleArg, RemoveAttachment = $removeAttachmentArg, Tags = $tagsArg}"))
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
mediaGalleryId | int | Media Gallery Id | Required | ||
name | string | Name | Required | ||
contentType | string | Content Type | Required | ||
fileName | string | File Name | Required | ||
Description | string | Description | Optional | ||
ExtendedAttributes | string | Extended attributes are key-value pairs set using the syntax _ExtendedAttributes_key=value. i.e. _ExtendedAttributes_MyKey=MyValue sets ExtendedAttributes["MyKey"] to "MyValue". | Optional | ||
FeaturedImage | string | Used to include a featured image when IsFeatured is true. | Optional | ||
FileData | Byte[] | FileData, FileUrl or FileUploadContext is required. | Optional | ||
FileUploadContext | string | FileData, FileUrl or FileUploadContext is required. | Optional | ||
FileUrl | string | FileData, FileUrl or FileUploadContext is required. | Optional | ||
IsApproved | bool | Whether the moderation state should be approved | Optional | True | |
IsFeatured | bool | Is Featured | Optional | False | |
MetaDescription | string | Description used in meta description tag. | Optional | ||
MetaKeywords | string | Keywords for the meta keyword tag. | Optional | ||
MetaTitle | string | Title used in page's title tag. | Optional | ||
OpenGraphDescription | string | Description used in Open Graph title tag. | Optional | ||
OpenGraphImageContext | string | When adding a an Open Graph image either OpenGraphImageData or OpenGraphImageContext is required. | Optional | ||
OpenGraphImageFileName | string | Used when adding an Open Graph image | Optional | ||
OpenGraphTitle | string | Title used in Open Graph title tag. | Optional | ||
RemoveAttachment | bool | When true, removes the post's attachment | Optional | False | |
Tags | string | A comma separated list of tags. | Optional |
Return Type
Delete
Deletes a media gallery post
Usage
#set($additionalInfoResponse = $core_v2_media.Delete($mediaGalleryId, $fileId))
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
mediaGalleryId | int | Media Gallery Id | Required | ||
fileId | int | File Id | Required |
Return Type
Download
Downloads the media gallery file in response to the the current HTTP request
Usage
$core_v2_media.Download($mediaId)
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
mediaId | int | Media Id | Required |
Get
Gets a media gallery post
Usage
#set($mediaResponse = $core_v2_media.Get($fileId))
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
fileId | int | File Id | Required |
Return Type
Get
Gets a media gallery post
Usage
#set($mediaResponse = $core_v2_media.Get($contentId))
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
contentId | Guid | Content Id | Required |
Return Type
Get
Gets a media gallery post
Usage
#set($mediaResponse = $core_v2_media.Get($mediaGalleryId, $fileId))
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
mediaGalleryId | int | Media Gallery Id | Required | ||
fileId | int | File Id | Required |
Return Type
GetRating
Gets the rating. DEPRECATED: Use $core_v2_ratedItem.Get() instead.
Usage
#set($ratingResponse = $core_v2_media.GetRating($id))
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
id | int | Id | Required |
Return Type
Rating
IncrementViewCount
Increments the view count on a media gallery post
Usage
$core_v2_media.IncrementViewCount($id)
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
id | int | Id | Required |
IsSubscribed
Returns subscribed status for the accessing user
Usage
#set($booleanResponse = $core_v2_media.IsSubscribed($id, "%{IncludeApplicationSubscriptions = $includeApplicationSubscriptionsArg}"))
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
id | int | Id | Required | ||
IncludeApplicationSubscriptions | bool | When false, this will only show the subscription status of the content itself, ignorning any application level subscriptions. | Optional | True |
Return Type
bool
IsSubscribed
Returns subscribed status for the accessing user
Usage
#set($booleanResponse = $core_v2_media.IsSubscribed($id))
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
id | int | Id | Required |
Return Type
bool
List
Lists media gallery posts
Usage
#set($pagedListResponse = $core_v2_media.List("%{ContentIds = $contentIdsArg, GalleryId = $galleryIdArg, GalleryIds = $galleryIdsArg, GroupId = $groupIdArg, IncludeSubGroups = $includeSubGroupsArg, IncludeUnpublished = $includeUnpublishedArg, PageIndex = $pageIndexArg, PageSize = $pageSizeArg, SortBy = $sortByArg, SortOrder = $sortOrderArg}"))
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
ContentIds | string | Comma separated list of ContentIds. Used to limit to a specific set of files as well as sort order if SoryBy is set to ContentIdsOrder | Optional | ||
GalleryId | int | Gallery Id | Optional | ||
GalleryIds | string | Used to filter by a list of media galleries. Multiple values are separated with commas. | Optional | ||
GroupId | int | Group Id | Optional | ||
IncludeSubGroups | bool | Used when filtering by group. | Optional | ||
IncludeUnpublished | bool | Specifies whether to include unpublished posts. | Optional | False | |
PageIndex | int | Specify the page number of paged results to return. Zero-based index. | Optional | 0 | |
PageSize | int | Specify the number of results to return per page. | Optional | 20 | |
SortBy | string | Sort By | Optional | PostDate | Author, Comments, ContentIdsOrder, Downloads, PostDate, Rating, Score:SCORE_ID, Subject, Views |
SortOrder | string | Sort Order | Optional | Ascending | Ascending, Descending |
Return Type
List
Lists media gallery posts
Usage
#set($pagedListResponse = $core_v2_media.List())
Return Type
Preview
Previews a media gallery post
Usage
#set($mediaResponse = $core_v2_media.Preview($mediaGalleryId, $fileId, "%{ContentType = $contentTypeArg, Description = $descriptionArg, FeaturedImage = $featuredImageArg, FileData = $fileDataArg, FileName = $fileNameArg, FileUploadContext = $fileUploadContextArg, FileUrl = $fileUrlArg, IsFeatured = $isFeaturedArg, Name = $nameArg, Tags = $tagsArg}"))
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
mediaGalleryId | int | Media Gallery Id | Required | ||
fileId | int | File Id | Required | ||
ContentType | string | Content Type | Optional | ||
Description | string | Description | Optional | ||
FeaturedImage | string | Used to include a featured image when IsFeatured is true. | Optional | ||
FileData | Byte[] | FileData, FileUrl or FileUploadContext is required. | Optional | ||
FileName | string | File Name | Optional | ||
FileUploadContext | string | FileData, FileUrl or FileUploadContext is required. | Optional | ||
FileUrl | string | FileData, FileUrl or FileUploadContext is required. | Optional | ||
IsFeatured | bool | Is Featured | Optional | False | |
Name | string | Name | Optional | ||
Tags | string | A comma separated list of tags. | Optional |
Return Type
Preview
Previews a media gallery post
Usage
#set($mediaResponse = $core_v2_media.Preview($mediaGalleryId, $name, $contentType, $fileName, "%{Description = $descriptionArg, FeaturedImage = $featuredImageArg, FileData = $fileDataArg, FileUploadContext = $fileUploadContextArg, FileUrl = $fileUrlArg, IsFeatured = $isFeaturedArg, Tags = $tagsArg}"))
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
mediaGalleryId | int | Media Gallery Id | Required | ||
name | string | Name | Required | ||
contentType | string | Content Type | Required | ||
fileName | string | File Name | Required | ||
Description | string | Description | Optional | ||
FeaturedImage | string | Used to include a featured image when IsFeatured is true. | Optional | ||
FileData | Byte[] | FileData, FileUrl or FileUploadContext is required. | Optional | ||
FileUploadContext | string | FileData, FileUrl or FileUploadContext is required. | Optional | ||
FileUrl | string | FileData, FileUrl or FileUploadContext is required. | Optional | ||
IsFeatured | bool | Is Featured | Optional | False | |
Tags | string | A comma separated list of tags. | Optional |
Return Type
SetRating
Sets the rating for the accessing user. DEPRECATED: Use $core_v2_rating.Create() instead.
Usage
$core_v2_media.SetRating($id, $rating)
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
id | int | Id | Required | ||
rating | int | Rating | Required |
SetSubscribed
Sets subscribed status for the accessing user
Usage
#set($additionalInfoResponse = $core_v2_media.SetSubscribed($id, $subscribe))
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
id | int | Id | Required | ||
subscribe | bool | Subscribe | Required |
Return Type
Update
Updates a media post
Usage
#set($mediaResponse = $core_v2_media.Update($mediaGalleryId, $fileId, "%{ContentType = $contentTypeArg, Description = $descriptionArg, ExtendedAttributes = $extendedAttributesArg, FeaturedImage = $featuredImageArg, FileData = $fileDataArg, FileName = $fileNameArg, FileUploadContext = $fileUploadContextArg, FileUrl = $fileUrlArg, IsApproved = $isApprovedArg, IsFeatured = $isFeaturedArg, MetaDescription = $metaDescriptionArg, MetaKeywords = $metaKeywordsArg, MetaTitle = $metaTitleArg, Name = $nameArg, OpenGraphDescription = $openGraphDescriptionArg, OpenGraphImageContext = $openGraphImageContextArg, OpenGraphImageFileName = $openGraphImageFileNameArg, OpenGraphTitle = $openGraphTitleArg, RemoveAttachment = $removeAttachmentArg, RemoveOpenGraphImage = $removeOpenGraphImageArg, Tags = $tagsArg}"))
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
mediaGalleryId | int | Media Gallery Id | Required | ||
fileId | int | File Id | Required | ||
ContentType | string | Required when updating FileData, FileUrl or FileUploadContext. | Optional | ||
Description | string | Description | Optional | ||
ExtendedAttributes | string | Extended attributes are key-value pairs set using the syntax _ExtendedAttributes_key=value. i.e. _ExtendedAttributes_MyKey=MyValue sets ExtendedAttributes["MyKey"] to "MyValue". | Optional | ||
FeaturedImage | string | Used to include a featured image when IsFeatured is true. | Optional | ||
FileData | Byte[] | File Data | Optional | ||
FileName | string | Required when updating FileData, FileUrl or FileUploadContext. | Optional | ||
FileUploadContext | string | File Upload Context | Optional | ||
FileUrl | string | File Url | Optional | ||
IsApproved | bool | Whether the moderation state should be approved | Optional | True | |
IsFeatured | bool | Is Featured | Optional | ||
MetaDescription | string | Description used in meta description tag. | Optional | ||
MetaKeywords | string | Keywords for the meta keyword tag. | Optional | ||
MetaTitle | string | Title used in page's title tag. | Optional | ||
Name | string | Name | Optional | ||
OpenGraphDescription | string | Description used in Open Graph title tag. | Optional | ||
OpenGraphImageContext | string | When adding a an Open Graph image either OpenGraphImageData or OpenGraphImageContext is required. | Optional | ||
OpenGraphImageFileName | string | Used when adding an Open Graph image | Optional | ||
OpenGraphTitle | string | Title used in Open Graph title tag. | Optional | ||
RemoveAttachment | bool | When true, removes the post's attachment | Optional | False | |
RemoveOpenGraphImage | bool | When true, removes the post's open graph image | Optional | False | |
Tags | string | A comma separated list of tags. | Optional |