Migrating a Concrete5 Site from Windows to Linux, and MySQL Case Sensitivity Hell

Posted 21st October 2011

If, like me, you often develop on a Win­dows plat­form and then host using a *Nix-​based server, Concrete5 has a gotcha which will prob­a­bly hit you when you come to pub­lish your site. At some point no doubt you’ll reach the point where you’ve copied the code­base to your server, cre­ated a data­base dump and imported it into the MySQL instance on your *Nix-​based server. Try brows­ing to your site at this point, though, and you’ll get a mes­sage 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

Using Less, the Dynamic Stylesheet Language, in Concrete5

Posted 2nd September 2011

Less, the dynamic styesheet language

Hav­ing played around with Less for a while, I’m quite taken with it. Espe­cially with use­ful tools such as Twitter’s newly released Boot­strap being opti­mised to work with it. Less works with CSS to pro­vide all sorts of neat fea­tures such as vari­ables, nested rules, func­tions and “mix­ins”, which means less code, and eas­ier to main­tain code. So, for exam­ple, instead of doing this each time you want a rounded corner:

-moz-border-radius: 10px; 
-webkit-border-radius: 10px; 
border-radius: 10px;

A Concrete5 Development Tutorial; Creating a Quote Block

Posted 7th July 2011

I needed the means to add a quote to a web­site I was work­ing on — a sim­ple task, which could be acheieved by sim­ply adding a text or HTML block. How­ever this can be taken a step fur­ther by imple­ment­ing a sim­ple block type specif­i­cally for quotes, with the markup gen­er­ated for you.

To mark up a quote seman­ti­cally, we’ll want a blockquote for the con­tent and a cite for the source (or author), so the HTML needs to look some­thing 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 some­thing a lit­tle like this:

Creating a Concrete5 Package: Integrating the Craftyslide JQuery Plugin

Posted 5th July 2011

In this sim­ple tuto­r­ial, I’m going to show how Concrete5 can be extended to inte­grate a third-​party JQuery plu­gin to enhance an exist­ing mod­ule, and then how this can be encap­su­lated in a pack­age. I’m going to allow the slideshow mod­ule to dis­play images using the clean & light­weight Craftys­lide plu­gin, pic­tured below.

The Craftyslide JQuery Slider plugin in action
The Craftys­lide plu­gin in action

Concrete5 comes shipped with sim­ple slideshow func­tion­al­ity in the form of a block called, imag­i­na­tively enough, slideshow. As this is part of the core you can find it in /concrete/blocks/slideshow. It’s in the con­crete direc­tory to keep it sep­a­rate from cus­tom code. And some cus­tom code is what we’re going to pro­duce — to over­ride the out­put of that block, and then to encap­su­late this into a package.

A Look at the Concrete5 CMS

Posted 28th June 2011

There are so many Con­tent Man­age­ment Sys­tems (CMS’s) out there that due to the sheer vol­ume of choice it’s easy to plump for the best known options, such as Dru­pal, Joomla! and Word­press. How­ever there are times when these “flag­ship” CMS’s might not be the best option. Dru­pal, for exam­ple, can be overly com­plex and bloated for fairly sim­ple web­sites (per­son­ally I’ve often thought of it more as a frame­work any­way), or Word­press might be too spe­cific for a site that’s not strictly a blog. I’ve long wanted a good, easy-​to-​use, stripped-​down but exten­si­ble — alter­na­tive, and one such option I’ve looked at recently is Concrete5. Concrete5 has gone from being a com­mer­cial prod­uct to MIT-​licensed Open Source and makes some pretty bold claims about being easier-​to-​use and bet­ter coded than Dru­pal or Joomla. But does it live up to these lofty ambi­tions? And how does it com­pare to Dru­pal, Joomla and so on?