Krang is an OSS Perl CMS that doesn't get
a lot of attention (in the Perl world is mostly Moveable Type
and sometimes Bricolage). We use it at work and for the most
part I'm pretty happy with it. So after being inspired by this post
I thought I'd write a similar post about Krang just to get the word out
there.
1 - Flexible
Love
Krang was initially developed for a large magazine company that had lots of magazines that they needed to bring online. Each magazine had their own look and feel, their own editors, their own workflow and their own style of composing articles. Krang needed to support all of these magazines in a single install.
Everything about a story in Krang is defined by an "element library". These element libraries can be created for each site you run or they can be shared between multiple sites. You can also inherit from other libraries to have some sites become even more specialized.
Krang also has the concept of different story types, so in your element library you could define blog posts, petitions, image galleries, surveys, etc. Every industry can be different in the kinds of things they want on their site. With the right element library you can easily turn Krang from a generic CMS into an industry specific one. That's why I like to think of Krang as a CMS platform rather than just a CMS.
Krang also divorces the creation and editting of content from the serving of that content. By default Krang publishes out static HTML documents and media files which can then be served by any old webserver. But for the more power hungry among us, we use Krang to publish out more interesting things. XML, PHP, generated Perl scripts, HTML::Template templates, .htaccess files, you name it. We then customize our front-end web servers to take those generated files and turn them into the tasty goodness that our clients see.
![]()
Krang also has an extensive addon system that allows any addon to override and extend any internal Krang class, template or media file. This means we can easily add extra screens, extra reports or even add fields to existing screens. All of these enhancements can exist with very little worry about upgrades breaking our addons (if we're careful).
At my job we manage over 70 distinct sites using just a handful of element libraries. Each one is very distinct in it's layout and different in what they do. Some are basically, static HTML sites. Others have complicated forms tied together and still others are flash apps that consume XML data files.
Hate
This flexibility comes at a cost. Setting up Krang is not a simple task. It does come with a very basic Default element library, but I see that more as an example of how to write your own element library rather than something that's useful for basic sites.
You also need to write you own templates, stylesheets, etc. Nothing like the nice pre-packaged skins you can get for Wordpress or Moveable Type.
We've talked about making this easier with a better default element library and even writing other more specific element libraries for common types of sites. We also talked about creating a kind of Krang-Forge where people could share and collaborate on addons. Unfortunately no one has found the time to do any of these ideas.
Krang's documentation is pretty good and thorough, but to get started you need to have skills as a sys-admin, Perl developer and front-end web designer. So it's hard to justify for smaller projects if you don't already have all that talent on hand.
2 - Everything is an Element
Love
Story elements (and even elements on media objects, and categories) are defined by the story's type and element library being used. When you create a story you add the elements you need and ignore the ones you don't. For an article this could be headings, subheadings, paragraphs, quotes, images, tags, etc. Elements can even be nested so that you can add things like images where you put in an alignment value, a caption, an attribution, etc and have it all be treated like a single entity when publishing.
![]()
Each element can have it's own template and publishing works by cascading upward: first publish the image's caption with it's template (if it has one) then the image with it's optional template and then the article the image is in. This gives a lot of power in deciding how similar things can look on different parts of the site.
The element library defines not only how the element is published, but also how it looks when the editor enters the data. An Event story's date element could be a fancy pop up calendar. A paragraph could be a little WYSIWYG editor and a section-heading could be simple text input.
Hate
Because everything is an element, they aren't just simple text items. Elements are complex Perl objects that are serialized and stored in the database. This makes it hard to examine them on the outside. You almost always have to write Perl code to manipulate the data in story. And because things can be nested to arbitary levels it's not always easy to find what you want in a flat database table.
Debugging serialized story data can sometimes be a royal pain. Dumping out a story's elements using Data::Dumper for more complicated stories can fill up many terminal screens.
Having our Stories in structured data has lots of benefits, but simplicity isn't one of them. Sometimes users just want a simple large WYSIWYG editor on the page so they can pretend they are using Microsoft Word and not have to think about composition or consistency. "I want this sentence to be red and blinking!".
3 - Small Community
Love

Since we have a lot clients who want lots of different things, often we've found ourselves wanting to make Krang do something different than what it does by default. It already has lots of customization hooks, but sometimes we've wanted just a few more.
Since it's OSS community is small it's pretty easy to get SVN access and commit the changes we've needed. Also, when we need to have something rolled out into production we can influence (and sometimes even outright control) the release schedule so that we have a version with the features and bug fixes we need for our clients. And it's not just our company that has this weight. All of the other companies that contribute heavily to Krang take advantage of this too.
Hate
A smaller community means less diversity and less structure. We don't have a project leader or even a project roadmap. We've done in-person meetings a couple of times that have always given blasts of energy to Krang development, but it's hard to sustain when the few core people have other things they need to do.
A smaller community also means there's less of a Krang eco-system. On larger projects beginners can get help from intermediate users who in turn can get help from experts. When you need to hire someone, you can put Wordpress, or Drupal experience on the job requirements because you know there's a large user base out there. There are even books written about using and developing for some of these Content Management Systems. While I hope this post brings more users into the Krang community, I'm realistic and know that I'm using a pretty obscure technology. I do sometimes ask myself whether it will come back to bite me down the road.
4 - All-in-One Installation
Love
Perl doesn't have a standard packaging system for deployment. Krang came into the OSS world in 2004 when projects like PAR were just getting started, so the developers at that time created their own custom way of packaging it. Krang comes bundled with it's own Apache, mod_perl, mod_ssl and a copy of every CPAN module it uses. This means deploying Krang is not a hunting expedition trying to round up all the dependencies nor digging through your Apache config to squeeze Krang in. Everything is built and installed together and doesn't affect anything else on your system.
This means we always have control over which versions of which Perl
libraries a given install is using. We have complete control over the
Apache/mod_perl configuration so we know that someone's custom setup
isn't going to cause us problems. Every install of Krang is identical
to every other install of that same version (minus any addons they
have installed). This makes troubleshooting much easier than it would be
otherwise. It also makes it easy for non sys-admins to install because you
don't have to teach them about rpm or their OS's package manager, you just
give them a simple ./bin/krang_install command to run and that's it.
Hate
A custom packaging system by definition means it's non-standard. You can't release Krang to CPAN, you can't turn it into an .rpm or .deb package (at least no easily). Any real sys-admin is going to give you the stink-eye when you tell them to install this application in a way that ignores all the other tools they use for managing their systems.
It also means that you have to learn and work around all of the platform specific problems that comes with building software. Krang does a pretty good job of this, but if we didn't have to worry about it we could definitely save developer time.
Another problem with a custom packaging system is that it's one more step for a new contributor to overcome. One more quirk to learn about our system before they can start submitting useful, tested patches.
5 - Simple Templating
Love
By default Krang uses HTML::Template (HTML::Template::Expr actually) both internally and for the publishing of stories. Users can control and edit these story templates for their sites and HTML::Template is pretty easy for them to learn. One of our addons provides some extra template functions to make things like number and date formatting easier.
Most people who can understand HTML can understand HTML::Template's syntax so we don't need too much training to get them up to speed. And most of the built-in operators and functions are simple enough to not cause the non-technical brain too much damage. Plus it's really fast.
Hate
Because of it's simplicity, HTML::Template lacks some constructs that
would make life much easier. There's no C
Addon's are free to override the templating system and use their own if they'd like, but I'm not sure anyone really does this.
Conclusion
Even given it's warts, I really do like Krang. It lets my small team manage some really complicated sites and give a lot of power to our users that they couldn't get in another system. It also let's us split up the responsibilities nicely. Non-technical people can create and edit dynamic forms on their web sites, view reports on the activities on those forms and make adjustments. And the most important thing is that when they are doing it, they don't have to bother me to do it for them :)

Obfuscating Email Addresses with JavaScript (and Prototype)