Penso di avere risolto, ma non capisco perchè non ha funzionato
Ora vi spiego con il codice
Questo è il codice di index.php del template dove left column include con passaggio di variabile un altro file chiamato templates.php
<div id="leftcolumn">
<jdoc:include type="modules" name="left" style="rounded" />
<br />
<?php $sg = 'banner'; include "templates.php"; ?>
<br />
</div>
Questo che segue è il file che include templates.php come era in origine prima di cambiarlo
<?if( $sg == 'banner' ):?>
<div style="width:137px;text-align:center;margin:0 auto;">
<br />
<table style="width:137px;text-align:center;" cellpadding="0" cellspacing="0">
<tr>
<td><font class="sgf1">Copyright 2010</font></td>
</tr>
</table>
<table style="width:137px;height:16px;text-align:center;border:none;" cellpadding="0" cellspacing="0">
<tr>
<td><img src="templates/<?php echo $this->template ?>/images/logosmall.jpg" style="width:150px;height:140px;" />
<td width="2" height="16"></td>
</td>
</tr>
</table>
</div>
<?else:?>
<?php echo $mainframe->getCfg('sitename') ;?> Template Copyright 2010 <a href="http://www.siteground.com/" class="sgfooter" target="_blank"> SiteGround.com Inc </a><br /> <a href="http://www.joomla.com/" class="sgfooter" target="_blank"> Powered by Joomla!</a><br /> Remake Template by Adriano Quatrini <br />Logo "Fight Gravity" and "Gymnica Climb" by Gilda Banchi </a></td>
<?endif;?>
Questo è templates.php cambiato
<?if( $sg == 'banner' ):?>
<div style="width:137px;text-align:center;margin:0 auto;">
<br />
<table style="width:137px;text-align:center;" cellpadding="0" cellspacing="0">
<tr>
<td><font class="sgf1">Copyright 2010</font></td>
</tr>
</table>
<table style="width:137px;height:16px;text-align:center;border:none;" cellpadding="0" cellspacing="0">
<tr>
<td><img src="templates/<?php echo $this->template ?>/images/logosmall.jpg" style="width:150px;height:140px;" />
<?php echo $mainframe->getCfg('sitename') ;?> Template Copyright 2010 <a href="http://www.siteground.com/" class="sgfooter" target="_blank"> SiteGround.com Inc </a><br /> <a href="http://www.joomla.com/" class="sgfooter" target="_blank"> Powered by Joomla!</a><br /> Remake Template by Adriano Quatrini <br />Logo "Fight Gravity" and "Gymnica Climb" by Gilda Banchi </a></td>
<td width="2" height="16"></td>
</td>
</tr>
</table>
</div>
<?else:?>
<?endif;?>
Come potete vedere con ho fatto altro che includerlo all'interno della cella, escludendo if else ....
Perchè if else all'interno di templates.php in origine non funziona?
Ho provato in locale a mettere un passaggio di variabile vuoto in index.php, appena sotto, all'altro passaggio di avriabile, per far si che vada in esecuzione quella parte di codice sotto ad else in templates.php, ma mi raddoppia il logo e basta...
Anche se ho risolto, vorrei solo capire .
Grazie
