|
|||
|
Ich m?chte gerne dass der Kunde beim Artikelmen? die Kategorie anklickt und dann die Unterkategorie aufgeht.
Bsp: Kategorie Computer - Unterkategorie Geh?use Soweit alles Super! Aber: Jetzt klickt der Kunde auf die UKategorie Geh?use und eine weiter Kategorie ?ffnet sich. z.B. Marke 1 Das soll aber nicht passieren die Unterunterkategorie soll lediglich auf der Contentseite zu sehen sein - nicht aber im Men?. wer sich das praktische Beispiel anschauen will und eine idee hat: www.my-easymobile.de |
|
|||
|
Danke Homer f?r die prompte Antwort. Leider ?berfordert mich dein L?sungsansatz ein wenig. Hast du das ein wenig konkreter? In der Tat habe ich ein wenig Probleme mit der <ul>
Hier einmal der derzeitige Inhalt meiner xtc_show_category.inc.php: Code:
$img_1='';
for ($a=0; $a<$foo[$counter]['level']; $a++) {
if ($foo[$counter]['level']=='1') {
$categories_string .= "<ul class='children'><li>";
}
$categories_string .= "";
}
if ($foo[$counter]['level']=='') {
if (strlen($categories_string)=='0') {
$categories_string .='';
} else {
$categories_string .='';
}
$categories_string .= $img_1;
$categories_string .= '<li class="current-cat"><a href="';
} else {
$categories_string .= '<a href="';
}
if ($foo[$counter]['parent'] == 0) {
$cPath_new = 'cPath=' . $counter;
} else {
$cPath_new = 'cPath=' . $foo[$counter]['path'];
}
if (SEARCH_ENGINE_FRIENDLY_URLS == 'true') $cPath_new.='&category='.xtc_cleanName($foo[$counter]['name']);
$categories_string .= xtc_href_link(FILENAME_DEFAULT, $cPath_new);
$categories_string .= '">';
if ( ($id) && (in_array($counter, $id)) ) {
$categories_string .= '<b>';
}
// display category name
$categories_string .= $foo[$counter]['name'];
if ( ($id) && (in_array($counter, $id)) ) {
$categories_string .= '</b>';
}
if (xtc_has_category_subcategories($counter)) {
$categories_string .= '';
}
if ($foo[$counter]['level']=='') {
$categories_string .= '</a></b>';
} else {
$categories_string .= '</a></li></ul>';
}
if (SHOW_COUNTS == 'true') {
$products_in_category = xtc_count_products_in_category($counter);
if ($products_in_category > 0) {
$categories_string .= '(' . $products_in_category . ')';
}
}
$categories_string .= '';
if ($foo[$counter]['next_id']) {
xtc_show_category($foo[$counter]['next_id']);
} else {
$categories_string .= '';
}
}
?>
|
|
|||
|
das Template
Code:
{config_load file="$language/lang_$language.conf" section="boxes"}
<table width="200" cellpadding="0" cellspacing="0" border="0" id="menu">
<tr><td id="static_produktkategorie">{#heading_categories#}</td></tr>
{foreach from=$BOX_CONTENT item=kategorie}
<tr><td>
{if $kategorie.active}
<a href="{$kategorie.link}"
{if $kategorie.level eq 0}class="main_kat_act"
{elseif $kategorie.level eq 1} class="sub_kat_act"
{else} class="sub_sub_kat_act"{/if}>
{$kategorie.name}{if $kategorie.productcount} ({$kategorie.productcount}){/if}</a>
{else}
<a href="{$kategorie.link}"
{if $kategorie.level eq 0}class="main_kat"
{elseif $kategorie.level eq 1} class="sub_kat"
{else} class="sub_sub_kat"{/if}>
{$kategorie.name}{if $kategorie.productcount} ({$kategorie.productcount}){/if}</a>
{/if}
</td></tr>
{/foreach}
</table>
Code:
function xtc_show_category($counter) {
global $foo, $categories_string, $id;
$categories_string[$counter]['name']=$foo[$counter]['name'];
$categories_string[$counter]['level']=$foo[$counter]['level'];
$categories_string[$counter]['parent']=$foo[$counter]['parent'];
$categories_string[$counter]['path']=$foo[$counter]['path'];
$categories_string[$counter]['next']=$foo[$counter]['next_id'];
$cPath_new=xtc_category_link($counter, $foo[$counter]['name']);
$categories_string[$counter]['link']= xtc_href_link(FILENAME_DEFAULT, $cPath_new);
if (SHOW_COUNTS == 'true') {
$products_in_category = xtc_count_products_in_category($counter);
if ($products_in_category > 0) {
$categories_string[$counter]['productcount']= $products_in_category;
}
}
if ( ($id) && (in_array($counter, $id)) ) {
$categories_string[$counter]['active']=true;
}
if ($foo[$counter]['next_id']) {
xtc_show_category($foo[$counter]['next_id']);
}
}
viel spass |
![]() |
| Lesezeichen |
| Stichworte |
| erwnscht, oberkategorien |
| Themen-Optionen | |
| Ansicht | |
|
|