Joomla.it Forum
Joomla! 1.5.x (versione con supporto terminato) => Joomla! 1.5 => I Template di Joomla 1.5.x => : conti1 08 Nov 2009, 16:40:27
-
ciao
vengo al dunque
avendo 2 div allineati con il fload:left
user1-user2
per far prendere la larghezza totale al' user1 in mancanza del' user2 come si potrebbe fare?
usando una tabella di due colonne e gestibile tramite tabella e si espande in automatico in mancanza del'user2.
ma io non voglio fare tabelle in un template fatto tutto a div.
come potrei fare ?
ditemi se sono da ricovero ;D se io faccio gestire il tutto ad una regola
del tipo
<!-- x allargare quando manca user2-->
<?php if($this->countModules('user2')) : ?>
<style type="text/css">
#user1column
{
width:50%;
}
</style>
<?php else : ?>
<style type="text/css">
#user1column
{
width: 100%;
}
</style>
<?php endif; ?>
il tutto funziona dalle prove fatte in mancanza dell'user2 l'user1 occupa anche lo spazio delluser2.
-
Ciao conti1,
nel template free redevo allium (http://www.joomla.it/template/elenco-template/1706-redevoallium.html) c'č un sistema simile.
Loro usano nell'index.php:
<style type="text/css">
<?php if(!$this->countModules('left')) : ?>
#main{width:100%!important; float:left;}
<?php endif; ?>
<?php if($this->countModules('user1 + user2')==1) : ?>
#user2{width:100%;}
#user1{width:100%;}
<?php endif; ?>
<?php if(!$this->countModules('right')) :?>
#middle{width:100%;}
<?php endif; ?>
</style>
All'interno di <head> </head>
e
<div id="main">
<?php if($this->countModules('user1 + user2')) : ?>
<div id="user12">
<div id="user1"><jdoc:include type="modules" name="user1" style="xhtml" /></div>
<div id="user2"><jdoc:include type="modules" name="user2" style="xhtml" /></div>
<div class="clear"></div>
</div>
all'interno di <body> </body>
Perņ nel css hanno:
#user1{width:50%; float:left;}
#user2{width:49.5%; float:right;}