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 default search feature (Google Custom Search can see this content)—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 you use your block defines how it's characterized
Where do you find Global blocks?
The Global 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. While not enabled by default, Global blocks can be used in Layout Builder, though it must be configured to do so by a Site Manager.
Read more about creating your own custom blocks.
Where do you find In-line blocks?
In-line blocks only exist on the pages where they have been placed. To interact with them, you need to navigate to the specific page, click its Layout tab to enter the Layout Builder interface, and then use the block's pen icon to edit its Style settings or Configuration.
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 through the Block Layout page (accessible through Shortcuts » Blocks or the interim Place block link), or the + Add block option in Layout Builder. 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 Global block on a single page
- Take note of the target page's URL pathway, then navigate to Shortcuts » Blocks to get to the Block Layout screen.
- Scroll down to the region where you would like to add the block to your page and click its corresponding Place Block button.
- Use the dialog window to filter for your block by name or scroll through the list to locate your block. Click its Place Block button.
- Complete the block's Configuration options, including adding the target page's URL pathway to the Visibility | Pages field.
- Click the Save Block button to finish, then return to your target page to verify the block appears correctly.
Placing a Global 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:
- Navigate to the Block Layout page.
- Locate the region where you want your block to display and click its Place Block button.
- Filter for your block by name in the dialogue box or scroll through the list to locate your block.
- Click the Save Block button.
- Locate your newly placed block in the selected region and click on its Configure button.
- 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/*
- List each page by URL alias, each on its own line. Example:
Placing and reusing In-line blocks
Due to the unique nature of Layout Builder's system, we recommend reading through its documentation in whole to understand how system and custom blocks :
- Layout Builder Orientation
- Template Library
- In-line versus Global Blocks
- In-line Block Configuration
- Layout Section Configuration
Editing a block's Configuration versus editing a block's Content
Once a block has been placed, three options are available to you:
- 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.
- 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.
- 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 Global blocks on your site while In-line blocks are unlimited. If you exceed the Global block 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.