Not a developer? Go to MovableType.com

Documentation

IfLoggedIn

This template tag actually outputs two segments of HTML text. However only one of them will be rendered visible if the user is logged in. For example, suppose you want to show users that were logged in the text “Edit Your Profile” and users that were not logged in the text “Register Now!”. Then this is the template tag you would use:

<mt:IfLoggedIn script="show" id ="logged_in">
  <a href="<MTEditProfileLink>">Edit Profile</a>
<mt:Else>
  <a href="<MTRegisterLink>">Register Now!</a>
</mt:IfLoggedIn>

Arguments

  • element_id - the base DOM id of the element you wish to pass to the javascript callback identified by the script argument
  • script - the javascript function name you will invoke (see Javascript Callback)

Javascript Callback

One can optionally make a call to a javascript function and pass to it the logged-in state of the current user, along with an element id.

Here is an example javascript function you can call:

function show( isLoggedIn, domId ) {
  if (isLoggedIn) {
    show(domId);
  } else {
    show(domId + "_else");
  }
}
Back