Enables scripted content fragments to use BlogPosts
- Properties
- AreRatingsEnabled
- Create
- Delete
- Get
- GetRating
- IncrementViewCount
- IsSubscribed
- List
- SetRating
- SetSubscribed
- Update
Properties
Name | Access | Type | Description |
---|---|---|---|
BlogPostContentViewTypeId | Read | Guid | Id used to track a view to the a blog post |
ContentTypeId | Read | Guid | Blog posts content type identifier |
Current | Read | BlogPost | Returns the current contextual blog post |
Methods
AreRatingsEnabled
Returns whether ratings are enabled on a thread. DEPRECATED: Use $core_v2_rating.CanCreate() instead.
Velocity
#set($booleanResponse = $core_v2_blogPost.AreRatingsEnabled($blogPostId))
JavaScript
var booleanResponse = core_v2_blogPost.AreRatingsEnabled(blogPostId);
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
blogPostId | Int32 | Blog Post Id | Required |
Returns
Boolean
Create
Create Overload 1
Creates a new blog post
Velocity
#set($blogPostResponse = $core_v2_blogPost.Create($blogId, $title, $body))
JavaScript
var blogPostResponse = core_v2_blogPost.Create(blogId, title, body);
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
blogId | Int32 | Blog Id | Required | ||
title | String | Title | Required | ||
body | String | Body | Required |
Create Overload 2
Creates a new blog post
Velocity
#set($blogPostResponse = $core_v2_blogPost.Create($blogId, $title, $body, "%{ AuthorId = $authorIdArg, ContentType = $contentTypeArg, Excerpt = $excerptArg, ExtendedAttributes = $extendedAttributesArg, FeaturedImage = $featuredImageArg, FileData = $fileDataArg, FileName = $fileNameArg, FileUploadContext = $fileUploadContextArg, FileUrl = $fileUrlArg, IsApproved = $isApprovedArg, IsFeatured = $isFeaturedArg, MetaDescription = $metaDescriptionArg, MetaKeywords = $metaKeywordsArg, MetaTitle = $metaTitleArg, OpenGraphDescription = $openGraphDescriptionArg, OpenGraphImageContext = $openGraphImageContextArg, OpenGraphImageFileName = $openGraphImageFileNameArg, OpenGraphTitle = $openGraphTitleArg, PostImageFileData = $postImageFileDataArg, PostImageFileName = $postImageFileNameArg, PostImageFileUploadContext = $postImageFileUploadContextArg, PostImageUrl = $postImageUrlArg, PublishedDate = $publishedDateArg, Slug = $slugArg, Tags = $tagsArg }"))
JavaScript
var blogPostResponse = core_v2_blogPost.Create(blogId, title, body, { AuthorId: authorIdArg, ContentType: contentTypeArg, Excerpt: excerptArg, ExtendedAttributes: extendedAttributesArg, FeaturedImage: featuredImageArg, FileData: fileDataArg, FileName: fileNameArg, FileUploadContext: fileUploadContextArg, FileUrl: fileUrlArg, IsApproved: isApprovedArg, IsFeatured: isFeaturedArg, MetaDescription: metaDescriptionArg, MetaKeywords: metaKeywordsArg, MetaTitle: metaTitleArg, OpenGraphDescription: openGraphDescriptionArg, OpenGraphImageContext: openGraphImageContextArg, OpenGraphImageFileName: openGraphImageFileNameArg, OpenGraphTitle: openGraphTitleArg, PostImageFileData: postImageFileDataArg, PostImageFileName: postImageFileNameArg, PostImageFileUploadContext: postImageFileUploadContextArg, PostImageUrl: postImageUrlArg, PublishedDate: publishedDateArg, Slug: slugArg, Tags: tagsArg });
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
blogId | Int32 | Id of parent blog | Required | ||
title | String | Title of blog post | Required | ||
body | String | Content of blog post | Required | ||
AuthorId | Int32 | User who authored the blog post. If not provided, the accessing user authored the blog. Used when creating a blog post on behalf of the author. | Optional | ||
ContentType | String | Used when adding a post attachement. | Optional | ||
Excerpt | String | Excerpt | 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 | When adding a post attachment either FileData, FileUrl or FileUploadContext is required. | Optional | ||
FileName | String | Used when adding a post attachement. | Optional | ||
FileUploadContext | String | When adding a post attachment either FileData, FileUrl or FileUploadContext is required. | Optional | ||
FileUrl | String | When adding a post attachment either FileData, FileUrl or FileUploadContext is required. | Optional | ||
IsApproved | Boolean | Whether the moderation state should be approved | Optional | True | |
IsFeatured | Boolean | Whether the post should be 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 description 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 | ||
PostImageFileData | Array of Byte | When adding a post attachment either PostImageFileData, PostImageFileUrl or PostImageFileUploadContext is required. | Optional | ||
PostImageFileName | String | Used when adding a post image. | Optional | ||
PostImageFileUploadContext | String | When adding a post attachment either PostImageFileData, PostImageFileUrl or PostImageFileUploadContext is required. | Optional | ||
PostImageUrl | String | When adding a post attachment either PostImageFileData, PostImageFileUrl or PostImageFileUploadContext is required. | Optional | ||
PublishedDate | DateTime | If PublishedDate is not specified it will default to current date/time. | Optional | ||
Slug | String | If not specified slug will be automatically created based on post title. | Optional | ||
Tags | String | A comma separated list of tags. | Optional |
Returns
Delete
Delete Overload 1
Deletes a blog post
Velocity
#set($additionalInfoResponse = $core_v2_blogPost.Delete($id))
JavaScript
var additionalInfoResponse = core_v2_blogPost.Delete(id);
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
id | Int32 | Id of the blog post | Required |
Delete Overload 2
Deletes a blog post
Velocity
#set($additionalInfoResponse = $core_v2_blogPost.Delete($id, "%{ }"))
JavaScript
var additionalInfoResponse = core_v2_blogPost.Delete(id, { });
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
id | Int32 | Id of the blog post | Required |
Returns
Get
Get Overload 1
Gets a blog post
Velocity
#set($blogPostResponse = $core_v2_blogPost.Get("%{ BlogId = $blogIdArg, EnablePendingReview = $enablePendingReviewArg, Id = $idArg, Name = $nameArg }"))
JavaScript
var blogPostResponse = core_v2_blogPost.Get({ BlogId: blogIdArg, EnablePendingReview: enablePendingReviewArg, Id: idArg, Name: nameArg });
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
BlogId | Int32 | Id of the parent blog | Optional | ||
EnablePendingReview | Boolean | When true, enables retrieving edits to the blog post that are currently pending review authored by the accessing user. | Optional | False | |
Id | Int32 | Either the Id or the Name (key) is required. | Optional | ||
Name | String | Either the Id or the Name (key) is required. | Optional |
Get Overload 2
Gets a blog post
Velocity
#set($blogPostResponse = $core_v2_blogPost.Get($contentId))
JavaScript
var blogPostResponse = core_v2_blogPost.Get(contentId);
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
contentId | Guid | Content Id | Required |
Returns
GetRating
Gets the rating. DEPRECATED: Use $core_v2_ratedItem.Get() instead.
Velocity
#set($ratingResponse = $core_v2_blogPost.GetRating($blogPostId))
JavaScript
var ratingResponse = core_v2_blogPost.GetRating(blogPostId);
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
blogPostId | Int32 | Blog Post Id | Required |
Returns
IncrementViewCount
Increments the view count for a blog post
Velocity
$core_v2_blogPost.IncrementViewCount($blogPostId)
JavaScript
core_v2_blogPost.IncrementViewCount(blogPostId);
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
blogPostId | Int32 | Blog Post Id | Required |
Returns
NothingIsSubscribed
IsSubscribed Overload 1
Returns subscribed status for the accessing user
Velocity
#set($booleanResponse = $core_v2_blogPost.IsSubscribed($blogPostId, "%{ IncludeApplicationSubscriptions = $includeApplicationSubscriptionsArg }"))
JavaScript
var booleanResponse = core_v2_blogPost.IsSubscribed(blogPostId, { IncludeApplicationSubscriptions: includeApplicationSubscriptionsArg });
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
blogPostId | Int32 | Blog Post Id | 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_blogPost.IsSubscribed($blogPostId))
JavaScript
var booleanResponse = core_v2_blogPost.IsSubscribed(blogPostId);
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
blogPostId | Int32 | Blog Post Id | Required |
Returns
Boolean
List
Lists blog posts
Velocity
#set($pagedListResponse = $core_v2_blogPost.List("%{ AuthorId = $authorIdArg, BlogId = $blogIdArg, BlogIds = $blogIdsArg, ContentIds = $contentIdsArg, DateFilter = $dateFilterArg, DateFilterType = $dateFilterTypeArg, GroupId = $groupIdArg, IncludeSubGroups = $includeSubGroupsArg, IncludeUnpublished = $includeUnpublishedArg, LogicallyOrTags = $logicallyOrTagsArg, PageIndex = $pageIndexArg, PageSize = $pageSizeArg, SortBy = $sortByArg, SortOrder = $sortOrderArg, Tags = $tagsArg }"))
JavaScript
var pagedListResponse = core_v2_blogPost.List({ AuthorId: authorIdArg, BlogId: blogIdArg, BlogIds: blogIdsArg, ContentIds: contentIdsArg, DateFilter: dateFilterArg, DateFilterType: dateFilterTypeArg, GroupId: groupIdArg, IncludeSubGroups: includeSubGroupsArg, IncludeUnpublished: includeUnpublishedArg, LogicallyOrTags: logicallyOrTagsArg, PageIndex: pageIndexArg, PageSize: pageSizeArg, SortBy: sortByArg, SortOrder: sortOrderArg, Tags: tagsArg });
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
AuthorId | Int32 | Id of author | Optional | ||
BlogId | Int32 | Blog to filter by. | Optional | ||
BlogIds | String | Used to filter by a list of blogs. Multiple values are separated with commas. | Optional | ||
ContentIds | String | Comma separated list of ContentIds. Used to limit to a specific set of blog posts as well as sort order if SoryBy is set to ContentIdsOrder | Optional | ||
DateFilter | String | A DateTime value used to filter posts | Optional | ||
DateFilterType | String | Only used when using a DateFilter. | Optional | Day, Month, Year | |
GroupId | Int32 | Group to filter by. | Optional | ||
IncludeSubGroups | Boolean | Only used when GroupId is specified. | Optional | False | |
IncludeUnpublished | Boolean | defines whether to include unpublished posts in the response. | Optional | False | |
LogicallyOrTags | Boolean | Filter posts by tags with OR | Optional | False | |
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 | MostRecent | ContentIdsOrder, MostComments, MostRecent, MostViewed, Score:SCORE_ID |
SortOrder | String | Sort Order | Optional | Ascending | Ascending, Descending |
Tags | String | 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_blogPost.SetRating($blogPostId, $rating)
JavaScript
core_v2_blogPost.SetRating(blogPostId, rating);
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
blogPostId | Int32 | Blog Post Id | Required | ||
rating | Int32 | Rating | Required |
Returns
NothingSetSubscribed
Sets subscribed status for the accessing user
Velocity
#set($additionalInfoResponse = $core_v2_blogPost.SetSubscribed($blogPostId, $subscribe))
JavaScript
var additionalInfoResponse = core_v2_blogPost.SetSubscribed(blogPostId, subscribe);
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
blogPostId | Int32 | Blog Post Id | Required | ||
subscribe | Boolean | Subscribed Status | Required |
Returns
Update
Updates a blog post
Velocity
#set($blogPostResponse = $core_v2_blogPost.Update($id, "%{ AuthorId = $authorIdArg, BlogId = $blogIdArg, Body = $bodyArg, ContentType = $contentTypeArg, Excerpt = $excerptArg, ExtendedAttributes = $extendedAttributesArg, FeaturedImage = $featuredImageArg, FileData = $fileDataArg, FileName = $fileNameArg, FileUploadContext = $fileUploadContextArg, FileUrl = $fileUrlArg, IsApproved = $isApprovedArg, IsFeatured = $isFeaturedArg, MetaDescription = $metaDescriptionArg, MetaTitle = $metaTitleArg, OpenGraphDescription = $openGraphDescriptionArg, OpenGraphImageContext = $openGraphImageContextArg, OpenGraphImageFileName = $openGraphImageFileNameArg, OpenGraphTitle = $openGraphTitleArg, PostImageFileData = $postImageFileDataArg, PostImageFileName = $postImageFileNameArg, PostImageFileUploadContext = $postImageFileUploadContextArg, PostImageUrl = $postImageUrlArg, PublishedDate = $publishedDateArg, RemoveAttachment = $removeAttachmentArg, RemoveOpenGraphImage = $removeOpenGraphImageArg, RemovePostImage = $removePostImageArg, Slug = $slugArg, Tags = $tagsArg, Title = $titleArg }"))
JavaScript
var blogPostResponse = core_v2_blogPost.Update(id, { AuthorId: authorIdArg, BlogId: blogIdArg, Body: bodyArg, ContentType: contentTypeArg, Excerpt: excerptArg, ExtendedAttributes: extendedAttributesArg, FeaturedImage: featuredImageArg, FileData: fileDataArg, FileName: fileNameArg, FileUploadContext: fileUploadContextArg, FileUrl: fileUrlArg, IsApproved: isApprovedArg, IsFeatured: isFeaturedArg, MetaDescription: metaDescriptionArg, MetaTitle: metaTitleArg, OpenGraphDescription: openGraphDescriptionArg, OpenGraphImageContext: openGraphImageContextArg, OpenGraphImageFileName: openGraphImageFileNameArg, OpenGraphTitle: openGraphTitleArg, PostImageFileData: postImageFileDataArg, PostImageFileName: postImageFileNameArg, PostImageFileUploadContext: postImageFileUploadContextArg, PostImageUrl: postImageUrlArg, PublishedDate: publishedDateArg, RemoveAttachment: removeAttachmentArg, RemoveOpenGraphImage: removeOpenGraphImageArg, RemovePostImage: removePostImageArg, Slug: slugArg, Tags: tagsArg, Title: titleArg });
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
id | Int32 | Id of the blog post to update | Required | ||
AuthorId | Int32 | User who authored the blog post. If not provided, the accessing user authored the blog. Used when creating a blog post on behalf of the author. | Optional | ||
BlogId | Int32 | Id of parent blog | Optional | ||
Body | String | Content of blog post | Optional | ||
ContentType | String | Used when adding a post attachement. | Optional | ||
Excerpt | String | Excerpt | 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 | When adding a post attachment either FileData, FileUrl or FileUploadContext is required. | Optional | ||
FileName | String | Used when adding a post attachement. | Optional | ||
FileUploadContext | String | When adding a post attachment either FileData, FileUrl or FileUploadContext is required. | Optional | ||
FileUrl | String | When adding a post attachment either FileData, FileUrl or FileUploadContext is required. | Optional | ||
IsApproved | Boolean | Whether the moderation state should be approved | Optional | True | |
IsFeatured | Boolean | Whether the post should be featured | Optional | False | |
MetaDescription | String | Description used in meta description 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 | ||
PostImageFileData | Array of Byte | When adding a post attachment either PostImageFileData, PostImageFileUrl or PostImageFileUploadContext is required. | Optional | ||
PostImageFileName | String | Used when adding a post image. | Optional | ||
PostImageFileUploadContext | String | When adding a post attachment either PostImageFileData, PostImageFileUrl or PostImageFileUploadContext is required. | Optional | ||
PostImageUrl | String | When adding a post attachment either PostImageFileData, PostImageFileUrl or PostImageFileUploadContext is required. | Optional | ||
PublishedDate | DateTime | If PublishedDate is not specified it will default to current date/time. | 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 | |
RemovePostImage | Boolean | When true, removes the post's image | Optional | False | |
Slug | String | If not specified slug will be automatically created based on post title. | Optional | ||
Tags | String | A comma separated list of tags. | Optional | ||
Title | String | Title of blog post | Optional |