Tokens are small bits of code that let you integrate LightCMS's dynamic content management functionality with your website designs.  This section provides detailed information about our tokens and how to utilize them.

Login Status

Token
<$loginstatus$>
    <$loggedin$>content<$/loggedin$>
    <$loggedout$>content<$/loggedout$>
<$/loginstatus$>
Purpose This token inserts custom, personalized HTML content into the markup based on the login status of the current user.
Special notes
  • You do not have to specify both the loggedin state and the loggedout state. If you leave one state off, nothing will be displayed in that state.
  • You can utilize content variables (see below) in the loggedin state to personalize content for the logged in user.
  • You can insert any amount of HTML content into these states.
  • You cannot use other tokens inside the content areas of this token.
Content variables
The following variables can be inserted between the <$loggedin$> and <$/loggedin$> to provide personalized content to the logged in user.
  • [first] - inserts the first name of the logged in user
  • [last] - inserts the last name of the logged in user
  • [name] - inserts the full name of the logged in user
  • [username] - inserts the username / email address of the logged in user
  • [picture] - inserts the users gravatar or uploaded image
  • [editprofileurl] - inserts a link the user can click to edit his or her profile
  • [logouturl] - inserts a link the user can click to logout
  The following variables can be inserted between the <$loggedout$> and </loggedout$> to provide content.
  • [loginurl] insert 
Example Usage
Use this token to create a customized welcome message to logged in users and a link to login for those who aren't yet logged in:

<$loginstatus$>
   <$loggedin$>
      <ul class='loginToken'>
           <li>[picture] [name]
                <ul>
                       <li><a href='[editprofileurl]'>Edit Profile</a></li>
                       <li><a href='[logouturl]'>Sign out</a></li>
                </ul>
            </li>
      </ul>
   <$/loggedin$>
   <$loggedout$><p>You aren't logged in. <a href='[loginurl]'>Log in</a>.</p><$/loggedout$>
<$/loginstatus$>
 

The class for the containing <ul> enables you to have full styling control of the login token. Replace the default loginToken class with your own class to customize the style of the login token.