X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Highlight categories and subcategories (https://forum.x-cart.com/showthread.php?t=35689)

pmalerba 11-25-2007 11:35 AM

Highlight categories and subcategories
 
Hi to everyone!

I'm trying to get work correctly categories and subcategories.

Now my categories.tpl is:

PHP Code:

{* $Idcategories.tpl,v 1.26 2005/11/17 06:55:37 max Exp $ *}
<
h3>{$lng.lbl_categories}</h3>
{if 
$active_modules.Fancy_Categories ne ""}
{include 
file="modules/Fancy_Categories/categories.tpl"}
{
assign var="fc_cellpadding" value="0"}
{else}
{if 
$config.General.root_categories eq "Y"}
{foreach 
from=$categories item=c}
<
tr align="left"><td><a href="home.php?cat={$c.categoryid}class="mainlevel">{$c.category}</a></td></tr>
{foreach 
from=$allcategories item=cat}
{if 
$cat.parentid eq $c.categoryid}
<
tr align="left"><td><div style="padding-left: 4px"><img src="{$SkinDir}/images/indent1.png" alt="" /><a href="home.php?cat={$cat.categoryid}class="sublevel" >{$cat.category}</a></div></td></tr>
{/if}
{/foreach}
{/foreach}
{else} {foreach 
from=$subcategories item=c key=catid}
<
tr align="left"><td><a href="home.php?cat={$catid}class="sublevel">{$c.category}</a></td></tr>
{/foreach}
{/if}
{/if} 



The categories works fine but i have 2 big problems that i'm not able to solve:

1- When i go to a category or to a subcategory i'd like to have a css class active (like the hover) to highlight that we are in that category / subcategory
Here you can see the category Not Highlight: http://www.toyshunter.it/store/chogokin-c-3.html ( see the menu on the right Categorie)

2- When i go to a subcategory "magically" the subcategory on the menu disappearing! I cannot understand why!
Here you can see the magic disappearing of subcategories:
http://www.toyshunter.it/store/bandai-soul-of-chogokin-c-11.html ( see the menu on the right Categorie)

Thanks for your help!

balinor 11-25-2007 12:19 PM

Re: Highlight categories and subcategories
 
Hi pmalerba, would you take a moment to correct your signature? There is no version 4.8 of X-Cart..perhaps you mean 4.1.8 or 4.0.18?

pmalerba 11-25-2007 01:12 PM

Re: Highlight categories and subcategories
 
Quote:

Originally Posted by balinor
Hi pmalerba, would you take a moment to correct your signature? There is no version 4.8 of X-Cart..perhaps you mean 4.1.8 or 4.0.18?


I'm sorry! Now is correct! Thanks for your attention!

ecommerce 04-29-2008 08:42 PM

Re: Highlight categories and subcategories
 
pmalerba,

I like how you did your category menu. Is the code above the one you are using right now that's making it work right?

Basically I want hover effect and then highlight the current category on the menu. Just like u did.


All times are GMT -8. The time now is 10:14 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.