blogs.conchango.com

welcome to the conchango blogging site
Welcome to blogs.conchango.com Sign in | Join | Help
in Search

Howard van Rooijen's Blog

Custom Chalk Extensions for Graffiti CMS

Telligent, who produce Community Server (which is the current http://blogs.conchango.com/ blogging platform) have just released Graffiti CMS v1.0 - a light weight, simple to use Content Management System. There was a slight overreaction by the WordPress community to Telligent's Google AdSense campaign - but luckily things seemed to have calmed down a little, especially as Graffiti seems be surrounded by a growing good vibe and is building a solid community.

I've been looking at using Graffiti as the CMS for a little side project and have been incredibly impressed by its great usability, simplicity (you really can install it in under two minutes) powerful extensibility points and timely support from Telligent on their forums. The theming engine - called Chalk is based on the Castle Projects' cut of NVelocity and is a joy to use; it's certainly a nice antidote to the overheads and complexities of developing using ASP.NET WebForms.

The product has been built with extensibility  at the core - so any features that are not included out of the box are trivial to add. A few Graffiti Extension Projects have sprung up already, hopefully these will grow and grow in the future.  I've created a CodePlex project called ChalkExtensions which contains the custom Chalk extensions I've written for my pet project.

So far the extensions are:

  • public PostCollection GetAllPostsForCategory(string categoryName)
  • public PostCollection SortPostsAscending(PostCollection posts, string propertyName)
  • public PostCollection SortPostsDescending(PostCollection posts, string propertyName)
  • public PostCollection Randomize(PostCollection original, int numberOfPosts)
  • public PostCollection GetRandomPostsForCategory(string categoryName, int numberOfPosts)

Using the extensions is simply a case of compiling the code, dropping the dll into Graffiti's \bin folder and then from within any of your .view files you can simply call the extensions using the $ChalkExtensions syntax. For example, pulling back 3 random posts from the "Events" and rendering them into content blocks can be done as follows:

#set($latestEventsPosts = $ChalkExtensions.GetRandomPostsForCategory("Events", 3))
#foreach($post in $latestEventsPosts)
   <div class="contenttextblock">
      <h3><a href="$post.Url">$post.Title</a></h3>
      <p>$post.Excerpt("", "" , "[read more]", 300)</p>
   </div>
#end

Published 24 February 2008 12:05 by howard.vanrooijen

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

 

Envious Guy said:

I'm envious, I've been doing Dynamics NAV (Navision) for the last past 10 years :-(

June 10, 2008 00:37

Leave a Comment

(required) 
(optional)
(required) 
Submit
Powered by Community Server (Personal Edition), by Telligent Systems