Step 7: Setting Up the “Related Events” Block

Now that I have the host info block set up, it’s easy enough to create a “related events” view and place the block it creates. The process was remarkably similar to what I did with the host information, with the following exceptions:

  • Instead of configuring our contextual filters by the node ID, we’re using the Taxonomy term, from the Event Categories vocabulary

  • Since this is just pulling fields from the Event content type, we don’t need to worry about relationships

Figure 12-30 shows how that contextual filter was set up.

Contextual Filter settings for our “Related Events” view

Figure 12-30. Contextual Filter settings for our “Related Events” view

Now, if I go back to my Blocks administration screen (Structure→Blocks) and enable the Related Events block using the same configuration as I did with the About the Host block, I should see a selection of related workshops available for theming (see Figure 12-31).

From here, it’s easy to start theming this whole thing so it looks a bit closer to our design. After a bit of CSS love, and a bit of Drupal tweaking, here’s our updated page in Figure 12-32.

Oh, look! There’s also a Sausage Sunday happening. Neat!

Figure 12-31. Oh, look! There’s also a Sausage Sunday happening. Neat!

Our Event page, with theming applied. Isn’t that better?

Figure 12-32. Our ...

Get Design and Prototyping for Drupal now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.