Hallo, wie kann ich die aktive Kategorie farblich hervorheben? (sehe Bild) Ich verwende nur die Kategorien, links. Danke im Voraus.
Hallo, wenn ich mich nicht irre fehlt hierfür das Erkennungsmerkmal. Ist auf unserer Feature-Liste. Mag aber sein, dass andere hier ein Lösung dafür haben.
Wie möchtest Du das farblich hervorheben? Möchtest Du die Schriftfarbe ändern? Das geht mit dem Style Editor.
Das geht! Öffne mit nem Editor die /templates/EyeCandy/boxes/box_categories_left.html oder wenn du die als USERMOD hast die box_categories_left-USERMOD.html füge nach: Code: {foreach name=cat_data item=categories_item from=$content_data.CATEGORIES_DATA} das ein: Code: {assign var=ID value=$categories_item.data.id} {php} $catId = $this->get_template_vars('ID'); $getID = $_GET["cPath"]; if($getID==$catId) $class="active"; else $class=""; {/php} erstelle eine CSS-Datei active.css und lege da fest wie die Kat hervorgehoben werden soll. Speichere diese in /templates/EyeCandy/usermod/css/ und fertig. Beispiel: http://www.reifen24.de
in die Datei: .content-box.categories li.active { color: #ff6600; } (Beispiel für orange) die kannst aber auch wechlassen da diese ja schon im CSS da ist und mit dem StyleEmil bearbeitet werden kann.
Ups was vergessen! In der box_categories_left.html aus Code: <li id="menu_cat_id_{$categories_item.data.id}" {if $smarty.foreach.cat_data.first}first{elseif $smarty.foreach.cat_data.last}last{/if}" > machst du Code: <li id="menu_cat_id_{$categories_item.data.id}" class=" {php} if($class) echo $class.' ';{/php}" {if $smarty.foreach.cat_data.first}first{elseif $smarty.foreach.cat_data.last}last{/if}" >
wo soll ich die Datei "box_categories_left-USERMOD.html" speichern? Code: {load_language_text section="box_categories"} <div id="menubox_categories" class="c_categories content-box white no-border categories submenu"> <ul> {foreach name=cat_data item=categories_item from=$content_data.CATEGORIES_DATA} <li id="menu_cat_id_{$categories_item.data.id}" {php} $catId = $this->get_template_vars('ID'); $getID = $_GET["cPath"]; if($getID==$catId) $class="active"; else $class=""; {/php} class="{if $smarty.foreach.cat_data.first}first{elseif $smarty.foreach.cat_data.last}last{/if}" > <h4> {if $categories_item.data.icon}<img src="{$categories_item.data.icon}" width="{$categories_item.data.icon_w}" height="{$categories_item.data.icon_h}" alt="" />{/if}<a href="{$categories_item.data.url}" rel="{$categories_item.data.id}" {if $categories_item.data.meta_description != ''} title="{$categories_item.data.meta_description|truncate:80:"..."|replace:'"':'"'}"{/if}{if $categories_item.children|@count > 0} class="parent"{/if}>{$categories_item.data.name}{if $categories_item.data.products_count} ({$categories_item.data.products_count}){/if}</a> </h4> </li> {/foreach} </ul> </div>
Dein Code hat Fehler! Nimm das: Code: {load_language_text section="box_categories"} <div id="menubox_categories" class="c_categories content-box white no-border categories submenu"> <ul> {foreach name=cat_data item=categories_item from=$content_data.CATEGORIES_DATA} {assign var=ID value=$categories_item.data.id} {php} $catId = $this->get_template_vars('ID'); $getID = $_GET["cPath"]; if($getID==$catId) $class="active"; else $class=""; {/php} <li id="menu_cat_id_{$categories_item.data.id}" class=" {php} if($class) echo $class.' ';{/php}" {if $smarty.foreach.cat_data.first}first{elseif $smarty.foreach.cat_data.last}last{/if}" > <h4> <div class="button_brown button_set"> {if $categories_item.data.icon}<div class="icon_cats" style="background-image:url({$categories_item.data.icon});">{/if}<a href="{$categories_item.data.url}" rel="{$categories_item.data.id}" {if $categories_item.data.meta_description != ''} title="{$categories_item.data.meta_description|truncate:80:"..."|replace:'"':'"'}"{/if}{if $categories_item.children|@count > 0} class="parent"{/if}>{$categories_item.data.name}{if $categories_item.data.products_count} ({$categories_item.data.products_count}){/if}</a></div></div> </h4> </li> {/foreach} </ul> </div>
Deine Katekorien sehn sch..... aus! Das Kat-Bild solltest du auf no-repeat setzen! Was machst du falsch???
Probier mal das: Code: {load_language_text section="box_categories"} <div id="menubox_categories" class="c_categories content-box white no-border categories submenu"> <ul> {foreach name=cat_data item=categories_item from=$content_data.CATEGORIES_DATA} {assign var=ID value=$categories_item.data.id} {php} $catId = $this->get_template_vars('ID'); $getID = $_GET["cPath"]; if($getID==$catId) $class="active"; else $class=""; {/php} <li id="menu_cat_id_{$categories_item.data.id}" class="{php} if($class) echo $class.' ';{/php} {if $smarty.foreach.cat_data.first}first{elseif $smarty.foreach.cat_data.last}last{/if}" > <h4> {if $categories_item.data.icon}<img src="{$categories_item.data.icon}" width="{$categories_item.data.icon_w}" height="{$categories_item.data.icon_h}" alt="" />{/if}<a href="{$categories_item.data.url}" rel="{$categories_item.data.id}" {if $categories_item.data.meta_description != ''} title="{$categories_item.data.meta_description|truncate:80:"..."|replace:'"':'"'}"{/if}{if $categories_item.children|@count > 0} class="parent"{/if}>{$categories_item.data.name}{if $categories_item.data.products_count} ({$categories_item.data.products_count}){/if}</a> </h4> </li> {/foreach} </ul> </div>
Teste mal! Wir haben bei R24 eine etwas andere Aufbaustruktur der Kat-Menüs. Code: {load_language_text section="box_categories"} <div id="menubox_categories" class="c_categories content-box white no-border categories submenu"> <ul> {foreach name=cat_data item=categories_item from=$content_data.CATEGORIES_DATA} {assign var=ID value=$categories_item.data.id} {php} $catId = $this->get_template_vars('ID'); $getID = $_GET["cPath"]; if($getID==$catId) $class="active"; else $class=""; {/php} <li id="menu_cat_id_{$categories_item.data.id}" class="{php} if($class) echo $class.' ';{/php} {if $smarty.foreach.cat_data.first}first{elseif $smarty.foreach.cat_data.last}last{/if}" > <h4> {if $categories_item.data.icon}<img src="{$categories_item.data.icon}" class="{php} if($class) echo $class.' ';{/php} " width="{$categories_item.data.icon_w}" height="{$categories_item.data.icon_h}" alt="" />{/if}<a href="{$categories_item.data.url}" rel="{$categories_item.data.id}" {if $categories_item.data.meta_description != ''} title="{$categories_item.data.meta_description|truncate:80:"..."|replace:'"':'"'}"{/if}{if $categories_item.children|@count > 0} class="parent"{/if}>{$categories_item.data.name}{if $categories_item.data.products_count} ({$categories_item.data.products_count}){/if}</a> </h4> </li> {/foreach} </ul> </div>
Bei dir fehlt noch im CSS für den: body #wrap_box.wrap_shop .content-box.categories.submenu ul li a:active das: color: #000000;
Ich glaube es ist da. Code: body #wrap_box.wrap_shop .content-box.categories.submenu ul li a:active { background-color: #BAB5C9; background-image: none; background-position: 0px 0px; background-repeat: repeat; }