Space between template

Author Message

Florent Hache

Thursday 24 September 2009 4:58:17 am

Hi everybody
I have a little problem with the include of my template.
When i put my code in only one template the result is like i want, but when i have one part of my code in a template, the other part in an other template and i include the both in my pagelayout.tpl i have a space like a <br /> between the 2 parts. And the 2 html code (all in one template and my code in many template ) are the same. I don't understand.
I wait for explication thanks a lot
Florent Hache

Jean-Luc Nguyen

Thursday 24 September 2009 6:43:04 am

Hello,

Can you show us your code part?

http://www.acidre.com

Florent Hache

Friday 25 September 2009 12:16:48 am

Yes i can, the problem is between the menu.tpl and $module_result.content.
my pagelayout.tpl

{cache-block keys=$uri_string}
{def $hiddenNodes=ezini('Noeuds', 'NoeudsCaches', 'specifique.ini')
	 $currentLang=$access_type.name}
{* CALCUL DES AUTRES LANGUES *}
{if $currentLang|eq('fr')}
	{def $otherLang=hash('en', 'Version anglaise du site', 'nl', 'Version néerlandaise du site')}
{elseif $currentLang|eq('en')}
	{def $otherLang=hash('fr','Version française du site','nl','Version néerlandaise du site')}
{else}
	{def $otherLang=hash('fr','Version française du site','en','Version anglaise du site')}
{/if}
<!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>
		{include uri='design:commun/titre.tpl'}
		{include uri='design:commun/css_js.tpl'}
	</head>
	<body>
		<!--[if IE 6]><div id="IE6"><![endif]-->
		<!--[if IE 7]><div id="IE7"><![endif]-->
		<!--[if (IE) & (!IE 6) & (!IE 7)]><div id="IE"><![endif]-->
		<!--[if !IE]>--><div id="NOTIE"><!--<![endif]-->
			<div class="wrap-page">
				<div class="container_16">
					<div class="container_16 clearfix">
						{include uri='design:commun/header.tpl'}
					</div>
					<div class="container_16 clearfix alpha">
						{include uri='design:commun/menu.tpl'}
					</div>
						{/cache-block}
						{if and(is_set($module_result.node_id), $module_result.node_id|eq(2))}
							{$module_result.content}
						{else}
						{cache-block keys=$uri_string}
						{include uri='design:commun/compas.tpl'}
						{/cache-block}
						<div id="central">
							<div id="left">
								{include uri='design:commun/menu_left.tpl'}
							</div>
							{$module_result.content}
							{if ne($module_result.content_info.class_identifier, 'musee')}
								<div id="right">
									{include uri='design:commun/cartouche.tpl'}
								</div>
							{/if}
						</div>
					{/if}
					{cache-block}
		{include uri='design:commun/footer.tpl'}
	</body>
</html>
{/cache-block}
{undef}

menu.tpl :

{def $menu_niv1=fetch(content, list, hash(
	parent_node_id, 243,
	class_filter_type, include,
	class_filter_array, ezini('Menu', 'ClassesMenuNiv1', 'specifique.ini'),
	sort_by, array('priority', true())
))}
{if $menu_niv1}
	<div id="barre-menu" class="yin">
		<div id="form-recherche">
			<form method="post" action="#">
				<label for="champ-recherche">Rechercher sur le site :</label>
				<input type="text" name="champ-recherche" id="champ-recherche" />
				<input type="image" src={"images/boutons/bt-loupe.gif"|ezdesign} name="submit-recherche" id="submit-recherche" />
			</form>
		</div>
		<ul id="menu">
			<li>
				<a href={"/"|ezurl}><img src={"images/elements/ico-home.png"|ezdesign} alt="accueil" id="icone-home" /></a>
			</li>
			{foreach $menu_niv1 as $element}
				{if not($hiddenNodes|contains($element.node_id))}
					<li>
						<a href={$element.url_alias|ezurl}>{$element.name|wash}</a>
					</li>
				{/if}
			{/foreach}
		</ul>
	</div>
{/if}

and my home.tpl :

