If, like me, you often develop on a Windows platform and then host using a *Nix-based server, Concrete5 has a gotcha which will probably hit you when you come to publish your site. At some point no doubt you’ll reach the point where you’ve copied the codebase to your server, created a database dump and imported it into the MySQL instance on your *Nix-based server. Try browsing to your site at this point, though, and you’ll get a message a lot like this:
Fatal error: Uncaught exception 'ADODB_Exception' with message 'mysql error: [1146: Table 'mysite.Config' doesn't exist] in EXECUTE("select * from Config where uID = 0 order by cfKey asc") ' in /var/www/mysite/htdocs/concrete/libraries/3rdparty/adodb/adodb-exceptions.inc.php:78 Stack trace: #0 /var/www/mysite/htdocs/concrete/libraries/3rdparty/adodb/adodb.inc.php(1037): adodb_throw('mysql', 'EXECUTE', 1146, 'Table 'mysite...', 'select * from C...', false, Object(ADODB_mysql)) #1 /var/www/mysite/htdocs/concrete/libraries/3rdparty/adodb/adodb.inc.php(1012): ADOConnection->_Execute('select * from C...', false) #2 /var/www/mysite/htdocs/concrete/libraries/database.php(75): ADOConnection->Execute('select * from C...') #3 /var/www/mysite/htdocs/concrete/models/config.php(151): Database->__call('Execute', Array) #4 /var/www/mysite/htdocs/concrete/models/config.php(151): Database->Execute('select * from C...') #5 /var/www/mysite in /var/www/mysite/htdocs/concrete/libraries/3rdparty/adodb/adodb-exceptions.inc.php on line 78
Having played around with Less for a while, I’m quite taken with it. Especially with useful tools such as Twitter’s newly released Bootstrap being optimised to work with it. Less works with CSS to provide all sorts of neat features such as variables, nested rules, functions and “mixins”, which means less code, and easier to maintain code. So, for example, instead of doing this each time you want a rounded corner:
I needed the means to add a quote to a website I was working on — a simple task, which could be acheieved by simply adding a text or HTML block. However this can be taken a step further by implementing a simple block type specifically for quotes, with the markup generated for you.
To mark up a quote semantically, we’ll want a blockquote for the content and a cite for the source (or author), so the HTML needs to look something like this:
<p>It is the mark of an educated mind to be able to entertain a thought without accepting it.</p>
…which will give us something a little like this:
In this simple tutorial, I’m going to show how Concrete5 can be extended to integrate a third-party JQuery plugin to enhance an existing module, and then how this can be encapsulated in a package. I’m going to allow the slideshow module to display images using the clean & lightweight Craftyslide plugin, pictured below.
Concrete5 comes shipped with simple slideshow functionality in the form of a block called, imaginatively enough, slideshow. As this is part of the core you can find it in /concrete/blocks/slideshow. It’s in the concrete directory to keep it separate from custom code. And some custom code is what we’re going to produce — to override the output of that block, and then to encapsulate this into a package.
There are so many Content Management Systems (CMS’s) out there that due to the sheer volume of choice it’s easy to plump for the best known options, such as Drupal, Joomla! and Wordpress. However there are times when these “flagship” CMS’s might not be the best option. Drupal, for example, can be overly complex and bloated for fairly simple websites (personally I’ve often thought of it more as a framework anyway), or Wordpress might be too specific for a site that’s not strictly a blog. I’ve long wanted a good, easy-to-use, stripped-down but extensible — alternative, and one such option I’ve looked at recently is Concrete5. Concrete5 has gone from being a commercial product to MIT-licensed Open Source and makes some pretty bold claims about being easier-to-use and better coded than Drupal or Joomla. But does it live up to these lofty ambitions? And how does it compare to Drupal, Joomla and so on?