I have a private website in which content can only be viewed by authenticated users. All I want is the login box for non authenticated users. I am using NodeAccess and also Rules module to do this. Seems to work fine with one exception. The pages which should only be visible after login show their links to the anonymous user on the Bartik theme main menu right on the home page. All menu items appear including those for pages specifically limited to administrator viewing. True, clicking on them merely brings up the login dialog box so the individual can't see the page, however, I don't want the menu itself to appear at all until the person is authenticated. How do I make the entire menu disappear if unautenticated? Thanks in advance.
The main menu in Bartik theme is being output directly (you can see it in 'themes/bartik/templates/page.tpl.php' - starts with
<?php if ($main_menu): ?>). In order to hide the menu from anonymous users you could do the following:
<?php if ($logged_in): ?> <?php if ($main_menu): ?> // Code that prints the menu. <?php endif; ?> <?php endif; ?>
Modifying core should be avoided though so the proper way to handle this would be to create a copy of the theme inside the 'sites/all/themes' folder with a different name. Then renaming necessary files, modifying the code and making your site use that theme instead of the core Bartik.