<div id="rubriques-home" class="container_16 clearfix">
	<div class="grid_8_bis omega">
		<div id="a-la-une">
			{def $limit_actu=6}
			{def $noeud_actus=fetch(content, node, hash(node_id, ezini("Noeuds", "MEA", "specifique.ini")))}
			{def $actus_temp=fetch(content, list, hash(
					parent_node_id, $noeud_actus.node_id,
					class_filter_type, 'include',
					class_filter_array, array('actualite'),
					sort_by, array(
						array('attribute', false(), 'actualite/date_debut'),
						array('priority', true())
					),
					attribute_filter, array(
						array('actualite/date_debut', '<=', makedate())
					),
					limit, $limit_actu
				))
				$actus=array()
			}
			{if $actus_temp}
				{foreach $actus_temp as $actu}
					{if or(is_set($actu.data_map.date_fin.has_content)|not, $actu.data_map.date_fin.has_content|not, $actu.data_map.date_fin.value.timestamp|ge(makedate()))}
						{set $actus=$actus|append($actu)}
					{/if}
				{/foreach}
			{/if}
			{undef $actus_temp}
			{if $actus}
				{foreach $actus as $actu}
					<img src={$actu.data_map.visuel.content[original].full_path|ezroot} alt="" width="480" height="315" />
					<div class="grid_3_bis alpha omega bloc-text-une">
						<h2 class="titre-a-la-une">A la une :</h2>

						<div class="intitule-une">
							{$actu.name}
						</div>
						<ul class="pagination-une">
							<li class="current"><a href="#" title="aller au premier titre">1</a></li>
							<li><a href="#" title="aller au deuxième titre">2</a></li>
							<li><a href="#" title="aller au troisième titre">3</a></li>
							<li><a href="#" title="aller au quatrième titre">4</a></li>

							<li><a href="#" title="aller au cinquième titre">5</a></li>
							<li><a href="#" title="aller au sixième titre">6</a></li>
						</ul>
					</div>
				{/foreach}
			{/if}
		</div>
	</div>
	<div class="grid_5 alpha omega">
		<div id="bloc-rubriques">
			<div id="rub-meteo" class="rubrique large">
				<div class="rub-top">
					<div class="rub-titre">
						<a href="#">Météo : <span>23°C</span></a>
					</div>
				</div>
			</div>
			<div id="rub-demarches" class="rubrique thin">

				<div class="rub-top">
					<div class="rub-titre">
						<a href="#">Démarches</a>
					</div>
				</div>
			</div>
			<div id="rub-calendrier" class="rubrique large">
				<div class="rub-top">

					<div class="rub-titre">
						<a href="#">Calendrier</a>
					</div>
				</div>
			</div>
			<div id="rub-assos" class="rubrique thin">
				<div class="rub-top">
					<div class="rub-titre">

						<a href="#">Assos</a>
					</div>
				</div>
			</div>
		</div>
	</div>
	<div class="grid_3_bis alpha">
		<div id="liste-liens-home">

			<ul id="liens-home">
			{def $lien=fetch(content, node, hash(node_id, 209))}
			{if $lien}
				<li><a id="questions-maire" href={$lien.url_alias|ezurl}>{$lien.name|wash}</a></li>
			{/if}
				<li><a id="videos" href="#">Vidéos</a></li>
				<li><a id="chat" href="#">Chat</a></li>
				<li><a id="rss" href="#">RSS</a></li>
				<li><a id="documents" href="#">Documents</a></li>

				<li><a id="nouveaux-arrivants" href="#">Nouveaux<br /> arrivants</a></li>
				<li class="last"><a id="alerte-email" href="#">Alerte email</a></li>
			</ul>
		</div>
	</div>
