Hey,

I'm trying to specifically *only* over-ride the rendering of secondary links in my template file. I've read the following: http://drupal.org/node/168353
and have similarly taken the theme_links function from theme.inc and dumped it into my template.php file as phptemplate_links.

Neither method at the above posted link appears to work for me in Drupal 6.x though and unfortunately (I might just be unaware how?) I don't think I can detect inside the phptemplate_links function whether it is the secondary links being rendered or not?

Any advice would be greatly appreciated!

Comments

yuriy.babenko’s picture

I did exactly this a few days ago (Drupal 6.2).

In template.php (theme folder), throw in:

function phptemplate_menu_item_link($link)
{
	if (empty($link['localized_options']))
	{
		$link['localized_options'] = array();
	}

	if($link['menu_name'] == 'secondary-links' && $link['depth'] == 1)
	{
		if($link['href'] == '<front>')
		{
			$link['href'] = '';
		}
	
		$output  = '<a href="'.base_path().$link['href'].'" title="'.$link['title'].'">';
		$output .= 		'<span class="left">'.$link['title'].'</span>';
		$output .=		'<span class="right">&nbsp;</span>';
		$output .= '</a>';
	
		return $output;
	}
	else
	{
  		return l($link['title'], $link['href'], $link['localized_options']);
  	} 	
}

(This adds a few span classes for the top-level links in the secondary navigation.)

Modify as you see fit :).

If you need to modify the wrapping <li>, you can use phptemplate_menu_item().
---
Yuriy Babenko
www.yubastudios.com
My Drupal tutorials: http://yubastudios.com/blog/tag/tutorials

---
Yuriy Babenko | Technical Consultant & Senior Developer
http://yuriybabenko.com