Hello

I themed my primary links and after I log into my admin account on the website I get link like '...node/3', '...node/5'. But they should be '...reseller', '...suppliers'. Btw after I look through link in admin, primary link direct to incorrect place, say 'node/node/3', 'node/node/5' etc. I don't know how I can fix that.

I get links this way

$mid = variable_get('menu_primary_menu', 0);
$menu = menu_get_menu();
$root_menu = $menu['items'][$mid];

and output link as

$output .= "<li><a href='".check_url($child['path'])."'".(is_array($child['children'])?" rel=\"dropmenu_$i\"":"")."><span>".$child['title']."</span></a></li>";

Comments

John Morahan’s picture

You should use the l() function to generate links from PHP. You can use the $attributes parameter to add the 'rel' attribute, and the $html parameter to avoid escaping the <span> tag:

$output .= "<li>".l("<span>".$child['title']."</span>", $child['path'], is_array($child['children'])? array('rel'=>"dropmenu_$i"):array(), NULL, NULL, FALSE, TRUE)."</li>";

or something like that.

md5hash’s picture

Thank you John!