How Can We Help?
< All Topics

Incorporating a Block Display into a View in Drupal: A Step-by-Step Tutorial

a) How do I add block display to a view in Drupal ?

1. First, navigate to Structure and select Views (Admin/Structure/Views) in the Manage administrative menu. Find the Recipes view and click Edit from its drop-down button. Alternatively, click the Edit View link on the Recipes page.

2. Then, click Add under Display and select Block from the list of links to create a new block display. The new display is created, and focus automatically switches to its configuration.


3. After that, click Block in the Display Name field to change the title and description of a display popup, change the admin name to “Recent Recipes,” and click Apply.

4. Next, click Recipe in the Title field under Title to change the title of the block; select “This block (override)” from the “For selectlist; change the title field to “New Recipes“; and click Apply.


5. Then, click Grid in the Format field under Format to change the style of a block. In a popup, select “This block (override)” from the “For selectlist, select the unformatted list, and click Apply. Configure style options in a subsequent pop-up window and click Apply.

6. After that, click on Content: Main Image under Fields to configure the image field, select “This block (override)” from the “For selectlist, choose thumbnail (100×100) image style, and click Apply.


7. Next, click on Content under Filter: Ingredients (Public) and select “This block (override)” from the “For selectlist to remove ingredients as a filter. Click delete at the bottom.

8. Then, click Add from the drop-down button under Sort criteria to sort content in a view. In the popup, select “This block (override)” from the “For select” list, check Authors in the Content category, and click Add and configure sorting criteria.

9. After that, select Sort Descending to prioritize the newest recipes in the configuration popup and click Apply.

10. Next, click on “Mini” in the “Use pager” field to display a specific number of items in a pager, select “This Block (Override)” from the “For Selectionlist, select “Show a specified number of items” under Pager, and then provide “5” as the item value in the Block: Pager Options popup. Click Apply.

11. Then, click “Save” to return to the view edit page or recipe page, depending on your previous steps, and receive a message confirming the view’s saving.


12. Finally, position the “Recipes: Recent Recipes” block in the second sidebar area and navigate to the site’s home page to view it.


Table of Contents