Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By md5hash on
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
You should use the l()
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:or something like that.
Thank you John!
Thank you John!