Thus far in this chapter, we have looked at controlling block visibility based on the path of the page and the role of the user. In this recipe, we will look to configure a block to be displayed based on the node type of the content on the page.
We will be configuring the Recent comments block—which is provided by the Comment module—to only be visible for the
blog node types. While the
story type is enabled by default, the
blog type is created only upon enabling the Blog module from the module administration page at
admin/build/modules (Home | Administer | Site building | Modules).
It is assumed that both the Blog and Comment modules have been enabled, and sample nodes and associated ...