The Web Developer's Blog has been discontinued. I am now maintaining a new blog that is related to my company, Blue Piccadilly. The most popular articles from this blog (by monthly page views) have already been republished on the new blog, and indeed those original pages on this blog are being redirected to their new location. I'll probably keep these pages up here for a while. At least until the domain expires.

Showing the nested sub-navigation of the active primary link

23-Oct-2008
Filed under: Drupal, Drupal 5.x

This seems obvious, yet every time I start a new Drupal project I spend at least 10 minutes looking at older projects trying to find the solution.

I'm talking about getting Drupal to show the sub-navigation of a primary link when that primary link is active.

The solution is so simple it invariably leads to a facepalm: Instead of using the provided $primary_links variable in your template, enable the primary links block on the block configuration page.

Why can't I remember this?

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <i> <b> <cite> <code> <a>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.