Sidebar

startup_tutorial_and_checklist:design_configuration:smarty_template_code_extensions:hide_or_show_when_lgged_out

Hiding/Exposing Something Based on Logged In/Out Status

There is a hide field feature in the software that will allow you to choose which fields display to logged out users within the listing details page. The smarty extension described here allows you to do something similar for other pages on the site.

We use some code similar to this within the default design but will isolate it here:

				{if not $logged_in}
					{*Logged out code*}
					You are logged out
				{else}
					{*Logged in code*}
					You are logged in
				{/if}

Conversely you can only display something when a user is logged in using this:

				{if $logged_in}
					{*Logged in code*}
					You are logged in
				{/if}

Or just when they are logged out:

				{if not $logged_in}
					{*Logged in code*}
					You are logged out
				{/if}

The above is Smarty code using the "$logged_in" variable we make available in every page of the system

startup_tutorial_and_checklist/design_configuration/smarty_template_code_extensions/hide_or_show_when_lgged_out.txt · Last modified: 2014/09/25 16:55 (external edit)