Content Blocks

Content blocks are small chunks of content that aren't generated by any specific module. Blocks are designed to be embedded on other pages - in a sidebar, or the footer, or at the bottom of every blog post. You could, for example, create a Content Block with copyright information, and automatically have it added at the bottom of every blog post.

You create new content blocks using the standard Manifesto interface. Each block has the following properties:

  • Title
  • Body (full HTML)
  • CSS class (applied to container)
  • CSS style (applied to container)
  • Background image

These define the content elements of the block, and offer some additional styling features that may be applied based on the template used to embed the content on your site.

After creating the content, there are a variety of options for indicating where you want the content to appear. You are provided with an interface for selecting the parameters for embedding this content:

  • Location (where you want the content to appear)
  • Template (the layout template into which your content is flowed)
  • Module interactions (the modules permitted to display the content)

You may select more than one template and output location: you could, for example, use the same content in an a "square box with borders" template for the bottom of the home page, and also "tall box with background image" for the sidebar on TemplatePage pages. The same content will appear in each location, avoiding the need to create multiple content boxes just for different areas of your site.

You can even use the Content Blocks module to embed more complicated templates into your site. For example, you could create a custom output template that contains programming logic or a meticulously designed snippet of HTML (e.g. an ad banner), and then use the Content Blocks module to insinuate it onto your site. In such a case, you may only need a title for your block, and can safely ignore the other content properties, since the template contains everything it needs.

If you select the "Floating" event location, your content will not appear anywhere by default -- it will only appear if you manually insert a placeholder code like [#content_block_14#] into the body field of a page, or use the floating event include code directly in a template:


if ($listener = Module::invoke_listener('content_blocks') && $inc = $listener->get_include_file()) {
 include $inc;
}