</div>
</div>
</div>
<div id="wrap-home-bottom" class="wrap-page clearfix">
	<div class="container_16 ombre-middle clearfix">
		<div class="grid_8_bis omega">
			<h2 id="titre-actualites">Flash infos</h2>
			<div class="grid_4_bis alpha omega">
				{def $noeud_actus=fetch(content, node, hash(node_id, ezini("Noeuds", "Liste_actualites", "specifique.ini")))}
					{def $actus_temp=fetch(content, list, hash(
							parent_node_id, $noeud_actus.node_id,
							class_filter_type, 'include',
							class_filter_array, array('actualite'),
							sort_by, array(
								array('attribute', false(), 'actualite/date_debut'),
								array('priority', true())
							),
							attribute_filter, array(
								array('actualite/date_debut', '<=', makedate())
							),
							limit, $limit_actu
						))
						$actus=array()
					}
					{if $actus_temp}
						{foreach $actus_temp as $actu}
							{if or(is_set($actu.data_map.date_fin.has_content)|not, $actu.data_map.date_fin.has_content|not, $actu.data_map.date_fin.value.timestamp|ge(makedate()))}
								{set $actus=$actus|append($actu)}
							{/if}
						{/foreach}
					{/if}
					{undef $actus_temp}
					{if $actus}
						{foreach $actus as $actu offset 0 max 2}
							<div class="bloc-actu">
								<div class="titre-actu clearfix"><span>{$actu.data_map.datepub.content.day}
									<em>
										{if $actu.data_map.datepub.content.month|eq(01)}
											janv
										{/if}
										{if $actu.data_map.datepub.content.month|eq(02)}
											fev
										{/if}
										{if $actu.data_map.datepub.content.month|eq(03)}
											mars
										{/if}
										{if $actu.data_map.datepub.content.month|eq(04)}
											avril
										{/if}
										{if $actu.data_map.datepub.content.month|eq(05)}
											mai
										{/if}
										{if $actu.data_map.datepub.content.month|eq(06)}
											juin
										{/if}
										{if $actu.data_map.datepub.content.month|eq(07)}
											juil
										{/if}
										{if $actu.data_map.datepub.content.month|eq(08)}
											aout
										{/if}
										{if $actu.data_map.datepub.content.month|eq(09)}
											sept
										{/if}
										{if $actu.data_map.datepub.content.month|eq(10)}
											oct
										{/if}
										{if $actu.data_map.datepub.content.month|eq(11)}
											nov
										{/if}
										{if $actu.data_map.datepub.content.month|eq(12)}
											dec
										{/if}
									</em>
									</span>
									<h3>{$actu.name|wash}</h3>
								</div>
								<p>
									{if and(is_set($actu.data_map.intro), $actu.data_map.intro.has_content)}
										{attribute_view_gui attribute=$actu.data_map.intro}
									{/if}
								</p>
							</div>
						{/foreach}
					{/if}
			</div>
			<div class="grid_4_bis alpha omega">
				{if $actus}
					{foreach $actus as $actu offset 2 max 2}
						<div class="bloc-actu">
							<div class="titre-actu clearfix"><span>{$actu.data_map.datepub.content.day}
								<em>
									{if $actu.data_map.datepub.content.month|eq(01)}
										janv
									{/if}
									{if $actu.data_map.datepub.content.month|eq(02)}
										fev
									{/if}
									{if $actu.data_map.datepub.content.month|eq(03)}
										mars
									{/if}
									{if $actu.data_map.datepub.content.month|eq(04)}
										avril
									{/if}
									{if $actu.data_map.datepub.content.month|eq(05)}
										mai
									{/if}
									{if $actu.data_map.datepub.content.month|eq(06)}
										juin
									{/if}
									{if $actu.data_map.datepub.content.month|eq(07)}
										juil
									{/if}
									{if $actu.data_map.datepub.content.month|eq(08)}
										aout
									{/if}
									{if $actu.data_map.datepub.content.month|eq(09)}
										sept
									{/if}
									{if $actu.data_map.datepub.content.month|eq(10)}
										oct
									{/if}
									{if $actu.data_map.datepub.content.month|eq(11)}
										nov
									{/if}
									{if $actu.data_map.datepub.content.month|eq(12)}
										dec
									{/if}
								</em>
								</span>
								<h3>{$actu.name|wash}</h3>
							</div>
							<p id="testnl">
								{if and(is_set($actu.data_map.intro), $actu.data_map.intro.has_content)}
									{attribute_view_gui attribute=$actu.data_map.intro}
								{/if}
							</p>
						</div>
					{/foreach}
				{/if}
			</div>

			<a href="#" id="anciennes-publications">Voir plus d'anciennes publications</a>
		</div>
		<div class="grid_5 alpha omega">
			<img src={"images/structure/map.png"|ezdesign} alt="carte" id="map" />
		</div>
		<div class="grid_3_bis alpha">
			<div id="coordonnees-telmedia">
				<strong>Telmedia</strong><br />

				15 E rue du plouvier<br />
				<span>59175 Templemars</span>
				<em>9h à 19h tous les jours</em>
			</div>
			<div id="plan-acces">
				<span>Pour accéder au plan :</span>
				<a href="#"><img src={"images/_TEMP/gmap.gif" alt="gmap"|ezdesign} /></a>

			</div>
		</div>
	</div>
</div>

For information i have the same problem between my module_result.content and my footer.tpl
Thanks a lot
Florent Hache

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