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 URL alias, each on its own line. Example:
      /news/ucdavis-news-today
      /news/putah-creek-development
      /blog/helpful-hints
      <front>
    • Select entire sections of your site based on how you've structured your URL Alias. All content under a parent page will be denoted by the page name followed by '/*'. Example:
      /news
      /news/*

Editing a block's Configuration versus editing a block's Content

Once a block has been placed, three options are available to you:

  1. Re-configure the block. This concerns the physical aspects of a block; its placement in a region, branding, title display, and other configuration settings that affect what information and how much of it displays on the screen. You have two means of re-configuring your block:
    • Block Layout page. Using the block's corresponding Configure button will grant you access to the configuration settings.
    • Contextual block menu. Hover your mouse over the block on a given page and look in its upper right corner. A round circle with a pen will appear. Clicking on the circle will provide you with a submenu of the following choices: Quick Edit, Configure, and Edit. Use Configure to change the block's physical settings.
  2. Edit the block's content. Editing the content will make up the majority of the interactions you have with your block. You can edit a block's content via two different routes:
    • Block Layout » Custom block library page. Click on the block's corresponding Edit button to access and edit the content.
    • Contextual block menu. Hover your mouse over the block on a given page and look in its upper right corner. A round circle with a pen will appear. Clicking on the circle will provide you with a submenu of the following choices: Quick Edit, Configure, and Edit. Use Quick Edit to open an on-screen editing option for quick access, or use Edit for the fuller, default editing view.
  3. Delete or disable the block.
    • Delete: If the block is used in only one location, you can use the contextual menu to select Edit, then click the Delete link at the bottom of the block screen. If the block is used in multiple locations, you can go the Block Layout page, locate the Configure button, select Remove from its drop-down menu.
    • Disable: Navigate to the Block Layout page, locate the Configure button, and select Disable from the drop-down menu. The block will be moved into the Header region, but with the text "(disabled)" next to the block title to indicate its status. You can re-enable the block at any time using the Configure button's drop-down menu and selecting Enable from the list of options.

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.