Creating a Theme for Graffiti CMS

One you have successfully installed the latest version of Graffiti CMS, your next task will be to modify the default theme, or create a new one.

Initially, creating or modifying a theme can be tricky because of the proprietary template system Graffiti CMS is built upon.   The template system is relatively easy to use once you have spent enough time to overcome the initial learning curve.

Here are a few tips that can help you quickly enhance the “look and feel” of your site:

  • Learn the fundamentals.  Views are the building blocks that are used to create a theme.  It is important to understand the view file structure before trying to create a new theme.  The View Overrides article on the Graffiti CMS website should be your first priority.
  • Don’t get a headache debugging cached pages.  Once you learn how to use views and begin to make some changes you will quickly run into a caching problem.  Namely, you will make a change to your theme file that will not show up when you refresh the page.   To get around this, you can turn off View caching by changing the  web.config setting “Graffiti:Views:Cache” from true to false.  In production sites, you will want to make sure that Caching is always on as it provides a significant performance boost, but while developing a new theme you will want to ensure that you have view caching turned off. 
  • Use the default theme as a guide.  When creating a theme from scratch, I always reference snippets of code from previous themes that I have developed, or from the default installation theme.  (i.e. $macros.Style(“style.css”,”screen”) and $macros.JavaScript(“utils/pngfix.js”))
  • Practice with an already developed design. is a great site with a ton of CSS templates that you can use to practice buidling a theme.  These designs have open licenses so try using one of these designs to build your first template and then offer it back to the community to download.

If you aren’t sure about getting under the hood of the Graffiti CMS theming engine, their are plenty of folks who have been working hard to develop free themes that you can quickly install and customize.  Check out Rich Mercer’s Graffiti Themes page or the Atlanta .Net Regular Guys who have 10 additional themes free for download (preview them here).

If you have additional tips that will help folks quickly create new themes in Graffiti CMS please post them in the comments below.

Leave a Reply

Your email address will not be published. Required fields are marked *