O'Reilly logo

Drupal 7 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

Customizing the appearance of a specific node

In a similar vein to the previous recipe, we will be looking at using the Drupal theme system's naming scheme to customize specific pieces of content. While the previous recipe targeted nodes of a particular node type, here we are going to target a single node based on its node ID.

The customization we will be performing on the node in question is that it should only display its content and links to authenticated users. In other words, anonymous users will only be able to see its title.

Getting ready

As we are going to be targeting a particular node based on its node ID, we will need to obtain this number from the node in question. This can be discerned from the URL of the node which should, by default, ...

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