Control what content is shown when a user is logged in/out
22-Feb-2012 by Carol Lemke
Why would you want to do this?
Below are a few examples of why choosing to hide/show specific content when a user is logged in/out would improve the user experience on a site.
Navigation: There is a specific public navigation and a specific member navigation that should show. Perhaps the public navigation would read, "Create an Account | Login" and the member navigation would read, "My Account | Signout" and
Advertise: If a user is not logged in, you may want to have an advertisement throughout the site that directs people on how to register with your site. Once that person finally registers and logs in, you would want to replace that ad with more member relevant content.
eCommerce: A person is only able to add to their wish list when they are logged in. If they click Add to Wish List when they are logged out, they will be directed to the log in screen. To make this experience a bit more user friendly, you could hide that Add to Wish List link and show some text when a user is logged out to say, "To add to your wishlist, please login". Then once logged in, they will be able to use the functionality of Add to Wish List correctly.
The Code
Place before the closing </head> in a <script>
Comments
Tweet
Share
About the Author
Carol Lemke
Designer, BC Gurus / HotPress Web
Carol is a recent graduate of the University of Minnesota and a fresh Denver transplant from Minneapolis. With a strong background in graphic and web design she has a promising future as a HotPress Web team.
articles by this author