This is the documentation for concrete5 version 5.6 and earlier. View Current Documentation


Both concrete5 and Drupal have "blocks" and both use these blocks in fairly similar ways, to display small pieces of a page. In concrete5 there are really 2 major parts to the block system, first there is the "Block Type" which is a specific kind of block such as a "autonav" block or an "html" block. Then there is the "Block Object" which is a single instance of a given Block Type. So if you decide to add some HTML content to a sidebar in concrete5, you'll create a Block Object using the HTML Block Type.


The first big difference between concrete5 and Drupal blocks is that in concrete5 when you make a block you can choose between all the different Block Types, and each has its own interface, its own fields and options. Contrast this to Drupal where a new block made in the Admin is basically just a single textarea field that we fill with content.

The next advantage I see in concrete5 blocks is that concrete5 Block Types are like "block building factories" rather than individual, single-use blocks. So take for instance the "login block" provided in Drupal by the Users module. It is only 1 block, and if you put it on 10 pages, it is still the same block shown on 10 pages. Which is fine, if that is what you want. But in concrete5, a login block is a Block Type, which means you can make as many different blocks of that type as you need. So you could create 2 different login blocks, for use in different pages or different site sections. This "factory" approach is enabled by how concrete5 builds blocks in code.

By default concrete5 gives you around 15 different Block Types to choose from, including Auto-Nav, Content, Date Navigation, External Form, File, Flash Content, Form, Google Map and more. And each of these can be added to any concrete5 site page using edit-in-place.

Building Custom Blocks

Now let's look at how concrete5 and Drupal build blocks. The major difference here is that in concrete5 blocks are built using multiple files in a folder, which is stored in a specific place in the site files. So for example a typical concrete5 block will have controller (as in MVC controller), a database definition XML file, and other files. Whereas in Drupal, blocks are built entirely using functions. So if you want to make a block available from a custom Drupal module, you would write implement 2 or more functions within your block code. The obvious downside to the Drupal "make-in-code" approach is that if your making several blocks inside a module, the code can become messy and long. And if your trying to edit an existing block definition, you have to search for it in the code. In contrast, concrete5 blocks can be overridden by creating a new version of 1 of more of the files.

In both Drupal and concrete5 there are thousands of different blocks available as addons or modules. So if you need something specific for your site you can probably find it and add it to your site. But the big difference between concrete5 and Drupal blocks made through modules is that concrete5 blocks are much more sophisticated and versatile because they are built almost like miniature MVC applications.

Loading Conversation