Block visibility

Each of your blocks, whether your own custom blocks or those that are part of the system, by default will display on all of your pages. Obviously, this is not always the ideal behavior. 

Through the Block Layout screen, under the Operations column, you have access to a Configuration button where you set the conditions that determine where your blocks are displayed.

Locating the Block Visibility Settings

  1. Using your admin panel, navigate to Manage » Structure » Block Layouts, OR Shortcuts » Blocks OR use your block's contextual menu, located in the block's upper right corner represented by a pen icon. Click on the pen icon to access the menu, and select the Configure block option.
  2. Locate the block you want to edit from the list and click on its corresponding Configure button on the right side, under the Operations column.
  3. From the list of options available, only the following can be configured:
    1. Pages (not restricted)
    2. Content type (not restricted)
    3. Roles (not restricted)
      Block visibility options allowing you to list pages that will be display or hide a block.
  4. Set your configuration options and then scroll to the bottom of the screen and click Save block to finish.

Setting Visibility

  • Pages - You can set visibility on an even more granular level in the Pages section. You can list a single page, several pages, all pages sharing a particular path, use wildcards (*) to indicate all in a section or only the front page. Enter ONE page per line. You can show the block on the listed page(s) or show the block on everything except the listed page(s). Examples:
    • single page: /about-us
    • multiple pages:
      • /about-us
        /contact
        /news
        /staff
    • all pages in a path: /news/*
    • just on your homepage: <front>
  • Content types - By default, your block will appear on all pages if this is left unconfigured. Using this option will restrict your block to a certain content type. Example, the block will only appear on content made using the Event content type.
  • Roles - restrict visibility access by role. If a block should now be visible to a certain group, you can hide it by role.