Bonjour à tous,
J'ai créer ma propre template pour Joomla 1.7 en utilisant le système "960 Grid".
Voici l'index.php:
C'est probablement un peu le fouilli mais ca marche...
celon le code ci-dessus, j'ai donc:
- Une "maincolumn" qui fait grid_3 lorsque "gallery" est présent à sa gauche.
- Une "Maincolumn" qui fait grid_7 lorsque "gallery" est absent, ce qui me permet de voir "right" à sa droite.
Je souhaiterais que "maincolumn" fasse grid_10 lorsque les modules "gallery" et "right" ne sont pas présents.
Or le module "right" est déclaré après "maincolumn" et je ne trouve pas la solution...
Quelqu'un peut-il m'aider?
Merci d'avance à toutes âmes charritable.
J'ai créer ma propre template pour Joomla 1.7 en utilisant le système "960 Grid".
Voici l'index.php:
Code:
<?php
/**
* @copyright Copyright (C) 2005 - 2011 Ant1.
* @license GPL
*/
defined('_JEXEC') or die;
$app = JFactory::getApplication();
$leftcolgrid = "2";
$rightcolgrid = "3";
$languagegrid = "2";
$contentgrid = "3";
?>
<!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="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" >
<!-- HEAD -->
<head>
<jdoc:include type="head" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/system/css/system.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/system/css/general.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/css/layout.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/css/typography.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/css/editor.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/css/fontfaces.css" type="text/css" />
<?php if ($this->countModules('left') == 0):?>
<?php $leftcolgrid = "0";?>
<?php endif; ?>
<?php if ($this->countModules('right') == 0):?>
<?php $rightcolgrid = "0";?>
<?php endif; ?>
<?php if ($this->countModules('gallery') == 0):?>
<?php $contentgrid = "7";?>
<?php endif; ?>
</head>
<!-- BODY -->
<body>
<div id="header" class="container_12">
<div id="top" class="grid_10">
<jdoc:include type="modules" name="top" style="xhtml" />
</div>
<?php if($this->countModules('language')) : ?>
<div id="corner" class="grid_2">
<jdoc:include type="modules" name="language" style="xhtml" />
</div>
<?php endif; ?>
</div>
<div class="clear"></div>
<div id="content" class="container_12">
<?php if($this->countModules('left')) : ?>
<div id="sidebar" class="grid_<?php echo $leftcolgrid;?>">
<jdoc:include type="modules" name="left"style="xhtml" />
</div>
<?php endif; ?>
<?php if($this->countModules('gallery')) : ?>
<div id="gallery" class="grid_7">
<jdoc:include type="modules" name="gallery" style="xhtml" />
</div>
<?php endif; ?>
<div id="maincolumn" class="grid_<?php echo$contentgrid;?>">
<jdoc:include type="component" />
</div>
<?php if($this->countModules('right')) : ?>
<div id="sidebar-2" class="grid_<?php echo $rightcolgrid;?>">
<jdoc:include type="modules" name="right" style="xhtml" />
</div>
<?php endif; ?>
</div>
<div class="clear">
</div>
<div id="footer" class="container_12">
<div id="bas" class="grid_7 push_2">
<jdoc:include type="modules" name="footer" style="xhtml" />
</div>
<jdoc:include type="modules" name="debug" />
</body>
</html>
celon le code ci-dessus, j'ai donc:
- Une "maincolumn" qui fait grid_3 lorsque "gallery" est présent à sa gauche.
- Une "Maincolumn" qui fait grid_7 lorsque "gallery" est absent, ce qui me permet de voir "right" à sa droite.
Je souhaiterais que "maincolumn" fasse grid_10 lorsque les modules "gallery" et "right" ne sont pas présents.
Or le module "right" est déclaré après "maincolumn" et je ne trouve pas la solution...
Quelqu'un peut-il m'aider?
Merci d'avance à toutes âmes charritable.
Commentaire