While we believe we are providing you with just about everything you need to build and design a great site out of the box, we still wanted to make it really easy to plug your own code into Graffiti.
Extending Chalk is very simple.
Here is an example that enables the theme developer to quickly add links to a couple popular bookmarking sites as well as making it very easy for users to email the post to a friend.
[Chalk("shareIt")] public class ShareIt { public string HTML(string message, Post post) { return string.Format(shareItBody, message, HttpUtility.HtmlEncode(post.Title), new Macros().FullUrl(post.Url)); } private static readonly string shareItBody = "HTML TRUNCATED FOR DEMO"; }
After the class above is compiled and the assembly is added to your bin directory, you can then use it in a post list (index.view/etc) or on a single post view (post.view) with the following format: $shareIt.HTML("Share This Post", $post).
A couple of other things to mention.