Drupal: Add node content into block depending on page ID

/ Published in: PHP
Save to your folder(s)

Fairly simple way to match sidebar content with the main content for several pages without the need to create multiple blocks or the hassle of putting content in a block.

For example, your Home, About and Contact pages all have a sidebar with some accompanying content which is different for each.

1. Create pages (nodes) for each of the sidebar content and note the node ID.
2. Add a block and paste in this code snippet
3. Edit the Switch/Case part of this snippet for your nodes
4. Enable the block for content/* and node/*

URL: http://drupal.org/node/273665

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.