Sidebar

tutorials:design_adv:examples:display_different_html_if_logged_in_out

How Do I Display Something When Logged In and Something Else When Logged Out?

This is pretty easy and there's already an example of it a few places within the default design. Use the following Smarty code:

	{if not $logged_in}
		{*Logged out code*}
		<!-- any html/smarty code you want to display when logged IN to your Geo software -->
             You are logged in
	{else}
		{*Logged in code*}
		<!-- any html/smarty code you want to display when logged OUT your Geo software -->
             You are logged out
	{/if}

You can choose to display something only when logged in or only when logged out and do nothing with the "other side". Many want a login form within specific templates but don't want to display a login form when you are already logged into the site. This helps with that and many other things to fit your needs.

tutorials/design_adv/examples/display_different_html_if_logged_in_out.txt · Last modified: 2014/09/25 16:55 (external edit)