Many of the themes for GraffitiCMS contain an index.view which will display the first few lines of your post as an excerpt on the front page.   Here are some tips on how you can better control what is displayed in that excerpt, and why you may want to enhance what is displayed.

This serves to avoid having pages with duplicate content which is an SEO sin, and to also allow readers of your site to view summaries of many of your articles on the same page. 

With the addition of the new GraffitCMS Blog extensions plugin, the first few lines of your post are also used in the trackback text when trackbacks are posted to other sites which cite your content.

So you can see how you would want to make the beginning of your post inviting to engage the reader to read the full article posting if they are viewing your index page, or see your blog in a remote trackback entry.

I stumbled upon Josh Ledgard‘s tip for showing the full post content on the homepage, where he shows you how to change the index.view to show the full post, instead of the excerpt on the home page.  While this is the opposite of what I would like to do, it did show me the syntax that is used to define how much of your post is used for the excerpt creation.

   1: $post.Excerpt('Continue reading...',$post.Title, 300)

So the above line in the index.view sets the continuation text, which is displayed with the post to link to the full article, the link name (which is set to the post title above), and the number of characters to use from the beginning of the post to display in the excerpt.

While this is all well and good for ease of use, it can lead to some poorly formatted excerpts from your content, since it appears to ignore formatting and links within that character count.  Depending on where that character count is reached, it could end up not displaying as you wish in the excerpt. I can understand why you would want to exclude the links from being links in the excerpt, since you would prefer the reader continue onto the full post, instead of link jump to some other site without reading your full post.

If you want to control what is used for the excerpt, a better way is to use the Body and Extended Body sections in the GCMS post editor.  If you defined a body, and an extended body, it appears that GCMS will use the Body section to define the excerpt displayed in your index.view.  It will also display proper formatting of line breaks and links as well, which may yield a better appearance for your content.  When the reader views your complete post url, the post is viewed as a single complete post with the body on top of the extended body.

If you use Windows Live Writer, you can choose where to split your post by inserting the Split Post entry from the Format menu as well, which will insert <!–more–> to where the split should be.

I like the fact that they though of making it easy to build the excerpts automatically, but still give you the option to define your excerpt on a post by post basis if you wish.  I am hoping a wiki is made available on the GCMS site to document all of the syntax used for Chalk extensions to provide better understanding of what is available.  Only then as more is known, will we really start to see some great things flourish using the GraffitiCMS platform.

Technorati Tags: graffiticms,