By Natalie-1-1 on
Hello Everyone,
I have installed Drupal, got my themes working, and added some content, but now I want to display a different default starting page for my Anonymous Users than for users that are already logged in.
How do I do the following default pages based on whether or not a user is authenticated?:
Anonymous Users:
Welcome to the Alpha site - please login with your credentials to enter the site.
The Alpha site is available by invite only, please email us at: email@domain.com to get access to this site.
Authenticated Users:
Welcome to the Alpha site - introduction page.
Thanks,
Natalie
Comments
Two steps
First, put this in the template.php file in your theme:
That will add $logged_in to the variables available to your page.tpl.php file. Empty the database cache to activate that.
Then add a snippet to the top of page.tpl.php (and page-front.tpl.php if you have one, and any other page.tpl files you have):
Substitute the appropriate absolute URLs for WelcomeURL and IntroURL.
Thanks for the tips... This
Thanks for the tips... This seemed to work well.
I used your code snippets above to prevent my banner images from appearing for non-authenticated users.
I ended up going with the "Advanced Front Page" module which allows you to have different administrable content on your front page for authenticated and non-authenticated users.
Thanks,
Natalie