Methods
AreRatingsEnabled
Returns whether ratings are enabled on a thread
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
BlogPost
Create
Creates a new blog post
Usage
#set($blogPostResponse = $core_v2_blogPost.Create($blogId, $title, $body, "%{ContentType = $contentTypeArg, Excerpt = $excerptArg, FeaturedImage = $featuredImageArg, FileData = $fileDataArg, FileName = $fileNameArg, FileUrl = $fileUrlArg, IsApproved = $isApprovedArg, IsFeatured = $isFeaturedArg, 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 | | |
| FeaturedImage | string | Used to include a featured image when IsFeatured is true. | Optional | | |
| FileData | Byte[] | When adding a post attachment either FileData or FileUrl is required. | Optional | | |
| FileName | string | Used when adding a post attachement. | Optional | | |
| FileUrl | string | When adding a post attachment either FileData or FileUrl is required. | Optional | | |
| IsApproved | bool | Whether the moderation state should be approved | Optional | True | |
| IsFeatured | bool | Whether the post shoudl be featured | Optional | False | |
| 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
BlogPost
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
AdditionalInfo
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
AdditionalInfo
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
BlogPost
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
BlogPost
GetRating
Gets the rating
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 | | |
IsFavorite
Returns favorite status for the accessing user
Usage
#set($booleanResponse = $core_v2_blogPost.IsFavorite($blogPostId))
Parameters
| Name | Type | Description | Required | Default | Options |
|---|
| blogPostId | int | Blog Post Id | Required | | |
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, 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 | Either GroupId or BlogId or BlogIds are required | Optional | | |
| BlogIds | string | Either GroupId or BlogId or BlogIds are required. Used to filter by a list of blogs. Multiple values are separated with commas. | 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 | Either GroupId or BlogId or BlogIds are required. | Optional | | |
| IncludeSubGroups | bool | Only used when GroupId is specified. | Optional | False | |
| IncludeUnpublished | bool | defines whether to include unpublished posts in the response too. | 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 | MostComments, MostRecent, MostViewed, Score:SCORE_ID |
| SortOrder | string | Sort Order | Optional | Ascending | Ascending, Descending |
| Tags | string | Comma separated list of tags | Optional | | |
Return Type
PagedList<BlogPost>
SetFavorite
Sets favorite status for the accessing user
Usage
$core_v2_blogPost.SetFavorite($blogPostId, $favorite)
Parameters
| Name | Type | Description | Required | Default | Options |
|---|
| blogPostId | int | Blog Post Id | Required | | |
| favorite | bool | Favorite Status | Required | | |
SetRating
Sets the rating for the accessing user
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
AdditionalInfo
Update
Updates a blog post
Usage
#set($blogPostResponse = $core_v2_blogPost.Update($id, "%{BlogId = $blogIdArg, Body = $bodyArg, ContentType = $contentTypeArg, Excerpt = $excerptArg, FeaturedImage = $featuredImageArg, FileData = $fileDataArg, FileName = $fileNameArg, FileUrl = $fileUrlArg, IsApproved = $isApprovedArg, IsFeatured = $isFeaturedArg, PublishedDate = $publishedDateArg, RemoveAttachment = $removeAttachmentArg, 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 | | |
| FeaturedImage | string | Used to include a featured image when IsFeatured is true. | Optional | | |
| FileData | Byte[] | When adding a post attachment either FileData or FileUrl is required. | Optional | | |
| FileName | string | Used when adding a post attachement. | Optional | | |
| FileUrl | string | When adding a post attachment either FileData or FileUrl is required. | Optional | | |
| IsApproved | bool | Whether the moderation state should be approved | Optional | True | |
| IsFeatured | bool | Whether the post shoudl be featured | Optional | False | |
| 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 | |
| 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 | | |
Return Type
BlogPost