Enables scripted content fragments to use BlogPosts

Properties

NameTypeDescriptionDefaultOptions
BlogPostContentViewTypeIdGuidId used to track a view to the a blog post
ContentTypeIdGuidBlog posts content type identifier
CurrentBlogPostReturns the current contextual blog post

Methods

AreRatingsEnabled

Returns whether ratings are enabled on a thread

Usage

#set($booleanResponse = $core_v2_blogPost.AreRatingsEnabled($blogPostId))

Parameters

NameTypeDescriptionRequiredDefaultOptions
blogPostIdintBlog Post IdRequired

Return Type

bool

Create

Creates a new blog post

Usage

#set($blogPostResponse = $core_v2_blogPost.Create($blogId, $title, $body))

Parameters

NameTypeDescriptionRequiredDefaultOptions
blogIdintBlog IdRequired
titlestringTitleRequired
bodystringBodyRequired

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

NameTypeDescriptionRequiredDefaultOptions
blogIdintId of parent blogRequired
titlestringTitle of blog postRequired
bodystringContent of blog postRequired
ContentTypestringUsed when adding a post attachement.Optional
ExcerptstringExcerptOptional
FeaturedImagestringUsed to include a featured image when IsFeatured is true.Optional
FileDataByte[]When adding a post attachment either FileData or FileUrl is required.Optional
FileNamestringUsed when adding a post attachement.Optional
FileUrlstringWhen adding a post attachment either FileData or FileUrl is required.Optional
IsApprovedboolWhether the moderation state should be approvedOptionalTrue
IsFeaturedboolWhether the post shoudl be featuredOptionalFalse
PublishedDateDateTimeIf PublishedDate is not specified it will default to current date/time.Optional
SlugstringIf not specified slug will be automatically created based on post title.Optional
TagsstringA comma separated list of tags.Optional

Return Type

BlogPost

Delete

Deletes a blog post

Usage

#set($additionalInfoResponse = $core_v2_blogPost.Delete($id))

Parameters

NameTypeDescriptionRequiredDefaultOptions
idintId of the blog postRequired

Return Type

AdditionalInfo

Delete

Deletes a blog post

Usage

#set($additionalInfoResponse = $core_v2_blogPost.Delete($id))

Parameters

NameTypeDescriptionRequiredDefaultOptions
idintId of the blog postRequired

Return Type

AdditionalInfo

Get

Gets a blog post

Usage

#set($blogPostResponse = $core_v2_blogPost.Get("%{BlogId = $blogIdArg, Id = $idArg, Name = $nameArg}"))

Parameters

NameTypeDescriptionRequiredDefaultOptions
BlogIdintId of the parent blogOptional
IdintEither the Id or the Name (key) is required.Optional
NamestringEither 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

NameTypeDescriptionRequiredDefaultOptions
contentIdGuidContent IdRequired

Return Type

BlogPost

GetRating

Gets the rating

Usage

#set($ratingResponse = $core_v2_blogPost.GetRating($blogPostId))

Parameters

NameTypeDescriptionRequiredDefaultOptions
blogPostIdintBlog Post IdRequired

Return Type

Rating

IncrementViewCount

Increments the view count for a blog post

Usage

$core_v2_blogPost.IncrementViewCount($blogPostId)

Parameters

NameTypeDescriptionRequiredDefaultOptions
blogPostIdintBlog Post IdRequired

IsFavorite

Returns favorite status for the accessing user

Usage

#set($booleanResponse = $core_v2_blogPost.IsFavorite($blogPostId))

Parameters

NameTypeDescriptionRequiredDefaultOptions
blogPostIdintBlog Post IdRequired

Return Type

bool

IsSubscribed

Returns subscribed status for the accessing user

Usage

#set($booleanResponse = $core_v2_blogPost.IsSubscribed($blogPostId))

Parameters

NameTypeDescriptionRequiredDefaultOptions
blogPostIdintBlog Post IdRequired

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

NameTypeDescriptionRequiredDefaultOptions
AuthorIdintId of authorOptional
BlogIdintEither GroupId or BlogId or BlogIds are requiredOptional
BlogIdsstringEither GroupId or BlogId or BlogIds are required. Used to filter by a list of blogs. Multiple values are separated with commas.Optional
DateFilterstringA DateTime value used to filter postsOptional
DateFilterTypestringOnly used when using a DateFilter.OptionalDay, Month, Year
GroupIdintEither GroupId or BlogId or BlogIds are required.Optional
IncludeSubGroupsboolOnly used when GroupId is specified.OptionalFalse
IncludeUnpublishedbooldefines whether to include unpublished posts in the response too. OptionalFalse
LogicallyOrTagsboolFilter posts by tags with OROptionalFalse
PageIndexintSpecify the page number of paged results to return. Zero-based index.Optional0
PageSizeintSpecify the number of results to return per page.Optional20
SortBystringSort ByOptionalMostRecentMostComments, MostRecent, MostViewed, Score:SCORE_ID
SortOrderstringSort OrderOptionalAscendingAscending, Descending
TagsstringComma separated list of tagsOptional

Return Type

PagedList<BlogPost>

SetFavorite

Sets favorite status for the accessing user

Usage

$core_v2_blogPost.SetFavorite($blogPostId, $favorite)

Parameters

NameTypeDescriptionRequiredDefaultOptions
blogPostIdintBlog Post IdRequired
favoriteboolFavorite StatusRequired

SetRating

Sets the rating for the accessing user

Usage

$core_v2_blogPost.SetRating($blogPostId, $rating)

Parameters

NameTypeDescriptionRequiredDefaultOptions
blogPostIdintBlog Post IdRequired
ratingintRatingRequired

SetSubscribed

Sets subscribed status for the accessing user

Usage

#set($additionalInfoResponse = $core_v2_blogPost.SetSubscribed($blogPostId, $subscribe))

Parameters

NameTypeDescriptionRequiredDefaultOptions
blogPostIdintBlog Post IdRequired
subscribeboolSubscribed StatusRequired

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

NameTypeDescriptionRequiredDefaultOptions
idintId of the blog post to updateRequired
BlogIdintId of parent blogOptional
BodystringContent of blog postOptional
ContentTypestringUsed when adding a post attachement.Optional
ExcerptstringExcerptOptional
FeaturedImagestringUsed to include a featured image when IsFeatured is true.Optional
FileDataByte[]When adding a post attachment either FileData or FileUrl is required.Optional
FileNamestringUsed when adding a post attachement.Optional
FileUrlstringWhen adding a post attachment either FileData or FileUrl is required.Optional
IsApprovedboolWhether the moderation state should be approvedOptionalTrue
IsFeaturedboolWhether the post shoudl be featuredOptionalFalse
PublishedDateDateTimeIf PublishedDate is not specified it will default to current date/time.Optional
RemoveAttachmentboolWhen true, removes the post's attachmentOptionalFalse
SlugstringIf not specified slug will be automatically created based on post title.Optional
TagsstringA comma separated list of tags.Optional
TitlestringTitle of blog postOptional

Return Type

BlogPost