O'Reilly logo

Drupal 6 Theming Cookbook by Karthik Kumar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Controlling block visibility based on node type

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.

Getting ready

We will be configuring the Recent comments block—which is provided by the Comment module—to only be visible for the story and 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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required