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/

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 18:16:07
Script start
Timing: Jan 18 2025 18:16:07
Module start 'layout'
Timing: Jan 18 2025 18:16:07
Module start 'content'
Timing: Jan 18 2025 18:16:08
Module end 'content'
Timing: Jan 18 2025 18:16:08
Script end

Main resources:

Total runtime1.0884 sec
Peak memory usage4,096.0000 KB
Database Queries52

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0071 588.0313152.6406
Module start 'layout' 0.00710.0032 740.671939.4766
Module start 'content' 0.01041.0761 780.1484509.4766
Module end 'content' 1.08650.0019 1,289.625012.1406
Script end 1.0884  1,301.7656 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00390.3567160.0002
Check MTime0.00140.1280160.0001
Mysql Total
Database connection0.00100.088110.0010
Mysqli_queries1.037295.2964520.0199
Looping result0.00050.0490500.0000
Template Total1.047796.320.5239
Template load0.00240.216020.0012
Template processing1.045396.039820.5227
Template load and register function0.00010.013210.0001
states
state_id_array0.00080.075110.0008
state_identifier_array0.00230.210020.0011
Override
Cache load0.00190.1779200.0001
Sytem overhead
Fetch class attribute can translate value0.00070.067510.0007
Fetch class attribute name0.00100.089130.0003
XML
Image XML parsing0.00040.038110.0004
class_abstraction
Instantiating content class attribute0.00000.001140.0000
General
dbfile0.00080.0740160.0001
String conversion0.00000.000740.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
3content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 15
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs