Hiding Login, Logout, and Register Links
One of the great EE features is the robust site membership module. In order to allow site visitors to login, logout, or register with your site, you need to create links to those corresponding membership templates. The easy way is simply to create these links so they all show on your pages, like this:
<a href=”{path=member/login}”>Login</a><br />
<a href=”{path=member/register}”>Register</a><br />
But, since a logged-in user probably does not need to see a “Login” or “Register” link, and a logged-out user probably does not need to see a “Logout” link, I think it is a little more user-friendly to hide these “Login,” “Logout,” and “Register” links depending on whether a user is logged in or logged out. Here is how to do it.
Using EE’s nifty Conditional Global Variables, it is easy to create Login, Logout, and Register links that appear or disappear depending on whether someone is logged in or logged out.
<a href=”{path=logout}”>Logout</a><br />
{/if}
{if logged_out}
<a href=”{path=member/login}”>Login</a><br />
<a href=”{path=member/register}”>Register</a><br />
{/if}
I hope that this basic example demonstrates that there is a lot that you can do with these conditional variables.
The trackback URL for this entry is: Trackbacks are disabled for this entry
Trackbacks:
Comments:
Next entry: MT Gettysburg for EE
Previous entry: EE Template Contest
