Enables scripted content fragments to use BlogPosts
Properties
Name | Type | Description | Default | Options |
---|---|---|---|---|
BlogPostContentViewTypeId | Guid | Id used to track a view to the a blog post | ||
ContentTypeId | Guid | Blog posts content type identifier | ||
Current | BlogPost | Returns the current contextual blog post |
Methods
AreRatingsEnabled
Returns whether ratings are enabled on a thread. DEPRECATED: Use $core_v2_rating.CanCreate() instead.
Usage
#set($booleanResponse = $core_v2_blogPost.AreRatingsEnabled($blogPostId))
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
blogPostId | int | Blog Post Id | Required |
Return Type
bool
Create
Creates a new blog post
Usage
#set($blogPostResponse = $core_v2_blogPost.Create($blogId, $title, $body))
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
blogId | int | Blog Id | Required | ||
title | string | Title | Required | ||
body | string | Body | Required |
Return Type
Create
Creates a new blog post
Usage
#set($blogPostResponse = $core_v2_blogPost.Create($blogId, $title, $body, "%{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 | int | Id of parent blog | Required | ||
title | string | Title of blog post | Required | ||
body | string | Content of blog post | Required | ||
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 | 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 | bool | Whether the moderation state should be approved | Optional | True | |
IsFeatured | bool | 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 | 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 |
Return Type
Delete
Deletes a blog post
Usage
#set($additionalInfoResponse = $core_v2_blogPost.Delete($id))
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
id | int | Id of the blog post | Required |
Return Type
Delete
Deletes a blog post
Usage
#set($additionalInfoResponse = $core_v2_blogPost.Delete($id))
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
id | int | Id of the blog post | Required |
Return Type
Get
Gets a blog post
Usage
#set($blogPostResponse = $core_v2_blogPost.Get("%{BlogId = $blogIdArg, Id = $idArg, Name = $nameArg}"))
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
BlogId | int | Id of the parent blog | Optional | ||
Id | int | Either the Id or the Name (key) is required. | Optional | ||
Name | string | Either the Id or the Name (key) is required. | Optional |
Return Type
Get
Gets a blog post
Usage
#set($blogPostResponse = $core_v2_blogPost.Get($contentId))
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
contentId | Guid | Content Id | Required |
Return Type
GetRating
Gets the rating. DEPRECATED: Use $core_v2_ratedItem.Get() instead.
Usage
#set($ratingResponse = $core_v2_blogPost.GetRating($blogPostId))
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
blogPostId | int | Blog Post Id | Required |
Return Type
Rating
IncrementViewCount
Increments the view count for a blog post
Usage
$core_v2_blogPost.IncrementViewCount($blogPostId)
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
blogPostId | int | Blog Post Id | Required |
IsSubscribed
Returns subscribed status for the accessing user
Usage
#set($booleanResponse = $core_v2_blogPost.IsSubscribed($blogPostId, "%{IncludeApplicationSubscriptions = $includeApplicationSubscriptionsArg}"))
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
blogPostId | int | Blog Post 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_blogPost.IsSubscribed($blogPostId))
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
blogPostId | int | Blog Post Id | Required |
Return Type
bool
List
Lists blog posts
Usage
#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}"))
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
AuthorId | int | Id of author | Optional | ||
BlogId | int | 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 | int | Group to filter by. | Optional | ||
IncludeSubGroups | bool | Only used when GroupId is specified. | Optional | False | |
IncludeUnpublished | bool | defines whether to include unpublished posts in the response. | Optional | False | |
LogicallyOrTags | bool | Filter posts by tags with OR | 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 | MostRecent | ContentIdsOrder, MostComments, MostRecent, MostViewed, Score:SCORE_ID |
SortOrder | string | Sort Order | Optional | Ascending | Ascending, Descending |
Tags | string | 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_blogPost.SetRating($blogPostId, $rating)
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
blogPostId | int | Blog Post Id | Required | ||
rating | int | Rating | Required |
SetSubscribed
Sets subscribed status for the accessing user
Usage
#set($additionalInfoResponse = $core_v2_blogPost.SetSubscribed($blogPostId, $subscribe))
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
blogPostId | int | Blog Post Id | Required | ||
subscribe | bool | Subscribed Status | Required |
Return Type
Update
Updates a blog post
Usage
#set($blogPostResponse = $core_v2_blogPost.Update($id, "%{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 | int | Id of the blog post to update | Required | ||
BlogId | int | 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 | 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 | bool | Whether the moderation state should be approved | Optional | True | |
IsFeatured | bool | 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 | 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 | bool | When true, removes the post's attachment | Optional | False | |
RemoveOpenGraphImage | bool | When true, removes the post's open graph image | Optional | False | |
RemovePostImage | bool | 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 |