Blocks 1.1.0 Released

A new major version of Blocks has arrived! Blocks 1.1.0 includes the most-requested feature so far—support for native relationships. And in the spirit of the holiday season, there are a few extra stocking stuffers in there, too.


Blocks now fully supports Relationships! Whether you want to pull in a photo gallery entry, render a callout to another page, or some crazy idea I can't even imagine, you can now drop a Relationship into any block.


    Pull in an excerpt from another page
      <div class="callout">
        <img src="{rel:header_image:thumb}"
          <a href="{rel:page_url}">
        <p class="readmore">
          <a href="{rel:page_url}">
            Read More &raquo;

Context Variables

Blocks now has a few extra variables that can help you tailor your templates exactly how you need them.

The first couple you should be familiar with. Just like using Grid, {blocks:index} and {blocks:count} tell you which block you're currently rendering (0- and 1-based, respectively), and {blocks:total_blocks} tells you how many blocks will be rendered.

Sometimes you're concerned with how many of a certain type of block you've rendered. Maybe you want to make the first image of your article larger than the later ones, or the last content block needs some special formatting. For that, there's {blocks:index:of:type}, {blocks:count:of:type}, and {blocks:total_blocks:of:type}.

The last set of context variables let you know which blocks are around the current block. Maybe you want to include special markup when two captioned images come consecutively. {blocks:previous:shortname} and {blocks:next:shortname} will return the types of the previous and next blocks, so your content can adapt accordingly.

And more

Check out the full changelog to see the complete list of changes are included in 1.1.0.