Access Keys:
Skip to content (Access Key - 0)
Home (Access Key - 1)
All spaces... (Access Key - 3)
Log in (Access Key - 5)
Sign up (Access Key - 6)
Templating

Mambo Manual is part of the documentation project for the Mambo open source content management system

Toggle Sidebar

Converting Mambo 4.5.0 Templates to Work with Mambo 4.5.x


There were changes in Mambo templates between versions 4.5.0 (which include all the 4.5 1.0.x releases) and the later releases of Mambo 4.5.x. People using very old versions of Mambo and 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 the old Mambo 4.5.0 templates and later 4.5 templates are detailed below.

Pathway

In 4.5 the pathway was a reference to a file called "pathway.php". 4.5.x uses a function called "mosPathWay".

4.5 4.5.x
<?php include_once("pathway.php"); ?>
<?php mosPathWay(); ?>

Mainbody

In 4.5 the mainbody was a reference to a file called "mainbody.php". 4.5.x instead uses a function called "mosMainBody".

4.5 4.5.x
<?php include_once("mainbody.php"); ?>
<?php mosMainBody(); ?>

Global variables

Some of the core configuration variables changed too, here they are:

4.5 4.5.x
$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.x 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

The HEAD code was also changed between Mambo 4.5 and 4.5.x. The standard heading code for Mambo 4.5.1+ was:

<?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>

Many templates for Mambo 4.5.0 used the following code. This needs to be replaced with the code above.

<?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>

NOTE: Custom Administrator templates from Mambo <=4.5.1 do not work correctly with Mambo 4.5.2+. You will need to revert to the default Administrator templates for proper operation of your backend.

The best way to work out what changes you need to make for later versions of Mambo is to compare your custom templates with the templates that are distributed as part of the Mambo package. Compare the PHP code and make changes as needed.

Toggle Sidebar
Space Navigation
Added by Lynne Pope on 18 Sep, 2008 08:06, last edited by Lynne Pope on 23 Oct, 2008 07:32

Adaptavist Theme Builder Powered by Atlassian Confluence
Free theme builder license