There were changes in Mambo templates between versions 4.5.0 (which include all the 4.5 1.0.x releases) and Mambo 4.5.2. People who are now upgrading to later releases within the Mambo 4.5 branch may find that their templates no longer work as expected.
Mambo templates use PHP variables and operators in the Mambo core system. The changes between Mambo 4.5.0 templates and 4.5.2 templates are detailed below.
Pathway
In 4.5.0 the pathway was a reference to a file called "pathway.php". 4.5.2 uses a function called "mosPathWay".
| 4.5 | 4.5.2 |
|---|---|
<?php include_once("pathway.php"); ?>
|
<?php mosPathWay(); ?>
|
Mainbody
In 4.5 the mainbody was a reference to a file called "mainbody.php". 4.5.1+ instead uses a function called "mosMainBody".
| 4.5 | 4.5.2 |
|---|---|
<?php include_once("mainbody.php"); ?>
|
<?php mosMainBody(); ?>
|
Global variables
Some of the core configuration variables changed too, here they are:
| 4.5 | 4.5.2 |
|---|---|
$mosConfig_live_site
|
$GLOBALS['mosConfig_live_site']
|
$mosConfig_absolute_path
|
$GLOBALS['mosConfig_absolute_path']
|
$mosConfig_sitename
|
$GLOBALS['mosConfig_sitename']
|
$mosConfig_offset
|
$GLOBALS['mosConfig_offset']
|
Pathway-separator
4.5.1+ has a new feature for the pathway arrow. In the Mambo generated pathway of the "mosPathWay" function, an arrow image appears between the pathway links. This can be a custom arrow for each template, and it is very simple to use this feature.
Simply create an image that you want for this, save it in .png-format, call it "arrow.png" and place it in the root folder of the template you want to use it with and/or in the images directory within your template folder.
Remember to create a reference to this file in the "template_details.xml" file, so that it is uploaded when installing the template through the Mambo Template Installer.
HEAD Code
Many templates for Mambo 4.5.0 use the following code.
<?php
echo "<?xml version=\"1.0\"?>"; defined( '_VALID_MOS' ) or die
( 'Direct Access to this location is not allowed.' );
?>
<!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>
<title><?php echo $mosConfig_sitename; ?></title>
<meta http-equiv="Content-Type" content="text/html; <?php echo _ISO; ?>" />
<?php if ($my->id) {
include ("editor/editor.php");
initEditor();
} ?>
<?php include ("includes/metadata.php"); ?>
<script language="JavaScript" type="text/javascript">
<!-- function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true); //-->
</script>
This needs to be replaced with the following:
<?php
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(); ?>
<link rel="stylesheet" type="text/css" href="<?php echo $GLOBALS['mosConfig_live_site']; ?>
/templates/yourtemplatesname/css/template_css.css" />
</head>
Updated February 23, 2005 to cover all changes needed to upgrade templates from 4.5.0.x to Mambo 4.5.2.
If you enjoyed this post, make sure you subscribe to my RSS feed!













