Question

On every page of his new site, the client would like a block with four featured links. This will be fairly consistent throughout the site, but on some pages he'd like to override and display four links of his own choosing.

I'm thinking of using Views and/or Nodequeue for the block, but I am not sure how to provide a default that can be easily changed for some nodes? Is there a better way?

Was it helpful?

Solution

I would create a custom module for this, sounds like it could be done quite easily.

  1. Create an admin interface where the 4 default links can be entered.
  2. Create fields on nodes, where the special links can be entered.
  3. In the block view, try to load the node, if possible check for custom links and use default links if needed.

The above solution is good and flexible if you only want links.

If you instead want node references, with the posibility of getting more data, like an image, taxonomy term etc, nodequeue could come in handy instead, as you with views can setup a more sophisticated display easily. It would however become a bit more tricky to override, but could be done via preprocess functions or hook_views_query_alter.

OTHER TIPS

Check out the context module: http://drupal.org/project/context

or just edit the block from the blocks page, there is the visibility section where you can specify what paths to show it or what paths not to.

When you make a menu it automatically makes and associated block. So basically make the menus, and set the block visibility according to path or use context.

Licensed under: CC-BY-SA with attribution
Not affiliated with drupal.stackexchange
scroll top