Renders the specified list of content blocks one after another, while
also fetching them in a single database query, instead of incurring
multiple calls to the database for multiple blocks. Use this in layout
templates like this:
Or you can specify a wildcard and it will fetch all blocks that match,
sorted by ID ascending:
{! blocks/group?wildcard=page-* !}
This can be combined with the page ID and the rows parameter to create a
series of editable divs on a page, like this:
{! blocks/group?wildcard=[id]-*&rows=on !}
The above tag would fetch any blocks beginning with the current page ID
followed by a hyphen - and anything else (numbers, text), and wrap them
in divs like this:
Additionally, you can set a divs parameter to specify that each block
should be wrapped in a <div class="block" id="block-ID"></div> tag,
where the id attribute's value is the block ID prefixed with block-:
Renders the specified list of content blocks one after another, while also fetching them in a single database query, instead of incurring multiple calls to the database for multiple blocks. Use this in layout templates like this:
Or on several lines like this:
Or you can specify a wildcard and it will fetch all blocks that match, sorted by ID ascending:
This can be combined with the page ID and the rows parameter to create a series of editable divs on a page, like this:
The above tag would fetch any blocks beginning with the current page ID followed by a hyphen
-
and anything else (numbers, text), and wrap them in divs like this:You can also set a
level
parameter to specify which heading level to use for the block titles:Additionally, you can set a
divs
parameter to specify that each block should be wrapped in a<div class="block" id="block-ID"></div>
tag, where theid
attribute's value is the block ID prefixed withblock-
:This will output:
In this way, blocks can easily be styled collectively or individually, making them a powerful way to build site content.
You can also specify a
units
parameter, which specifies the width of eachdiv
as ane-col-%d
class, for example:This will output:
The use of units will automatically include the
admin/util/minimal-grid
helper, which provides a very minimal responsive grid system for page content.