Phone Now 01323 649779

Contact us now!

Phone 01323 649779, email us or fill out our online enquiry form.


Newsletter

Privacy | Unsubscribe

Login Dependent Content

SML allows you to vary the content shown depending on whether the user is logged in to the website.

Displaying Content For Logged In Users Only

Surround the content that you want to display to logged in users with the <ifloggedin> tag:

<ifloggedin>
<p>Only users who are logged in can see this!</p>
</ifloggedin>

Displaying Content For Logged Out Users Only

Surround the content that you want to display to logged out users with the <ifloggedout> tag:

<ifloggedout>
<p>Only users who are logged out can see this!</p>
</ifloggedout>

Mixing <ifloggedin> and <ifloggedout>

Mix <ifloggedin> and <ifloggedout> to give your users a better browsing experience. The next example shows how you can make it easier for all your users by giving them more relevant links.

<p>I don't care whether you're logged in or not!</p>

<ifloggedin>
<p>You are logged in, <a href="profile.php">update your profile!</a></p>
</ifloggedin>

<ifloggedout>
<p>You are not logged in, <a href="register.php">register now!</a></p>
</ifloggedout>

In this example:

  • All users see the first paragraph
  • Logged in users see the link to their profile
  • Logged out users are invited to register