1

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?

  • 2
    it depends. Are these featured links derived from the DB or are they just arbitrary links? – user842 Apr 15 '11 at 16:25
  • Yes good point - they would be links to nodes within the site. – pushka Apr 16 '11 at 10:21
1

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.

0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.