Featured Posts

Supreme Court Rules Against FCC, Net Neutrality Not a good day for net neutrality... A federal court threw the future of Internet regulations into doubt Tuesday with a far-reaching decision that went against the Federal...

Read More »

The Fog Machine has Arrived My Chauvet Hurricane 1300 arrived today. First thing's first--immediately unpack it, add some fog juice, and play! [caption id="attachment_81" align="aligncenter" width="225"...

Read More »

Realestate Manager 2.0 Picture Preview Since Real Estate Manager 2.0 is now almost ready for release, I figured I would share the differences between the current version (1.1) and 2.0. To start things off, the...

Read More »

Automotive Manager Photo Update It's been less than 2 months since I started on Automotive Manager. In that time, I've taken the thing from next to nothing to an almost complete product. I'm not sure how...

Read More »

The New GreeneCountyIndiana.com Since about March I have been working (rather slowly) on a new content management system for GreeneCountyIndiana.com. Along with it comes a new layout and many new features. The...

Read More »

Chuck’s Blog Rss A scary bee!!!

New GreeneCountyIndiana.com CMS: Modularity

Posted on : 08-07-2008 | By : Chuck | In : HTML/CSS, MySQL, PHP, Programming


Modularity is a very important part of writing software. A modular program will contain various ‘modules’ for different functions used throughout the projects.

The CakePHP framework (which the CMS is being built on) makes it easy to write modular code, by use of helpers, components, behaviors, and elements. For those unfamiliar with Cake, it is a MVC framework written for PHP. Helpers and elements are used for views, behaviors for models, and components for controllers.

The past few days have been spent writing various modules for the new CMS. The Tagging system makes use of the Tag Helper, which handles displaying tag lists and the adding/deleting of tags. The Basics Helper has convenience functions for pre-configured pagination and various dialog boxes.

The greatest advantage of helpers is the re-usability in code. For example, the following code:
echo $basics->setupDeleteDialog(array('elementToDelete' => 'div.newsitem'));

is all that is needed to handle the Delete Item dialog. I just add that to the view for each controller (News, Pages, Photos, etc), change the elementToDelete, and viola! I now have a functional delete dialog. If I want to make changes to the way the dialog functions, I merely have to edit the code in the helper file, as opposed to editing code in every single file that contains a delete dialog.

The current CMS makes little to no use of helpers, which makes it extremely difficult to update parts of the website. Fortunately, the new CMS is actually being built with modularity in mind.

The New GreeneCountyIndiana.com

Posted on : 06-07-2008 | By : Chuck | In : Uncategorized


Since about March I have been working (rather slowly) on a new content management system for GreeneCountyIndiana.com. Along with it comes a new layout and many new features.

The current CMS was written over a year ago with the CakePHP framework. It was the first application I had ever written using the cake framework, and I have some code to prove it. I can remember saying during the development process that I was going to write it so that it never had to be rewritten from scratch. Unfortunately, deadlines and lack of experience saw to it that that was not possible.

So now the website is left with something that:

  • Doesn’t scale
  • Is not easily expandable
  • Requires code edits to change minor settings
  • Has bits of code copied/pasted all over the place, as opposed to using Helpers and Components

I’m sure you can see why I decided to start from scratch.

The new CMS plans to fix all of these problems. It will also implement many new features and user interface updates. More about that will be posted at a later date.