Enables scripted content fragments to use Media
- Properties
- AreRatingsEnabled
- Create
- Delete
- Download
- Get
- GetRating
- IncrementViewCount
- IsSubscribed
- List
- Preview
- SetRating
- SetSubscribed
- Update
Properties
Name | Access | Type | Description |
---|---|---|---|
ContentTypeId | Read | Guid | Media content type identifier |
Current | Read | Media | Current contextual media gallery post |
CurrentViewType | Read, Write | String | Current contextual view type |
Methods
AreRatingsEnabled
Returns whether ratings are enabled on a media gallery post. DEPRECATED: Use $core_v2_rating.CanCreate() instead.
Velocity
#set($booleanResponse = $core_v2_media.AreRatingsEnabled($id))
JavaScript
var booleanResponse = core_v2_media.AreRatingsEnabled(id);
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
id | Int32 | Id | Required |
Returns
Boolean
Create
Creates a new media post
Velocity
#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 }"))
JavaScript
var 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 | Int32 | Media Gallery Id | Required | ||
name | String | Name | Required | ||
contentType | String | Content Type | Required | ||
fileName | String | File Name | Required | ||
options | Options | Set of optional parameters including: | 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 | Array of Byte | FileData, FileUrl or FileUploadContext is required. OBSOLETE in 12: Use FileUrl or FileUploadContext instead. | Optional | ||
FileUploadContext | String | FileData, FileUrl or FileUploadContext is required. | Optional | ||
FileUrl | String | FileData, FileUrl or FileUploadContext is required. | Optional | ||
IsApproved | Boolean | Whether the moderation state should be approved | Optional | True | |
IsFeatured | Boolean | 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 | Boolean | When true, removes the post's attachment | Optional | False | |
Tags | String | A comma separated list of tags. | Optional |
Returns
Delete
Deletes a media gallery post
Velocity
#set($additionalInfoResponse = $core_v2_media.Delete($mediaGalleryId, $fileId))
JavaScript
var additionalInfoResponse = core_v2_media.Delete(mediaGalleryId, fileId);
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
mediaGalleryId | Int32 | Media Gallery Id | Required | ||
fileId | Int32 | File Id | Required |
Returns
Download
Downloads the media gallery file in response to the the current HTTP request
Velocity
$core_v2_media.Download($mediaId)
JavaScript
core_v2_media.Download(mediaId);
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
mediaId | Int32 | Media Id | Required |
Returns
NothingGet
Get Overload 1
Gets a media gallery post
Velocity
#set($mediaResponse = $core_v2_media.Get($fileId))
JavaScript
var mediaResponse = core_v2_media.Get(fileId);
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
fileId | Int32 | File Id | Required |
Get Overload 2
Gets a media gallery post
Velocity
#set($mediaResponse = $core_v2_media.Get($contentId))
JavaScript
var mediaResponse = core_v2_media.Get(contentId);
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
contentId | Guid | Content Id | Required |
Get Overload 3
Gets a media gallery post
Velocity
#set($mediaResponse = $core_v2_media.Get($mediaGalleryId, $fileId))
JavaScript
var mediaResponse = core_v2_media.Get(mediaGalleryId, fileId);
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
mediaGalleryId | Int32 | Media Gallery Id | Required | ||
fileId | Int32 | File Id | Required |
Returns
GetRating
Gets the rating. DEPRECATED: Use $core_v2_ratedItem.Get() instead.
Velocity
#set($ratingResponse = $core_v2_media.GetRating($id))
JavaScript
var ratingResponse = core_v2_media.GetRating(id);
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
id | Int32 | Id | Required |
Returns
IncrementViewCount
Increments the view count on a media gallery post
Velocity
$core_v2_media.IncrementViewCount($id)
JavaScript
core_v2_media.IncrementViewCount(id);
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
id | Int32 | Id | Required |
Returns
NothingIsSubscribed
IsSubscribed Overload 1
Returns subscribed status for the accessing user
Velocity
#set($booleanResponse = $core_v2_media.IsSubscribed($id, "%{ IncludeApplicationSubscriptions = $includeApplicationSubscriptionsArg }"))
JavaScript
var booleanResponse = core_v2_media.IsSubscribed(id, { IncludeApplicationSubscriptions: includeApplicationSubscriptionsArg });
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
id | Int32 | Id | Required | ||
options | Options | Set of optional parameters including: | Required | ||
IncludeApplicationSubscriptions | Boolean | When false, this will only show the subscription status of the content itself, ignorning any application level subscriptions. | Optional | True |
IsSubscribed Overload 2
Returns subscribed status for the accessing user
Velocity
#set($booleanResponse = $core_v2_media.IsSubscribed($id))
JavaScript
var booleanResponse = core_v2_media.IsSubscribed(id);
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
id | Int32 | Id | Required |
Returns
Boolean
List
List Overload 1
Lists media gallery posts
Velocity
#set($pagedListResponse = $core_v2_media.List())
JavaScript
var pagedListResponse = core_v2_media.List();
List Overload 2
Lists media gallery posts
Velocity
#set($pagedListResponse = $core_v2_media.List("%{ AuthorId = $authorIdArg, ContentIds = $contentIdsArg, GalleryId = $galleryIdArg, GalleryIds = $galleryIdsArg, GroupId = $groupIdArg, IncludeSubGroups = $includeSubGroupsArg, IncludeUnpublished = $includeUnpublishedArg, MaximumDownloadCount = $maximumDownloadCountArg, MinimumDownloadCount = $minimumDownloadCountArg, PageIndex = $pageIndexArg, PageSize = $pageSizeArg, SortBy = $sortByArg, SortOrder = $sortOrderArg }"))
JavaScript
var pagedListResponse = core_v2_media.List({ AuthorId: authorIdArg, ContentIds: contentIdsArg, GalleryId: galleryIdArg, GalleryIds: galleryIdsArg, GroupId: groupIdArg, IncludeSubGroups: includeSubGroupsArg, IncludeUnpublished: includeUnpublishedArg, MaximumDownloadCount: maximumDownloadCountArg, MinimumDownloadCount: minimumDownloadCountArg, PageIndex: pageIndexArg, PageSize: pageSizeArg, SortBy: sortByArg, SortOrder: sortOrderArg });
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
options | Options | Set of optional parameters including: | Required | ||
AuthorId | Int32 | Author Id of the content. | Optional | ||
ContentIds | String | Comma separated list of ContentIds. Used to limit to a specific set of files as well as sort order if SortBy is set to ContentIdsOrder | Optional | ||
GalleryId | Int32 | Gallery Id | Optional | ||
GalleryIds | String | Used to filter by a list of media galleries. Multiple values are separated with commas. | Optional | ||
GroupId | Int32 | Group Id | Optional | ||
IncludeSubGroups | Boolean | Used when filtering by group. | Optional | ||
IncludeUnpublished | Boolean | Specifies whether to include unpublished posts. | Optional | False | |
MaximumDownloadCount | Int32 | Maximum number of downloads the content can have for content to be returned. | Optional | ||
MinimumDownloadCount | Int32 | Minimum number of downloads the content must have for content to be returned. | Optional | ||
PageIndex | Int32 | Specify the page number of paged results to return. Zero-based index. | Optional | 0 | |
PageSize | Int32 | 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 |
Returns
Preview
Preview Overload 1
Previews a media gallery post
Velocity
#set($mediaResponse = $core_v2_media.Preview($mediaGalleryId, $name, $contentType, $fileName, "%{ Description = $descriptionArg, FeaturedImage = $featuredImageArg, FileData = $fileDataArg, FileUploadContext = $fileUploadContextArg, FileUrl = $fileUrlArg, IsFeatured = $isFeaturedArg, Tags = $tagsArg }"))
JavaScript
var 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 | Int32 | Media Gallery Id | Required | ||
name | String | Name | Required | ||
contentType | String | Content Type | Required | ||
fileName | String | File Name | Required | ||
options | Options | Set of optional parameters including: | Required | ||
Description | String | Description | Optional | ||
FeaturedImage | String | Used to include a featured image when IsFeatured is true. | Optional | ||
FileData | Array of Byte | FileData, FileUrl or FileUploadContext is required. OBSOLETE in 12: Use FileUrl or FileUploadContext instead. | Optional | ||
FileUploadContext | String | FileData, FileUrl or FileUploadContext is required. | Optional | ||
FileUrl | String | FileData, FileUrl or FileUploadContext is required. | Optional | ||
IsFeatured | Boolean | Is Featured | Optional | False | |
Tags | String | A comma separated list of tags. | Optional |
Preview Overload 2
Previews a media gallery post
Velocity
#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 }"))
JavaScript
var 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 | Int32 | Media Gallery Id | Required | ||
fileId | Int32 | File Id | Required | ||
options | Options | Set of optional parameters including: | Required | ||
ContentType | String | Content Type | Optional | ||
Description | String | Description | Optional | ||
FeaturedImage | String | Used to include a featured image when IsFeatured is true. | Optional | ||
FileData | Array of Byte | FileData, FileUrl or FileUploadContext is required. OBSOLETE in 12: Use FileUrl or FileUploadContext instead. | 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 | Boolean | Is Featured | Optional | False | |
Name | String | Name | Optional | ||
Tags | String | A comma separated list of tags. | Optional |
Returns
SetRating
Sets the rating for the accessing user. DEPRECATED: Use $core_v2_rating.Create() instead.
Velocity
$core_v2_media.SetRating($id, $rating)
JavaScript
core_v2_media.SetRating(id, rating);
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
id | Int32 | Id | Required | ||
rating | Int32 | Rating | Required |
Returns
NothingSetSubscribed
Sets subscribed status for the accessing user
Velocity
#set($additionalInfoResponse = $core_v2_media.SetSubscribed($id, $subscribe))
JavaScript
var additionalInfoResponse = core_v2_media.SetSubscribed(id, subscribe);
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
id | Int32 | Id | Required | ||
subscribe | Boolean | Subscribe | Required |
Returns
Update
Updates a media post
Velocity
#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 }"))
JavaScript
var 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 | Int32 | Media Gallery Id | Required | ||
fileId | Int32 | File Id | Required | ||
options | Options | Set of optional parameters including: | 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 | Array of Byte | OBSOLETE in 12: Use FileUrl or FileUploadContext instead. | Optional | ||
FileName | String | Required when updating FileData, FileUrl or FileUploadContext. | Optional | ||
FileUploadContext | String | File Upload Context | Optional | ||
FileUrl | String | File Url | Optional | ||
IsApproved | Boolean | Whether the moderation state should be approved | Optional | True | |
IsFeatured | Boolean | 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 | Boolean | When true, removes the post's attachment | Optional | False | |
RemoveOpenGraphImage | Boolean | When true, removes the post's open graph image | Optional | False | |
Tags | String | A comma separated list of tags. | Optional |