Data is a built-in chalk extension, similar to Macros, which enables quick and easy access to additional Graffiti data ($data). Listed below are the available data methods and properties.
GetPost(int id) – Gets the post for the specified ID.
GetPost(string name) – Gets the post for the specified name.
Featured – Gets the site’s featured post.
Featured(int categoryId) – Gets the site’s featured post for the specified category Id.
Featured(string categoryName) – Gets the site’s featured post for the specified category name.
Featured(Graffiti.Core.Category category) – Gets the site’s featured post for the specified category.
PostsByTag(string tagName) – Gets all posts by the specified tag.
PostsByTagAndCategory(string tagName, string category) – Gets all posts by the specified tag in the specified category name.
PostsByTagAndCategory(string tagName category, string, int numberOfPosts) –Gets all posts by the specified tag with the specified category name with a max number of results.
PostsByTagAndCategory(string tagName, Graffiti.Core.Category category) – Gets all posts by the specified tag in the specified category.
PostsByTagAndCategory(string tagName category, Graffiti.Core.Category, int numberOfPosts) – Gets all posts by the specified tag in the specified category with a max number of results.
PostsByCategory(string categoryName, int numberOfPosts) – Gets the last x number of posts from the specified category name.
PostsByCategory(Graffiti.Core.Category category, int numberOfPosts) – Gets the last x number of posts from the specified category.
Categories – Gets all of the site’s categories.
GetCategory(int categoryId) – Gets a category by the specified Id.
GetCategory(string categoryName) – Gets a category by the specified name.
RecentComments(int numberOfComments) – Gets the last x number of specified recent comments.
RecentComments(int numberOfComments, string categoryName) – Gets the last x number of comments from the specified category name.
RecentComments(int numberOfComments, int categoryId) – Gets the last x number of comments from the specified category Id.
PostFeedback(int PostId) – Gets the post feedback from the specified postId.
PostComments(int PostId) – Gets the post comments from the specified postId.
PostTrackbacks(int PostId) – Gets the post trackbacks from the specified postId.
RecentPosts(int numberOfPosts) – Gets x number of recent posts.
PopularPosts(int numberOfPosts) – Gets x number of popular posts.
PopularPosts(int numberOfPosts, string categoryName) – Gets x number of popular posts by the specified category name.
PopularPosts(int numberOfPosts, int categoryId) – Gets x number of popular posts from the specified category Id.
Tags(int min, int max) – Gets the specified min/max number of tags.
GetAllTags – Gets all tags.
Search(string q pageIndex, int, int pageSize) – Gets a searchresult set by the specified query, pageIndex (usually 0), and max pageSize.
SimilarSearch(int postid, int numberOfRelatedPosts) – Gets x number of similar posts by the postid.
GetWidgets(Graffiti.Core.WidgetLocation location) – Gets all widgets in the specified WidgetLocation.
RightWidgets – Returns all widgets on the right sidebar.
LeftWidgets – Returns all widgets on the left sidebar.
QueueWidgets – Returns all of the queue widgets.
Site – Gets a reference to the SiteSettings object.