|
Let’s revise the Mambo template structure and needed pieces of the code which are responsible for the functions of modules, components and other blocks of your site location. I advise you to see how one of the templates going with mambo works. It will help you to understand structure of placing and using the code.
You will need to insert the following code in the very beginning of the file index.php :
1.<?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">
Those are specific tags which show the browser that the following content satisfies the standards XML and xHTML
2.<head> <?php echo $mosConfig_sitename; ?>
is responsible for the generation and leading out of your site title in the headings of the pages – instead of the standard tag <title>
3. <meta http-equiv="Content-Type" content="text/html; <?php echo _ISO; ?>" />
Points to the coding for site content.
4. <?php include ("includes/metadata.php"); ?>
<?php include ("editor/editor.php"); ?>
Connection of mega data generator and WISWIG editor.
5. <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>
Script for proper reflection of the template in browsers Mozilla and Netscape
6. <link href="<?php echo $mosConfig_live_site;?>/templates/business/css/template_css.css" rel="stylesheet" type="text/css" />
Points to the location of css stylesheet
7.<link rel="shortcut icon" href="<?php echo $mosConfig_live_site;?>/images/favicon.ico" />
location for the favorites icon
8. <?php initEditor(); ?> </head>
Initialization of WISWIG editor
All the following pieces of code must be inserted between the tags <body>
During the insertion the pictures, images, buttons, in the template it is needed to take into consideration the fact that the way to the every picture should start from:
<?php echo $mosConfig_live_site;?>
for example:
<?php echo $mosConfig_live_site;?>/templates/your_template_dir/images/image.gif
any relative links in your template should look as follows:
<a href='<?php echo sefRelToAbs("index.php?option=com_docman"); ?>'>Downloads</a>
Structurally the mambo template is a set of definite areas, and it is possible to inference one or another component, module, banner or logotype.
For pointing the location of those areas the following lines are used:
<?php mosLoadComponent( "banners" ); ?>
Showing banners area
<?php echo (strftime (_DATE_FORMAT_LC)); ?>
The area for showing current time and date
<?php include ("mainbody.php"); ?>
The area for showing main content (news, articles, forum)
<?php include "pathway.php"; ?>
The area for showing the current state of the user on the site (for example enters such a line: Main > download > Demo versions)
<?php mosLoadModules ( 'left' ); ?>
The area for showing the modules to the left
<?php mosLoadModules ( 'right' ); ?>
The area for showing the modules to the right
<?php mosLoadModules ( 'top' ); ?>
The area for showing the top modules
<?php mosLoadModules ( 'bottom' ); ?>
the area for showing bottom modueles
<?php mosLoadModules ( 'user1' ); ?>
<?php mosLoadModules ( 'user2' ); ?>
Allows to show any module (and not only left or right) in any place of the site you pointed.
<?php mosLoadModules ( 'inset' ); ?>
<?php include_once('includes/footer.php'); ?>
The area for copyrights and another information showing.
<form action="index.php?Itemid=1" STYLE='margin-top: 0px; margin-bottom: 0px;' method="post">
<div align="right">
<input class="inputbox" type="text" name="searchword" size="20" value="<?php echo _SEARCH_BOX; ?>" onBlur="if(this.value=='') this.value='<?php echo _SEARCH_BOX; ?>';" onFocus="if(this.value=='<?php echo _SEARCH_BOX; ?>') this.value='';" />
<input type="hidden" name="option" value="search" />
</div>
</form>
Represents a search form on the site.
After the code insertion, check if the tables do not slide apart, correct the design and save the page under the name index.php.
Put everything into the folders in such an order:
server/templates/name of your template/images/ graphic
server/templates/name of your template/css/template_css.css
server/templates/the name of your template /index.php your newly done page.
sever/templates/name of your template/template_thumbnail.png mini screenshot of your design
server/templates/name of your template/templateDetails.xml Description and author’s rights (remake a ready file from the other template)
You do not need to remember all the described tags. For the simplification of template creation great addition for the Dreamweaver MX was created – I have already described it in the news. It is possible to download the addition in our file archive.
|