Blocks are pieces of your site’s web page layout. They are placed inside the regions of your theme, and can be created, removed, and rearranged in the Block layout (admin/structure/block) administration page. Examples of blocks include the Who’s online listing, the main navigation menu, and the breadcrumb trail. The main page content is also a block.
Some modules make new blocks available for placement on your site. For example, when the core Search module is installed and configured, it provides a block that contains a search form. You may also create and place your own custom blocks.
Each block has its own configuration settings, which allow you to select which pages of your site will display the block. It’s even possible to place multiple copies of a block, each with its own separate configuration and visibility rules.
On the Admin menu hover over Structure then click on Block layout.
The block admin page shows you the blocks on your site and where they’re displayed. In the default GovCMS (Olivero) theme, the main navigation, user account menu and site branding blocks are spread across various regions.
You can change the order of the blocks displaying by using the four-way arrow icons and dragging and dropping the blocks up or down. Once you’re happy with the position, scroll to the bottom of the page and click the Save blocks button.
Depending on what modules you have installed, various new blocks become available for activation in any of the site regions. You may explore available blocks by clicking the “Place block” button in the desired region:
Many websites contain a welcome message on the homepage. In this exercise you’ll learn how to place a block of content into a page and manage block visibility settings. You will also learn how blocks are placed into page regions.
The screenshot below displays some blocks being placed in various footer regions. You will build a similar block in this exercise.
Navigate to Structure → Block layout → Add custom block (/block/add).
Select "Basic text with Image". Note, the options you see here will depend on the theme that your site is using and will most likely differ on your agency website.
Fill out the form:
Block description: “Welcome to Government Jobs Portal”.
Body: “Government Jobs Portal is the official site to search and apply for jobs in the federal or state government. Be part of the bigger picture.”
Click the Save button.
Navigate to Structure → Block layout and locate the "Footer top 1" region. Click the Place block button next to the Footer top 1 region name.
Locate the block you created, by searching for its name “Welcome to Government Jobs Portal”.
Next, you’ll need to assign the block to an area on the site.
Scroll down to the Region select element. Select Footer Top.
Finally, configure the block’s Visibility settings so the Welcome Message block only appears on the homepage.
Under the Pages section of the visibility settings.
Select the Show for the listed pages radio button.
Following the screenshot below, enter the text <front> in the Pages field. This will make sure the block is only displayed on the front (home) page of your site. Leave the other settings as-is.
Save the block.
After the page is saved, you’ll be redirected to the Block Layout page. If you have multiple blocks assigned to the same region (such as Footer top 1), these can be rearranged on that page. Press the Save blocks button.
Now go to the homepage of your site and view your new welcome message/block in the footer.
Tip: Blocks aren’t content so they won’t be displayed in the content listing. To view all custom blocks go to Structure → Block layout → Custom block library .