Award Winning Design

Tactical Web Development

Effective SEO Marketing


Graffiti CMS - Actualize Chalk Extensions

Monday, April 27, 2009

Now that we have done a number of Graffiti installations for clients (and ourselves), I have become rather adept at extending Chalk.

 

In the next few days, I will be uploading to CodePlex the Actualize Chalk Extensions project and source code (C#) to create a community and, hopefully, get other developers to contribute to this project in an effort to make a really powerful Chalk Extension library available for Graffiti.

 

For example, some of the methods available currently:

  • Accordian (int catID, string catNM)  -  builds a vertical menu system that's parent levels (category) can expand and collapse to reveal all the sub-categories and their posts.  CSS Formatted.  Supported files required.
  • AddNoFollowToLink (string HTML)  -  applies rel='nofollow' to all <a href> tags in the passed HTML snippet.  Great for SEO.
  • BuildSideNav()  -  Creates a hierarchal vertical navigation structure based on Category / SubCategory structure.  Uses default category posts and the link for the Category name, and lists all other published posts for each level.  CSS formatted.
  • CategoryHasAccordian (int catID)  -  boolean, returns whether the passed Category indeed even has subcategories or posts to Accordian.
  • CommentsForPost (int PostId)  -  returns a CommentCollection object of all published comments for a Post
  • GetAllPublishedPosts()  -  Returns a PostCollection object of all published Posts for the entire site.
  • GetAllPublishedPosts(bool bSortByTitle)  - Returns a PostCollection object of all published Posts for the entire site with the option of having them sorted by Title.
  • GetAppKey (string key)  -  Returns a string value of the requested web.config key
  • GetGraffitiArrayElement(int index, string[] arr)  -  returns the requested Array Element
  • GetPostPart(string Post, int part)  -  Allows Post.Body to be split into 3rds, and the ability to retrieve each piece individually.
  • GetPermalinkFromPostId(int id)  -  returns the canonical url of a particular post
  • GetPost(int PostID)  -  Returns a specific Post
  • GetPost(string PostID)  -  Returns a specific Post when passed the PostID as a string.
  • GetPostsForCategory (int CatID)  -  returns a PostCollection object of all published posts for a Category.  For some reason, Graffiti wants a specific number of Posts to be returned.
  • GetPostTitleFromPermalink(string URL)  -  handy for custom templates where the post you want to display may be relevant to the URL but not necessarily the system's automatically selected post.
  • GetValueFromForm(string Key)  -  returns a posted Form's specified field value.  Great for processing form data in your view files.
  • GetValueFromQueryString(string Key)  -  returns a requested QueryString value
  • GetYear()  -  Returns the current year.
  • InString(string strCheck, string strFor)  -  returns a boolean of whether a parent string has the requested string pattern
  • Left(string str, int len)  -  returns the left len characters of a string
  • NameFromPermalink(string URL)  -  returns the Post name from a permalink, again handy when doing customized layouts where the system's default post may not exactly be the post you want to display.
  • ReplaceInText(string original, string textReplaceWhat, string textReplaceWith)  -  replaces text in a string
  • SearchResults(string srch)  -  Returns a PostCollection of Posts that either the Title or Body match the search requested (and is published)
  • SplitByString(string testString, string split) -  returns an string array splitting a passed string with the passed delimiter
  • SubCatsForCategory (int catID, string Sort) -  Returns a CategoryCollection of subcategories for a specified category
  • UserName(string UserID) -  returns the ProperName of the requested UserID

 

I look forward to getting this going, as I have yet to really participate in any social code-sharing projects.