0

I'm trying to get my secondary links (which are using primary links as the source, so the children of the primary links) to display as a dropdown on every page. However, since (im guessing) there is no active trail on the front page, the secondary links aren't displayed.

How do I set them so that I can display the secondary links on the front page?

duobuddy
  • 23
  • 2
  • 7

3 Answers3

1

If you want to display secondary links only on frontpage, don't forget to add an if statement such as:

if ($is_front) {
    print theme('links',$secondary_links,array('class' => 'class-for-secondary-links'));
}

Or just use custom template for frontpage.

Oleksandr Skrypnyk
  • 2,762
  • 1
  • 20
  • 25
  • That would probably be my preferred approach -- I assume you're talking about modifying the page template page.tpl.php? Menu Block module would probably work (Matt V's answer) but I feel installing a custom module for a piece of functionality you'll use in just one place is an inefficient solution that complicates your site. – CJBrew Nov 16 '10 at 14:55
  • Put it just where you want. If your main template file is page.tpl.php - put it there. – Oleksandr Skrypnyk Nov 22 '10 at 15:27
0

You can use the "theme" function to display the secondary links into your front page:

 print theme('links', $secondary_links, array('class' => 'links secondary-links'));

And to create the dropdown you can overwrite the "theme_links" function into your template.php file: http://api.drupal.org/api/function/theme_links

Hope it helps.

FR6
  • 3,157
  • 3
  • 24
  • 28
0

The Menu block module will do what you're describing and a whole lot more.

Matt V.
  • 9,703
  • 10
  • 35
  • 56