How To Use Blocks And Custom Blocks In Drupal 8 | 8 Days To Drupal 8 | Day 2

Block Administration And Placement In Drupal 8

Same as in Drupal 7, Drupal 8 blocks are placed in regions from the blocks administration page, which is located at Structure > Block layout. A notable improvement in Drupal 8 is that you can now place the same block in different regions. For example: previously it was impossible to put a block in the sidebar on the blog section of your website and at the top of the masthead in another section of your website.

When placing a block in Drupal 8 you're offered block visibility settings that are familiar to people who have experience with Drupal 7. You limit visibility based on content type, paths, and user roles. Third party modules can extend this in Drupal 8, in the video below you see that the Webform module lets you place blocks whenever specific webfoms are showing.

Custom Content Blocks In Drupal 8

To those familiar with Drupal 7: Drupal 8 lets you make new blocks and enter custom text or HTML. Except it's better. In the old system custom blocks were neutered content, without support for revisions, permissions, or custom block types.

In Drupal 8 blocks are proper first class citizens and support revisioning and custom block types. Basically Drupal 8 does with blocks what we did with the BEAN module in our Drupal 7 theme installation profiles. That's one less contrib module you'll need in Drupal 8! In our Drupal themes' demo installation profiles we offer "Basic Blocks" and "Drag and drop blocks" The latter option will let you design blocks with our front-end visual page builder.

Placing Blocks With Our Visual Page Builder Glazed Builder

Glazed Builder lets you place any Drupal block with our visual drag and drop module. The only blocks that will be missing from the blocks tab are views blocks. This is because we treat all views displays equally and put them under the Views tab. Here you will find every single views display, including Master displays. Moreover we allow you to override some useful views parameters, like pager settings, pager offset, exposed filters, and contextual filters. This is very powerful and you can use Glazed Builder to make news portal layouts, magazine layouts, and even personalized user dashboards.

Creating A Footer Block In Drupal 8

I made a little video showing the complete process of creating a footer block in Drupal 8, you probably already found it at the top of this page. We start by adding a simple Copyright notice block using Drupal's native CKEditor. Then we show how you can build a 3 column footer easily with our frontend visual page builder. With Glazed Builder you can add any Drupal blocks and views in the footer, as well as all the standard drag and drop elements, and the extendable suite of HTML snippets in the Glazed Builder sidebar. If you add a drag and drop block to any region in your theme, you can view, edit, and save the block on any page where the blocks shows. It's very convenient and easy to get used to. Glazed Builder handles multiple blocks per page, automatically saves new revisions, and is also language aware.