Hi there,
I just started working on a theme for my Drupal website. I've a question about the HeaderMenu.
I want to add a "Login" link in the secondary-links of the Headermenu.
When you're already Logged in, the secondary link wont say "Login" anymore but something like "Profile"
I've been working on the page.tpl.php file for some time now and I came up with the following:
With the function bram_verzint_iets() I check if a user is logged in or not. If not I add the array("Login","path to login page",array("Login here")) to $secondary_links. (The array is filled in the same way as all array's in $secondary_links)
page.tpl.php:
if (isset($secondary_links)) :
$secondary_links[] = bram_verzint_iets();//my coding <----------
print theme('links', $secondary_links, array('class' => 'links secondary-links'))
endif;
template.php:
function bram_verzint_iets()
{
global $user;
$output='';
if(!$user->uid){
$output=array("Login","login",array("Ledenlogin"));//path to login node isnt right, still searching for right path.
}
else{
$output=array("Profiel","user/".$user->uid,array("Bekijk je profiel"));
}
return $output; //output is array format
}