Forums / Setup & design / Problems with template and left menu

Problems with template and left menu

Author Message

Andreas Kaiser

Wednesday 25 October 2006 2:51:48 am

I'm creating my first ez template and have been reading the "tscm tutorial" and ez publish books. I have configured ez publish and had no problems. The templates are at design/newdesign/templates. In this folder I have created following templates:

menu_banners.tpl (static html)
menu_bottom.tpl (static html)
pagelayout.tpl (html with ez template code
topheader.tpl (static html)

I also use an extension for the left menu. This extension uses a left_menu.tpl template file.

When I load the site, my layout appears with no errors, except the menu doesn't loads. When I delete (or rename) the pagelayout.tpl file and use the default pagelayout the menu appears with no errors.

Why this happens? The left_menu is loaded with the same lines than in the default ez pagelayout:

{* Left menu START *}
{include uri="design:left_menu.tpl"}
{* Left menu END *}

Here is my pagelayout code:

{*?template charset=latin1?*}
<!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" xml:lang="{$site.http_equiv.Content-language|wash}" lang="{$site.http_equiv.Content-language|wash}">

<head>
{section name=JavaScript loop=ezini( 'JavaScriptSettings', 'JavaScriptList', 'design.ini' ) }
<script language="JavaScript" type="text/javascript" src={concat( 'javascript/',$:item )|ezdesign}></script>
{/section}
    <link rel="stylesheet" type="text/css" href={"stylesheets/alares.css"|ezdesign} />
    <link rel="stylesheet" type="text/css" href={"stylesheets/core.css"|ezdesign} />
    <link rel="stylesheet" type="text/css" href={"stylesheets/debug.css"|ezdesign} />
<style type="text/css">
{section var=css_file loop=ezini( 'StylesheetSettings', 'CSSFileList', 'design.ini' )}
    @import url({concat( 'stylesheets/',$css_file )|ezdesign});
{/section}
</style>

{include uri="design:page_head.tpl"}
{* moofx java*}
{literal}
	<script type="text/javascript">
	//the main function, call to the effect object
	function init(){
		var stretchers = document.getElementsByClassName('stretcher'); //div that stretches
		var toggles = document.getElementsByClassName('display'); //h3s where I click on
		//accordion effect
		var myAccordion = new fx.Accordion(
			toggles, stretchers, {opacity: true, duration: 400}
		);
		//hash function
		function checkHash(){
			var found = false;
			toggles.each(function(h3, i){
				if (window.location.href.indexOf(h3.title) > 0) {
					myAccordion.showThisHideOpen(stretchers[i]);
					found = true;
				}
			});
			return found;
		}
		if (!checkHash()) myAccordion.showThisHideOpen(stretchers[0]);
	}
	</script>
{/literal}
</head>
<body>
<div id="maincore1">
  <div id="topheader">
			{* Top Header START *}
			{include uri="design:top_header.tpl"}
			{* Top Header END *}
	</div>
  	<div id="right_side">
		
	  <div id="header"></div>
		<div id="main">
			<div class="padding">
				{* Main area START *}
				{include uri="design:page_mainarea.tpl"}
				{* Main area END *}
			</div>
		</div>
	</div>	
	<div id="left_side">
	<div id="logo">
	<img src={"logo-alares.jpg"|ezimage()} alt="logo alares" width="200" height="75" />
	</div>
{* Left menu START *}
{include uri="design:left_menu.tpl"}
{* Left menu END *}
{* Menu Banners START *}
{include uri="design:menu_banners.tpl"}
{* Menu Banners END *}
</div>	
	<div id="footer">
			{* Menu Bottom START *}
			{include uri="design:menu_bottom.tpl"}
			{* Menu Bottom END *}
			<div class="gotop">
		        <a href="#"><img src={"gotop.jpg"|ezimage()} alt="go top" width="40" height="45" border="0" /></a>
			</div>
	</div>
</div>
	<script type="text/javascript">
		Element.cleanWhitespace('moo-nav');
		init();
	</script>
	
<!--DEBUG_REPORT-->
  </body>
</html>

eZ Partner in Madrid (Spain)
Web: http://www.atela.net/

Andreas Kaiser

Wednesday 25 October 2006 3:44:44 am

Doing some test. I have created a new template called moo_menu.tpl with the code of the extension and called it from the pagelayout.tpl with:

{* Left menu START *}
{include uri="design:moo_menu.tpl"}
{* Left menu END *}

And now the menu is loading well?!!

eZ Partner in Madrid (Spain)
Web: http://www.atela.net/