9.5. Adding a Block Display to a View
Add a block display to the Recipes view to display the most recent recipes in a sidebar, and change its configuration without changing the existing Recipes page view.
- The Recipe content type must exist, it must have a Main image field, and your site must have a couple of Recipe content items. See 第 6.1 节 “Adding a Content Type”, 第 6.3 节 “Adding Basic Fields to a Content Type”, 第 6.9 节 “Changing Content Entry Forms”, and 第 5.2 节 “Creating a Content Item”.
- The Thumbnail (100x100) image style must be defined. This is created on your site when you install the core Image module (installed with the core Standard installation profile) but can be recreated if deleted. See 第 6.13 节 “Setting Up an Image Style”.
- The Recipes view must exist. See 第 9.3 节 “Creating a Content List View” and 第 9.4 节 “Duplicating a View”.
- In the Manage administrative menu, navigate to Structure > Views (admin/structure/views). Find the view "Recipes" and click Edit from its dropdown button. Alternatively, navigate to the Recipes page in the main site navigation, and click the Edit view contextual link in the main area of the page. See 第 4.1 节 “Concept: Administrative Overview” for information about contextual links.
Create a new block display by clicking Add in the Displays section. Click Block from the dropdown button. The new display is created, and the focus is automatically switched to its configuration.

- Change the title of this display by clicking Block next to Display name. The Block: The name and the description of this display pop-up appears. Change the Administrative name to "Recent recipes". Click Apply.
Change the title of the view by clicking Title: Recipes in the Title section. In the pop-up that appears, select This block (override) from the For select list. Change the title to "New recipes" and click Apply (this display).

- Change the view’s style by clicking Format: Grid in the Format section. In the pop-up that appears, select This block (override) from the For select list. Select Unformatted list and Click Apply (this display). You can further configure the style options in the next pop-up that appears. Then click Apply.
Configure the image field by clicking Content: Main image in the Fields section. In the pop-up that appears, select This block (override) from the For select list. Select Image style Thumbnail (100x100). Click Apply (this display).

- Remove ingredients as a filter by clicking Content: Ingredients (exposed) in the Filter criteria section. In the pop-up that appears, select This block (override) from the For select list. Click Remove at the bottom.
- Configure how you want the content to be sorted in the view by clicking Add in the Sort criteria section. In the pop-up that appears, select This block (override) from the For select list. Check the field Authored on (from Content category), and then Add and configure sort criteria.
- In the appearing configuration pop-up, select Sort descending to have the most recent recipes appear first. Click Apply.
- Specify the number of items to be displayed by clicking Use pager: Mini in the Pager section. In the pop-up that appears, select This block (override) from the For select list. Under Pager, select Display a specified number of items. Click Apply (this display). In the Block: Pager options pop-up, provide "5" as the value for Items to display. Click Apply.
Click Save. You will either see the view editing page again, or the Recipes page, depending on what you did in step 1. You should also see a message saying that the view has been saved.

Place the "Recipes: Recent Recipes" block in the Sidebar second region. See 第 8.3 节 “Placing a Block in a Region”. Navigate to the site’s home page to see the block.

Attributions
Written and edited by Laura Vass at Pronovix, Jennifer Hodgdon, and Jojy Alphonso at Red Crackle.
Source file: views-block.asciidoc
Help improve this page
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion