Code: Select all
{content assign='thiscontent'}
{if $ccuser->loggedin() && $ccuser->memberof('Members')}
<!-- Show Member Content Here -->
{$thiscontent}
{else}
{cms_module module='FrontEndUsers' returnto=$page_alias}
{/if}
But in some cases, such as a page that is intended to be viewed by both the unsigned in public and members, there is not room to do that, so a sign-in button that returns you to the original page when you're finished can be handy.
First create a page called sign-in and put this in your page content:
Code: Select all
{* This sign in page will return the user to the
page alias in the $smarty.get.returnto *}
{if $smarty.get.returnto}
{cms_module module='FrontEndUsers' returnto=$smarty.get.returnto}
{else}
{cms_module module='FrontEndUsers' returnto='home'}
{/if}
Code: Select all
{* GCB sign_in_button *}
{* This will make a button that will send the user to a sign in page that
will return the user to this page when finished. *}
<a href="http://yourdomain.com/index.php?page=sign-in&returnto={$page_alias}">Sign In</a>
Code: Select all
{if $ccuser->loggedin() && $ccuser->memberof('Members')}
{cms_selflink page='tournament-registration' text='Sign Up'}
{else}
{global_content name='sign_in_button'}
{/if}