Understanding blocks

What is a block?

A block is a reusable, self-contained piece of content that you can create, configure, and add to pages site-wide or in limited, specific locations. 

The reason blocks can be reused in many places unlike some of the other objects you might add to pages, like images or files, is that a block has been created as an entity. Drupal defines entities as "an object that has a unique and separate existence." In this case, blocks are unique and separate unto themselves, much like your content types (article, basic page, etc) and can be referenced at will throughout your site.

What should you use blocks for?

Given that block content is invisible to the search feature—it looks for content in the Main Content region—you'll want to think carefully about how you use your blocks and what information they should convey. Something vital like contact information? You're better off putting that in the Main Content region or as part of a page title so the search feature will find it. Adjunct, peripheral information that leads visitors to additional information and content is ideal. Ideally, the block won't be the targeted destination but rather a conduit to a fuller explanation of the desired information.

Where do you find blocks?

The blocks available to you can be found from the admin panel, either through your shortcut called Blocks or through Structure » Block layout. This is the main page block layout page, and from that section, you'll be able to work with system blocks already included in SiteFarm or create your own custom blocks using the pre-programmed and styled offerings designed by the SiteFarm team, but containing your own content and images.

Read more about creating your own custom blocks.

Where can you put your blocks?

Each block will contain options that allow you to specific placement is defined by and limited to the master layout's Block Regions, which are based on the design of the SiteFarm theme template. 

Read more about block regions.

How do you attach your blocks?

You will attach your blocks to your preferred location in a couple of different ways; either the in-screen Place block method, which reveals the block regions on the page or through Block Layout page. Each block you create can be configured and designed, then assigned to a region. You can also define which pages will display your block. The block can also be assigned to more than one region.

Placing a Block on a single page
  1. Navigate to the page where you want to place the block and click on the Place Block button in the upper right corner of your screen in the Admin panel.
  2. Use the + button to select your preferred region, then filter for your block by name or scroll through the list to locate your menu block.
  3. Click the Save Block button.
Placing a Block in the same region on many pages sharing the exact same content

Because your site can only handle so many blocks, it's important that you consolidate your blocks whenever you can. Adding a block to a list of pages one by one would result in the creation of multiple instances of the block when, in fact, you only want the one block to be shared by many pages. This is the most efficient process for doing so:

  1. Navigate to the Block Layout page.
  2. Locate the region where you want your block to display and click its Place Block button.
  3. Filter for your block by name in the dialogue box or scroll through the list to locate your block.
  4. Click the Save Block button.
  5. Locate your newly placed block in the selected region and click on its Configure button.
  6. Use the block's Visibility | Pages section to list the pages that should all display this block in the chosen region. You have these options:
    • List each page by pathway, each on its own line. Example:
    • Select entire sections of your site based on how you've structured your URL Path Settings. All content under a parent page will be denoted by the page name followed by '/*'. Example:

How many blocks can you use?

Your site is capable of processing about 185-200 blocks on your site. If you exceed this processing limit, you'll notice the Block Layout screen or your page won't be able to place new blocks in the list or on the page, and you'll no longer be able to rearrange the order of your blocks. Review your blocks to see what information might be better added to the Main Content area or if you're using the same block on multiple pages that can be combined.


More Information

Read more about attaching blocks to your layout, understanding block visibility (the process of determining what pages will display your block), and the two ways you can reuse your blocks.