Bonjour NoZic,
C'est exactement ça !
J'ai trouvé un petit truc, mettre le signe - devant une instruction qui va être lue uniquement par I.E.6, ça fonctionne.
Voici le CSS de mes catégories et sous catégories, modifé.
Code
/* menu Image -noborderBox2 - Show Sub-categories Star */
a.menucateg:link, a.menucateg:visited, a.menucateg:active {
display: block; /*permet d'attribuer le fond de couleur a tout le block */
verical-align: middle;
color:#DBFE01; /*couleur du nom de la categorie*/
font-size: 11px;
font-family: Verdana, Arial, Helvetica, sans-serif;
/*font-weight: bold;*/
text-align: left;
padding-left: 3px;
height: 23px;
padding-top:8px; /*espace du texte de la categorie avec le haut du block*/
text-decoration: none;
/*background-color: #EDEDEF; /*defini la couleur du fond du texte de la categorie dans son block*/
background-image: url(images/boximage.jpg);
border: solid 2px #FFFFFF; /*defini largeur du bord interieur du block*/
width: 180px;
font-weight: bold;
/* instruction I.E.6*/
-border: solid 0px #FFFFFF;
-margin-top: 4px;
-margin-bottom: 2px;
-height: 31px;
}
a.menucateg:hover {
/*border: solid 1px #CCCCCC; */
/*background-image: url(images/menuon.png);*/
background-image: url(images/boitebutton.gif);
background-repeat: repeat;
text-decoration: none;
border: solid 2px #FFFFFF; /*defini largeur du bord interieur du block*/
/*font-weight: bold;*/
color: #000000;
/*instruction I.E.6 */
-border: solid 0px;
}
a.menusubcateg:link, a.menusubcateg:visited, a.menusubcateg:active {
display: block;
vertical-align: middle;
font-size: 10px;
font-family: Verdana, Arial, Helvetica, sans-serif;
text-align: left;
height: 19px;
text-decoration: none;
padding-top:4px;
padding-left: 5px;
/*border-bottom: 1px solid #7b9ebd;*/
border-left: solid 2px #FFFFFF;
border-bottom: solid 2px #FFFFFF;
background-color: #DBFE01; /*couleur du block qui contien la sous categorie*/
width: 170px;
/* instruction I.E. 6 */
-border-left: solid 0px;
-border-bottom: solid 0 px;
-height: 23 px;
-margin-top: 2 px;
}
a.menusubcateg:hover {
border-bottom: 1px solid #666666;
border-top: 1px solid #666666;
background-image: url(images/menuon1.png);
background-repeat: repeat;
text-decoration: none;
color: #000000;
}
/* menu Image -noborderBox2 - Show Sub-categories End */
Bon, maintenant mon menu me convient pour l'instant, lorsque je maitriserai mieux, j'y reviendrai peut être. Reste, les couleurs à voir.
Voici mes codes, ça pourra servir à d'autre.
Le fichier includes/boxes/categorie.php (les plus grosses modifs sont la définition d'un style pour les catégories et les sous catégories et un petit saut entre le contenu et le header)
Code
<?php
/*
$Id: categories.php,v 1.25 2003/07/09 01:13:58 hpdl Exp $
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Copyright (c) 2003 osCommerce
Released under the GNU General Public License
*/
function tep_show_category($counter) {
global $tree, $categories_string, $cPath_array;
// proposition de NoZic pour ajouter un cadre autour de chaque block equivalent a une categorie
//if ($tree[$counter]['parent'] == 0) {
// $categories_string .= '<hr style="height: 1px; border: 0; background-color: grey; margin: 3px 0 8px 0;">';
//}
//fin de la proposition de NoZic
//ajoute decalage de deux espaces avant nom sous categorie
for ($i=0; $i<$tree[$counter]['level']; $i++) {
// ligne original $categories_string .= " "; supprime car ajoute espace entre les blocks avec style menucateg et menusubcateg
$categories_string .= "";
}
$categories_string .= '<a href="';
if ($tree[$counter]['parent'] == 0) {
$cPath_new = 'cPath=' . $counter;
} else {
$cPath_new = 'cPath=' . $tree[$counter]['path'];
}
//$categories_string .= tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">';
////
// rempalcement de cette ligne cidessus par les suivantes pour definir un style de lien different
if ($tree[$counter]['parent'] == 0) {
$categories_string .= tep_href_link(FILENAME_DEFAULT, $cPath_new) . '" class="menucateg">';
} else {
$categories_string .= tep_href_link(FILENAME_DEFAULT, $cPath_new) . '" class="menusubcateg">';
}
//fin de la modif
// affiche en gras la categorie ou sous categorie active
if (isset($cPath_array) && in_array($counter, $cPath_array)) {
$categories_string .= '<b><font color="#B4CB27">';
}
// affiche le nom des categories et sous categorie
$categories_string .= $tree[$counter]['name'];
if (isset($cPath_array) && in_array($counter, $cPath_array)) {
$categories_string .= '</b></font>';
}
// ajoute la petite fleche > après une categorie de produit
if (tep_has_category_subcategories($counter)) {
// ligne originale $categories_string .= '->';
// ajout de cette ligne pour afficher un espace puis l image de la petite fleche
$categories_string .= ' ' . tep_image(DIR_WS_IMAGES . 'pointer_blue_light.gif', '');
}
$categories_string .= '</a>';
if (SHOW_COUNTS == 'true') {
$products_in_category = tep_count_products_in_category($counter);
if ($products_in_category > 0) {
$categories_string .= ' (' . $products_in_category . ')';
}
}
$categories_string .= '';
// ligne original $categories_string .= '<br>';
// pour ajouter une ligne entre categorie mettre a L.60 $categories_string .= '<hr size="1px">';
if ($tree[$counter]['next_id'] != false) {
tep_show_category($tree[$counter]['next_id']);
}
}
?>
<!-- categories //-->
<tr>
<td>
<?php
$info_box_contents = array();
$info_box_contents[] = array('text' => BOX_HEADING_CATEGORIES);
new infoBoxHeading($info_box_contents, true, true);
$categories_string = '';
$tree = array();
//ajout L. 84 85 86 pour espace avec le heading de la box et la box des categories
?>
<tr>
<td>
<?php
$categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '0' and c.categories_id = cd.categories_id and cd.language_id='" . (int)$languages_id ."' order by sort_order, cd.categories_name");
while ($categories = tep_db_fetch_array($categories_query)) {
$tree[$categories['categories_id']] = array('name' => $categories['categories_name'],
'parent' => $categories['parent_id'],
'level' => 0,
'path' => $categories['categories_id'],
'next_id' => false);
if (isset($parent_id)) {
$tree[$parent_id]['next_id'] = $categories['categories_id'];
}
$parent_id = $categories['categories_id'];
if (!isset($first_element)) {
$first_element = $categories['categories_id'];
}
}
//------------------------
if (tep_not_null($cPath)) {
$new_path = '';
reset($cPath_array);
while (list($key, $value) = each($cPath_array)) {
unset($parent_id);
unset($first_id);
$categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$value . "' and c.categories_id = cd.categories_id and cd.language_id='" . (int)$languages_id ."' order by sort_order, cd.categories_name");
if (tep_db_num_rows($categories_query)) {
$new_path .= $value;
while ($row = tep_db_fetch_array($categories_query)) {
$tree[$row['categories_id']] = array('name' => $row['categories_name'],
'parent' => $row['parent_id'],
'level' => $key+1,
'path' => $new_path . '_' . $row['categories_id'],
'next_id' => false);
if (isset($parent_id)) {
$tree[$parent_id]['next_id'] = $row['categories_id'];
}
$parent_id = $row['categories_id'];
if (!isset($first_id)) {
$first_id = $row['categories_id'];
}
$last_id = $row['categories_id'];
}
$tree[$last_id]['next_id'] = $tree[$value]['next_id'];
$tree[$value]['next_id'] = $first_id;
$new_path .= '_';
} else {
break;
}
}
}
tep_show_category($first_element);
$info_box_contents = array();
$info_box_contents[] = array('text' => $categories_string);
//modification appel style css boxe categorie
// au lie de
// new infoBox($info_box_contents);
// new infoBoxcategorie($info_box_contents, infoBoxcategorie);
new noborderBox2 ($info_box_contents, true);
?>
<!-- ajout espace L 154 et 155 //-->
</td>
</tr>
</td>
</tr>
<!-- categories_eof //-->
Ensuite ajouter dans includes/classes/boxes.php, la définition du style noborderbox2
Code
//ajout d'une classe de box categorie pour la contrib show subcategorie style noborderbox2
class noborderBox2 extends tableBox {
function noborderBox2($contents) {
$info_box_contents = array();
$info_box_contents[] = array('text' => $this->noborderBox2Contents($contents));
//ligne suivante definie la largeur du cadre de la box categorie, valeur 0 enleve le cadre
$this->table_cellpadding = '0';
$this->table_parameters = 'class="infoBox"';
$this->tableBox($info_box_contents, true);
}
function noborderBox2Contents($contents) {
$this->table_cellpadding = '0';
$this->table_parameters = 'class="infoBoxContents"';
$info_box_contents = array();
$info_box_contents[] = array(array('text' => tep_draw_separator('pixel_trans.gif', '100%', '1')));
for ($i=0, $n=sizeof($contents); $i<$n; $i++) {
$info_box_contents[] = array(array('align' => (isset($contents[$i]['align']) ? $contents[$i]['align'] : ''),
'form' => (isset($contents[$i]['form']) ? $contents[$i]['form'] : ''),
'params' => 'class="boxText"',
'text' => (isset($contents[$i]['text']) ? $contents[$i]['text'] : '')));
}
$info_box_contents[] = array(array('text' => tep_draw_separator('pixel_trans.gif', '100%', '1')));
return $this->tableBox($info_box_contents);
}
}
//fin ajout class box subcategorie
Et enfin déclarer dans stylesheet.css, la partie CSS mise un peu plus haut. Après à chacun de choisir les couleurs ou images de fond.
Encore merci NoZic pour toute ton aide,
bonne soirée.