Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Top menu - if selected or if user is in a category/product etc under top menu css class change to selected or somewhat
 
v2uk
Member
 
Total Posts:  64
Joined:  2008-03-23
 

Hi guys, I’m trying to figure out how to change the code so if a user clicks on one of the top menu items, the class changes for that clicked item to ‘selected’ likewise if the user is on (top level item) foo > sub cat > sub cat > product, ‘foo’ would still remaing as classed as ‘selected. Any ideas how I can do this? I know CSS, but I don’t know the backend code to allow this functionality, unless I’m missing something.

 
Magento Community Magento Community
Magento Community
Magento Community
 
v2uk
Member
 
Total Posts:  64
Joined:  2008-03-23
 

anyone?

All i’m trying to do is apply a class / id to what’s currently selected / what current tree the user is in.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Tweakmag
Guru
 
Avatar
Total Posts:  307
Joined:  2007-08-31
London, UK
 

Hi v2uk - this will be a relatively simple fix - the basic idea is that you need to pass an id for the body tag (<body id="category_name">) and then you can style the nav accordingly.
I will no doubt be doing this change once v1 comes out… please PM me if I don’t post a answer 2-3days after v1 comes out.
Cheers
Adam

 
Magento Community Magento Community
Magento Community
Magento Community
 
v2uk
Member
 
Total Posts:  64
Joined:  2008-03-23
 

sounds good =)

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top