Conditional display of a block
So far in this chapter we have dealt with creating and positioning blocks. By default, blocks are set to display on every page, but in this recipe we will see how to configure the pre-existing Who's new block so that it displays only on the homepage, and only for logged in users.
How to do it...
- Select Structure from the admin menu, then select Blocks.
- Find the Who's new block and select configure.
- Under the Pages tab, select Only the listed pages.
- In the text field enter<front>.
- Select the Roles tab.
- Check authenticated user, and administrator.
- Select Save block.
How it works...
The block has now been configured so that it ...