Hi,
I've run into a snag I can't figure out:
Running Drupal 4.7, I want a header menu with four links for anonymous users: login, register, tour and help. For logged in users the menu should only show log out and help. The menu is built using a list.
I tried the PHP snipped "Display different page content to anonymous and authenticated users": http://drupal.org/node/23449 hardcoded into the pages.tpl.php template and that only resulted in a completely blank page. It might be that the PHP snippet and list tags doesn't play nice together, but I need to use lists inside the snippet since it otherwise has no function.
I also tried to put the list with the PHP in a header block and enabled it.
<div id="toplinks">
<?php
global $user;
if ($user->uid) {
return " <ul>
<li><a href="#">logout</li>
<li><a href="#">help</a></li>
</ul>";
}
if (!$user->uid) {
return "
<ul>
<li><a href="#">login</li>
<li><a href="#">tour</a></li>
<li><a href="#">register</a></li>
<li><a href="#">help</a></li>
</ul>
";
}
?>
</div>
But nothing happend. (And the block WAS enabled). I'm running a mod off the Friends Electric theme.
I also looked (but didn't try) the Custom login, http://drupal.org/node/17272, but even if that solves the log in / logout part, it doesn't solve the states of the other links.