I cannot be sure for all templates but basically if you take your current template index.php
(make a backup of it)
everything that is currently within your template's tags needs to go within the code I posted above, where it says: Your normal template HTML here -->
Maybe it is easiest to post an example:
If this was your template's index.php
Code:
<?php
/**
* template_name - Mambo 4.5.1 template
* @version 4.5.1
* @copyright ( - All Rights Reserved
* @license licensce info here
*/
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
$iso = split( '=', _ISO );
echo '<?xml version="1.0" encoding="'. $iso[1] .'"?' .'>';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php if ( $my->id ) initEditor(); ?>
<meta http-equiv="Content-Type" content="text/html; <?php echo _ISO; ?>" />
<?php mosShowHead(); ?>
<?php echo "<meta name=\"author\" content=\"www.site.co.uk\" />" ?>
<?php echo "<link rel=\"stylesheet\" href=\"$GLOBALS[mosConfig_live_site]/templates/$GLOBALS[cur_template]/css/template_css.css\" type=\"text/css\"/>" ; ?>
<?php echo "<link rel=\"shortcut icon\" href=\"$GLOBALS[mosConfig_live_site]/images/favicon.ico\" />" ; ?>
</head>
<body>
<div id="container">
<div id="page">
<div id="topnav">
<?php mosLoadModules ( 'user1', -1 ); ?>
</div>
<div id="modcol">
<?php mosLoadModules ( 'left', -2 ); ?>
</div>
<div id="content">
<?php mosLoadModules ( 'top', -2 ); ?>
<?php include ("mainbody.php"); ?>
<?php mosLoadModules ( 'footer', -2 ); ?>
</div>
</div>
</div>
</body>
</html>
the new version would look like:
Code:
<?php
/**
* template_name - Mambo 4.5.1 template
* @version 4.5.1
* @copyright ( - All Rights Reserved
* @license licensce info here
*/
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
$iso = split( '=', _ISO );
echo '<?xml version="1.0" encoding="'. $iso[1] .'"?' .'>';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php if ( $my->id ) initEditor(); ?>
<meta http-equiv="Content-Type" content="text/html; <?php echo _ISO; ?>" />
<?php mosShowHead(); ?>
<?php echo "<meta name=\"author\" content=\"www.site.co.uk\" />" ?>
<?php echo "<link rel=\"stylesheet\" href=\"$GLOBALS[mosConfig_live_site]/templates/$GLOBALS[cur_template]/css/template_css.css\" type=\"text/css\"/>" ; ?>
<?php echo "<link rel=\"shortcut icon\" href=\"$GLOBALS[mosConfig_live_site]/images/favicon.ico\" />" ; ?>
</head>
<body>
<!-- Check to see if visitor is logged in -->
<?php if ( $my->id) {?>
<!-- IS logged in so deliver normal template
Your normal template HTML here -->
<div id="container">
<div id="page">
<div id="topnav">
<?php mosLoadModules ( 'user1', -1 ); ?>
</div>
<div id="modcol">
<?php mosLoadModules ( 'left', -2 ); ?>
</div>
<div id="content">
<?php mosLoadModules ( 'top', -2 ); ?>
<?php include ("mainbody.php"); ?>
<?php mosLoadModules ( 'footer', -2 ); ?>
</div>
</div>
</div>
<?php }
else {?>
<!-- Visitor NOT logged in so deliver the login page
HTML for the minimal login page - I have made it REALLY minimal for this example -->
<div>
<!-- here we load a module position for the login module
In the admin panel only assign the login module to this position -->
<?php mosLoadModules ( 'user5', -2 ); ?>
</div>
<!-- here we check if the visitor needs the Registration page/forgotten password page -->
<?php if ($option == 'com_registration'){ ?>
<!-- YES visitor wants registration or forgotten password page so include mainbody content -->
<div>
<?php include ("mainbody.php"); ?>
</div>
<?php } ?>
<!-- end of needs registration/forgotten password check -->
<?php } ?>
</body>
</html>