MT Protect Template Tags

Here is a list of template tags provided by MT Protect

MTProtectInclude

<body>
    <MTProtectInclude>
    ...
</body>

This template tag must go at the top of every template and initializes the various protection methods. We recommend it goes below the <body> tag.

PostGreSQL and SQLite Users

If you use PostGreSQL or SQLite as your database, please create a new index template and enter the following into the template body

<?php echo phpinfo(); ?>

View the output of the template and check:

  • PostGreSQL users should see a module called pgsql installed
  • SQLite users should see a module called SQLite installed

If you don't have the required modules then you will need to use the MTProtectIncludeSlim tag instead and Password Protection will not be available to you. Please contact your host for information on how to install the necessary PHP modules.

MTEntryProtect

A container tag for entry protection. If an entry has been protected, the contents of this container will be hidden and the protection prompt (e.g. a form to enter the password or a link to login via Typekey/OpenID) will be displayed.

  • On your Individual Entry Archives add the opening MTEntryProtect tag just after you opening body tag and close it just before closing the body tag

    <body>
        <MTEntryProtect>
        ...
        </MTEntryProtect>
    </body>
  • In all other templates, this container should wrap the contents of your MTEntries container such that only the protection prompt is displayed if the entry is protected.

    <MTEntries>
        <MTEntryProtect>
        ...
        </MTEntryProtect>
    </MTEntries>

The MTEntryProtect container tag takes the following optional attributes:

  • password_text - When an entry is password protected, a message that explains its protected status along with a form is displayed. This attribute allows you to customize the message displayed. Default: This post is password protected. To view it please enter your password below

  • tk_signin_text - When an entry is Typekey protected, a message is displayed asking users to login. This attribute allows you to customize the message. Default: This entry has been Typekey protected so only selected Typekey users can read it.

  • tk_barred_text - This attribute allows you to customize the message that is displayed after a user has signed in on a Typekey protected entry but doesn't not have the permissions to view the contents of the entry. Default: You do not have the rights to access this entry. Sorry!

  • oi_signin_text - When an entry is OpenID protected, a message is displayed asking users to login. This attribute allows you to customize the message. Default: This entry has been OpenID protected so only selected OpenID users can read it.

  • oi_barred_text - This attribute allows you to customize the message that is displayed after a user has signed in on a OpenID protected entry but doesn't not have the permissions to view the contents of the entry. Default: You do not have the rights to access this entry. Sorry!

These attributes can be combined in an arbitrary way

<MTEntryProtect password_text="Entry Password Protected" tk_signin_text="Sign in with TK" tk_barred_text="Sorry, not allowed" oi_signin_text="OpenID Protected" oi_barred_text="You are not allowed to read this">
...
</MTEntryProtect>

MTBlogProtect

A container tag for blog protection. If a blog has been protected, the contents of this container will be hidden and the protection prompt (e.g. a form to enter the password or a link to login via Typekey/OpenID) will be displayed.

Add the opening MTBlogProtect tag just after you opening body tag and close it just before closing the body tag

<body>
    <MTBlogProtect>
    ...
    </MTBlogProtect>
</body>

The MTBlogProtect container tag takes the following optional attributes:

  • password_text - When a blog is password protected, a message that explains its protected status along with a form is displayed. This attribute allows you to customize the message displayed. Default: This blog is password protected. To view it please enter your password below

  • tk_signin_text - When a blog is Typekey protected, a message is displayed asking users to login. This attribute allows you to customize the message. Default: This blog has been Typekey protected so only selected Typekey users can read it.

  • tk_barred_text - This attribute allows you to customize the message that is displayed after a user has signed in on a Typekey protected blog but doesn't not have the permissions to view the contents of the blog. Default: You do not have the rights to access this blog. Sorry!

  • oi_signin_text - When a blog is OpenID protected, a message is displayed asking users to login. This attribute allows you to customize the message. Default: This blog has been OpenID protected so only selected OpenID users can read it.

  • oi_barred_text - This attribute allows you to customize the message that is displayed after a user has signed in on a OpenID protected blog but doesn't not have the permissions to view the contents of the blog. Default: You do not have the rights to access this blog. Sorry!

These attributes can be combined in an arbitrary way

<MTBlogProtect password_text="Blog Password Protected" tk_signin_text="Sign in with TK" tk_barred_text="Sorry, not allowed" oi_signin_text="OpenID Protected" oi_barred_text="You are not allowed to read this">
...
</MTBlogProtect>

MTIfProtected

This tag can be used to hide the contents of a protected entry or blog in templates that are not published as PHP (i.e. do not have a .php extension), for example RSS templates.

<MTIfProtected>
This entry has been protected
</MTIfProtected>

MTIfProtected

This tag can be used to hide the contents of a protected entry or blog in templates that are not published as PHP (i.e. do not have a .php extension), for example RSS templates.

<MTIfProtected>
This entry has been protected
</MTIfProtected>