Concepts

Blocks

Blocks are the smallest presentational unit in concrete5. They are meant to be added to a page, and to consist primarily of visible content.

Each time a block is added to a page, a new Block object is created. This same block object may be aliased to different pages and versions of pages.

Block Types

Each block has a BlockType object associated with it, which tells the system what type of data it stores. Each block must be of a certain type (e.g. “slideshow,” “content,” “page list,” etc…)

Block Instance-Specific Data

A combination of these two types of data gives us the block’s instance-specific data. This is information about the particular instance of the block that is only relevant to the block’s type. For example, if you’re dealing with the Youtube video block, it’s instance-specific data is the address of the video you want to display, and its name. Basically, any information displayed a block’s add or edit interface is its instance-specific data.

Code Locations

All of the necessary block files are contained within one directory, located in one of several places

  • concrete/blocks/
  • packages/some_package/blocks/
  • blocks/

The name of the directory that stores the code files in these locations must match that of the block type handle.

Overrides

Any file in the first two locations above can be overridden by the same file in the third location. This lets sites override presentational and controller logic for custom applications and display, without forking core code bases or packages acquired from the marketplace.

Recent Discussions on this Topic

Copy from how-to, missing download link

This page http://www.concrete5.org/documentation/developers/blocks/creating-a-new-block-type/ is a copy of a how-to http://www.concrete5.org/documentation/how-tos/understanding-and-building-blocks-in-concrete5/ The link to the basic block file is broke…

Block Javascript corrupted Admin Edit ability

I inserted a HTML block with references to a script. I think the new script is preventing me from being able to edit that page. The top row of icons no longer displays in the brower. To fix this, can I just go into the database and delete the frows f…

Block sizing

Guys, I have inserted an image block, selected a 780 x 200 image and inserted. The block then displays at about 20px high. I have gone into edit mode 'edit' and 'design' but nothing seems to fix this. I am sure it simple but it beats me! Any suggestions p…

Block sizing

Guys, I have inserted an image block, selected a 780 x 200 image and inserted. The block then displays at about 20px high. I have gone into edit mode 'edit' and 'design' but nothing seems to fix this. I am sure it simple but it beats me! Any suggestions p…

Auto-including guestbook block in template?

Hello, I'm working on a custom template for my site, and I would like to auto-include a guestbook on each page. So, in my template where I want to include it, I've tried using the following code: And this displays a guest book, and it mostly wor…